Skip to content

Commit 6875085

Browse files
committed
Add Settings action on picker screens
1 parent 4d463d2 commit 6875085

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/foundation/picker/GenericPickerScreen.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import io.github.composegears.valkyrie.compose.util.isLight
2929
import io.github.composegears.valkyrie.ui.foundation.AppBarTitle
3030
import io.github.composegears.valkyrie.ui.foundation.BackAction
3131
import io.github.composegears.valkyrie.ui.foundation.DragAndDropBox
32+
import io.github.composegears.valkyrie.ui.foundation.SettingsAction
3233
import io.github.composegears.valkyrie.ui.foundation.TopAppBar
3334
import io.github.composegears.valkyrie.ui.foundation.theme.PreviewTheme
3435
import io.github.composegears.valkyrie.ui.platform.ClipboardDataType
@@ -57,6 +58,7 @@ fun GenericPickerScreen(
5758
onFilePick: (Path) -> Unit,
5859
onTextPaste: (String) -> Unit,
5960
onBrowseClick: () -> Unit,
61+
onOpenSettings: () -> Unit,
6062
modifier: Modifier = Modifier,
6163
description: String? = null,
6264
fileFilter: (Path) -> Boolean = { true },
@@ -77,6 +79,8 @@ fun GenericPickerScreen(
7779
TopAppBar {
7880
BackAction(onBack = onBack)
7981
AppBarTitle(title = title)
82+
WeightSpacer()
83+
SettingsAction(openSettings = onOpenSettings)
8084
}
8185
WeightSpacer(weight = 0.3f)
8286
PickerBox(
@@ -181,5 +185,6 @@ private fun GenericPickerScreenPreview() = PreviewTheme {
181185
onFilePick = {},
182186
onTextPaste = {},
183187
onBrowseClick = {},
188+
onOpenSettings = {},
184189
)
185190
}

tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/mode/imagevectortoxml/picker/ImageVectorPickerScreen.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import io.github.composegears.valkyrie.ui.platform.picker.rememberKtFilePicker
1212
import io.github.composegears.valkyrie.ui.screen.mode.imagevectortoxml.conversion.ImageVectorToXmlScreen
1313
import io.github.composegears.valkyrie.ui.screen.mode.imagevectortoxml.picker.model.ImageVectorPickerAction
1414
import io.github.composegears.valkyrie.ui.screen.mode.imagevectortoxml.picker.model.ImageVectorPickerEvent
15+
import io.github.composegears.valkyrie.ui.screen.settings.SettingsScreen
1516
import io.github.composegears.valkyrie.util.stringResource
1617
import kotlinx.coroutines.launch
1718

@@ -55,5 +56,8 @@ val ImageVectorPickerScreen by navDestination {
5556
}
5657
}
5758
},
59+
onOpenSettings = {
60+
navController.navigate(dest = SettingsScreen)
61+
},
5862
)
5963
}

tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/mode/simple/picker/SimplePickerScreen.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import io.github.composegears.valkyrie.ui.screen.mode.simple.conversion.SimpleCo
1313
import io.github.composegears.valkyrie.ui.screen.mode.simple.picker.model.SimplePickerAction.OnDragAndDropPath
1414
import io.github.composegears.valkyrie.ui.screen.mode.simple.picker.model.SimplePickerAction.OnPasteFromClipboard
1515
import io.github.composegears.valkyrie.ui.screen.mode.simple.picker.model.SimplePickerEvent
16+
import io.github.composegears.valkyrie.ui.screen.settings.SettingsScreen
1617
import kotlinx.coroutines.launch
1718

1819
val SimplePickerScreen by navDestination {
@@ -53,5 +54,8 @@ val SimplePickerScreen by navDestination {
5354
}
5455
}
5556
},
57+
onOpenSettings = {
58+
navController.navigate(dest = SettingsScreen)
59+
},
5660
)
5761
}

0 commit comments

Comments
 (0)