Skip to content

Commit a993a8b

Browse files
committed
Improve overflow menu UI
Signed-off-by: Saul Henriquez <saul_henriquez@hotmail.com>
1 parent 2368cfc commit a993a8b

5 files changed

Lines changed: 226 additions & 27 deletions

File tree

Omega/src/com/neoapps/neolauncher/compose/components/OverflowMenu.kt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
package com.neoapps.neolauncher.compose.components
2020

2121
import androidx.compose.foundation.layout.Box
22+
import androidx.compose.foundation.layout.padding
2223
import androidx.compose.material.icons.Icons
2324
import androidx.compose.material.icons.rounded.MoreVert
2425
import androidx.compose.material3.DropdownMenu
@@ -29,6 +30,7 @@ import androidx.compose.runtime.Composable
2930
import androidx.compose.runtime.MutableState
3031
import androidx.compose.runtime.mutableStateOf
3132
import androidx.compose.runtime.remember
33+
import androidx.compose.ui.Modifier
3234
import androidx.compose.ui.res.stringResource
3335
import androidx.compose.ui.unit.DpOffset
3436
import androidx.compose.ui.unit.dp
@@ -39,7 +41,9 @@ fun OverflowMenu(block: @Composable OverflowMenuScope.() -> Unit) {
3941
val showMenu = remember { mutableStateOf(false) }
4042
val overflowMenuScope = remember { OverflowMenuScopeImpl(showMenu) }
4143

42-
Box {
44+
Box(
45+
modifier = Modifier.padding(end = 8.dp)
46+
) {
4347
IconButton(
4448
onClick = { showMenu.value = true }
4549
) {
@@ -52,7 +56,8 @@ fun OverflowMenu(block: @Composable OverflowMenuScope.() -> Unit) {
5256
DropdownMenu(
5357
expanded = showMenu.value,
5458
onDismissRequest = { showMenu.value = false },
55-
offset = DpOffset(x = 8.dp, y = (-8).dp)
59+
offset = DpOffset(x = 8.dp, y = (-2).dp),
60+
shape = MaterialTheme.shapes.medium
5661
) {
5762
block(overflowMenuScope)
5863
}
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
/*
2+
* This file is part of Neo Launcher
3+
* Copyright (c) 2026 Neo Launcher Team
4+
*
5+
* This program is free software: you can redistribute it and/or modify
6+
* it under the terms of the GNU General Public License as
7+
* published by the Free Software Foundation, either version 3 of the
8+
* License, or (at your option) any later version.
9+
* This program is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
* GNU General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU General Public License
15+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
16+
*/
17+
18+
package com.neoapps.neolauncher.compose.icons.phosphor
19+
20+
import androidx.compose.ui.graphics.Color
21+
import androidx.compose.ui.graphics.PathFillType.Companion.NonZero
22+
import androidx.compose.ui.graphics.SolidColor
23+
import androidx.compose.ui.graphics.StrokeCap.Companion.Butt
24+
import androidx.compose.ui.graphics.StrokeJoin.Companion.Miter
25+
import androidx.compose.ui.graphics.vector.ImageVector
26+
import androidx.compose.ui.graphics.vector.ImageVector.Builder
27+
import androidx.compose.ui.graphics.vector.path
28+
import androidx.compose.ui.unit.dp
29+
import com.neoapps.neolauncher.compose.icons.Phosphor
30+
31+
val Phosphor.Home: ImageVector
32+
get() {
33+
return Builder(
34+
name = "Home",
35+
defaultWidth = 24.0.dp,
36+
defaultHeight = 24.0.dp,
37+
viewportWidth = 256.0f,
38+
viewportHeight = 256.0f,
39+
).apply {
40+
path(
41+
fill = SolidColor(Color(0xFF000000)),
42+
stroke = null,
43+
strokeLineWidth = 0.0f,
44+
strokeLineCap = Butt,
45+
strokeLineJoin = Miter,
46+
strokeLineMiter = 1f,
47+
pathFillType = NonZero
48+
) {
49+
moveTo(240f, 208f)
50+
lineTo(224f, 208f)
51+
lineTo(224f, 136f)
52+
lineTo(226.34f, 138.34f)
53+
arcTo(8f, 8f, 0f, false, false, 237.66f, 127f)
54+
lineTo(139.31f, 28.68f)
55+
arcTo(16f, 16f, 0f, false, false, 116.69f, 28.68f)
56+
lineTo(18.34f, 127f)
57+
arcTo(8f, 8f, 0f, false, false, 29.66f, 138.31f)
58+
lineTo(32f, 136f)
59+
lineTo(32f, 208f)
60+
lineTo(16f, 208f)
61+
arcTo(8f, 8f, 0f, false, false, 16f, 224f)
62+
lineTo(240f, 224f)
63+
arcTo(8f, 8f, 0f, false, false, 240f, 208f)
64+
close()
65+
}
66+
}
67+
.build()
68+
}
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
/*
2+
* This file is part of Neo Launcher
3+
* Copyright (c) 2026 Neo Launcher Team
4+
*
5+
* This program is free software: you can redistribute it and/or modify
6+
* it under the terms of the GNU General Public License as
7+
* published by the Free Software Foundation, either version 3 of the
8+
* License, or (at your option) any later version.
9+
* This program is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
* GNU General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU General Public License
15+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
16+
*/
17+
18+
package com.neoapps.neolauncher.compose.icons.phosphor
19+
20+
import androidx.compose.ui.graphics.Color
21+
import androidx.compose.ui.graphics.PathFillType.Companion.NonZero
22+
import androidx.compose.ui.graphics.SolidColor
23+
import androidx.compose.ui.graphics.StrokeCap.Companion.Butt
24+
import androidx.compose.ui.graphics.StrokeJoin.Companion.Miter
25+
import androidx.compose.ui.graphics.vector.ImageVector
26+
import androidx.compose.ui.graphics.vector.ImageVector.Builder
27+
import androidx.compose.ui.graphics.vector.path
28+
import androidx.compose.ui.unit.dp
29+
import com.neoapps.neolauncher.compose.icons.Phosphor
30+
31+
val Phosphor.Infinity: ImageVector
32+
get() {
33+
return Builder(
34+
name = "Infinity",
35+
defaultWidth = 24.0.dp,
36+
defaultHeight = 24.0.dp,
37+
viewportWidth = 256.0f,
38+
viewportHeight = 256.0f,
39+
).apply {
40+
path(
41+
fill = SolidColor(Color(0xFF000000)),
42+
stroke = null,
43+
strokeLineWidth = 0.0f,
44+
strokeLineCap = Butt,
45+
strokeLineJoin = Miter,
46+
strokeLineMiter = 1f,
47+
pathFillType = NonZero
48+
) {
49+
moveTo(248f, 128f)
50+
arcToRelative(56f, 56f, 0f, false, true, -95.6f, 39.6f)
51+
lineToRelative(-0.33f, -0.35f)
52+
lineTo(92.12f, 99.55f)
53+
arcToRelative(40f, 40f, 0f, true, false, 0f, 56.9f)
54+
lineToRelative(8.52f, -9.62f)
55+
arcToRelative(8f, 8f, 0f, true, true, 12f, 10.61f)
56+
lineToRelative(-8.69f, 9.81f)
57+
lineToRelative(-0.33f, 0.35f)
58+
arcToRelative(56f, 56f, 0f, true, true, 0f, -79.2f)
59+
lineToRelative(0.33f, 0.35f)
60+
lineToRelative(59.95f, 67.7f)
61+
arcToRelative(40f, 40f, 0f, true, false, 0f, -56.9f)
62+
lineToRelative(-8.52f, 9.62f)
63+
arcToRelative(8f, 8f, 0f, true, true, -12f, -10.61f)
64+
lineToRelative(8.69f, -9.81f)
65+
lineToRelative(0.33f, -0.35f)
66+
arcTo(56f, 56f, 0f, false, true, 248f, 128f)
67+
close()
68+
}
69+
}
70+
.build()
71+
}

Omega/src/com/neoapps/neolauncher/compose/icons/phosphor/Power.kt

Lines changed: 40 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
/*
2+
* This file is part of Neo Launcher
3+
* Copyright (c) 2026 Neo Launcher Team
4+
*
5+
* This program is free software: you can redistribute it and/or modify
6+
* it under the terms of the GNU General Public License as
7+
* published by the Free Software Foundation, either version 3 of the
8+
* License, or (at your option) any later version.
9+
* This program is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
* GNU General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU General Public License
15+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
16+
*/
17+
118
package com.neoapps.neolauncher.compose.icons.phosphor
219

320
import androidx.compose.ui.graphics.Color
@@ -13,39 +30,40 @@ import com.neoapps.neolauncher.compose.icons.Phosphor
1330

1431
val Phosphor.Power: ImageVector
1532
get() {
16-
if (_power != null) {
17-
return _power!!
18-
}
19-
_power = Builder(
33+
return Builder(
2034
name = "Power",
2135
defaultWidth = 24.0.dp,
2236
defaultHeight = 24.0.dp,
2337
viewportWidth = 256.0f,
24-
viewportHeight = 256.0f
38+
viewportHeight = 256.0f,
2539
).apply {
2640
path(
27-
fill = SolidColor(Color(0xFF000000)), stroke = null, strokeLineWidth = 0.0f,
28-
strokeLineCap = Butt, strokeLineJoin = Miter, strokeLineMiter = 4.0f,
41+
fill = SolidColor(Color(0xFF000000)),
42+
stroke = null,
43+
strokeLineWidth = 0.0f,
44+
strokeLineCap = Butt,
45+
strokeLineJoin = Miter,
46+
strokeLineMiter = 1f,
2947
pathFillType = NonZero
3048
) {
31-
moveTo(120.0f, 124.0f)
32-
lineTo(120.0f, 48.0f)
33-
arcToRelative(8.0f, 8.0f, 0.0f, false, true, 16.0f, 0.0f)
34-
verticalLineToRelative(76.0f)
35-
arcToRelative(8.0f, 8.0f, 0.0f, false, true, -16.0f, 0.0f)
49+
moveTo(120f, 128f)
50+
verticalLineTo(48f)
51+
arcToRelative(8f, 8f, 0f, false, true, 16f, 0f)
52+
verticalLineTo(128f)
53+
arcToRelative(8f, 8f, 0f, false, true, -16f, 0f)
3654
close()
37-
moveTo(180.4f, 47.5f)
38-
arcToRelative(8.1f, 8.1f, 0.0f, false, false, -11.1f, 2.4f)
39-
arcToRelative(7.9f, 7.9f, 0.0f, false, false, 2.3f, 11.0f)
40-
arcToRelative(80.0f, 80.0f, 0.0f, true, true, -87.2f, 0.0f)
41-
arcToRelative(7.9f, 7.9f, 0.0f, false, false, 2.3f, -11.0f)
42-
arcToRelative(8.1f, 8.1f, 0.0f, false, false, -11.1f, -2.4f)
43-
arcToRelative(96.0f, 96.0f, 0.0f, true, false, 104.8f, 0.0f)
55+
56+
moveTo(180.37f, 49.3f)
57+
arcToRelative(8f, 8f, 0f, false, false, -8.74f, 13.4f)
58+
curveTo(194.74f, 77.77f, 208f, 101.57f, 208f, 128f)
59+
arcToRelative(80f, 80f, 0f, false, true, -160f, 0f)
60+
curveToRelative(0f, -26.43f, 13.26f, -50.23f, 36.37f, -65.3f)
61+
arcToRelative(8f, 8f, 0f, false, false, -8.74f, -13.4f)
62+
curveTo(47.9f, 67.38f, 32f, 96.06f, 32f, 128f)
63+
arcToRelative(96f, 96f, 0f, false, false, 192f, 0f)
64+
curveTo(224f, 96.06f, 208.1f, 67.38f, 180.37f, 49.3f)
4465
close()
4566
}
4667
}
4768
.build()
48-
return _power!!
4969
}
50-
51-
private var _power: ImageVector? = null

Omega/src/com/neoapps/neolauncher/compose/pages/preferences/MainPrefsPage.kt

Lines changed: 40 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import android.app.Activity
2222
import android.content.Intent
2323
import android.content.pm.PackageManager
2424
import android.content.pm.ResolveInfo
25+
import androidx.compose.foundation.background
2526
import androidx.compose.foundation.layout.Arrangement
2627
import androidx.compose.foundation.layout.Column
2728
import androidx.compose.foundation.layout.PaddingValues
@@ -30,6 +31,9 @@ import androidx.compose.foundation.layout.padding
3031
import androidx.compose.foundation.rememberScrollState
3132
import androidx.compose.foundation.verticalScroll
3233
import androidx.compose.material3.DropdownMenuItem
34+
import androidx.compose.material3.HorizontalDivider
35+
import androidx.compose.material3.Icon
36+
import androidx.compose.material3.MaterialTheme
3337
import androidx.compose.material3.Text
3438
import androidx.compose.material3.adaptive.ExperimentalMaterial3AdaptiveApi
3539
import androidx.compose.material3.adaptive.layout.AnimatedPane
@@ -54,6 +58,10 @@ import com.neoapps.neolauncher.compose.components.OverflowMenu
5458
import com.neoapps.neolauncher.compose.components.ViewWithActionBar
5559
import com.neoapps.neolauncher.compose.components.plus
5660
import com.neoapps.neolauncher.compose.components.preferences.PreferenceGroup
61+
import com.neoapps.neolauncher.compose.icons.Phosphor
62+
import com.neoapps.neolauncher.compose.icons.phosphor.Home
63+
import com.neoapps.neolauncher.compose.icons.phosphor.Infinity
64+
import com.neoapps.neolauncher.compose.icons.phosphor.Power
5765
import com.neoapps.neolauncher.compose.navigation.LocalPaneNavigator
5866
import com.neoapps.neolauncher.compose.navigation.NavRoute
5967
import com.neoapps.neolauncher.compose.objects.PageItem
@@ -137,15 +145,37 @@ fun MainPrefsPage() {
137145
(context as? Activity)?.finish()
138146
hideMenu()
139147
},
140-
text = { Text(text = stringResource(id = R.string.change_default_home)) }
148+
text = { Text(text = stringResource(id = R.string.change_default_home)) },
149+
leadingIcon = {
150+
Icon(
151+
imageVector = Phosphor.Home,
152+
contentDescription = stringResource(id = R.string.home_screen),
153+
tint = MaterialTheme.colorScheme.primary
154+
)
155+
}
156+
)
157+
HorizontalDivider(
158+
modifier = Modifier
159+
.background(MaterialTheme.colorScheme.outline)
141160
)
142161
}
143162
DropdownMenuItem(
144163
onClick = {
145164
Utilities.killLauncher()
146165
hideMenu()
147166
},
148-
text = { Text(text = stringResource(id = R.string.title__restart_launcher)) }
167+
text = { Text(text = stringResource(id = R.string.title__restart_launcher)) },
168+
leadingIcon = {
169+
Icon(
170+
imageVector = Phosphor.Power,
171+
contentDescription = stringResource(id = R.string.title__restart_launcher),
172+
tint = MaterialTheme.colorScheme.primary
173+
)
174+
}
175+
)
176+
HorizontalDivider(
177+
modifier = Modifier
178+
.background(MaterialTheme.colorScheme.outline)
149179
)
150180
DropdownMenuItem(
151181
onClick = {
@@ -157,7 +187,14 @@ fun MainPrefsPage() {
157187
)
158188
}
159189
},
160-
text = { Text(text = stringResource(id = R.string.developer_options_title)) }
190+
text = { Text(text = stringResource(id = R.string.developer_options_title)) },
191+
leadingIcon = {
192+
Icon(
193+
imageVector = Phosphor.Infinity,
194+
contentDescription = stringResource(id = R.string.developer_options_title),
195+
tint = MaterialTheme.colorScheme.primary
196+
)
197+
}
161198
)
162199
}
163200
}

0 commit comments

Comments
 (0)