Update "More Actions" menu to "All Actions"

This commit is contained in:
Aleksandras Kostarevas 2024-07-23 12:01:26 +03:00
parent 4ee33fb365
commit 52084de79b
2 changed files with 11 additions and 4 deletions

View File

@ -13,7 +13,7 @@
<string name="redo_action_title">Redo</string>
<string name="text_edit_action_title">Text Editor</string>
<string name="mem_debug_action_title">Debug Info</string>
<string name="more_actions_action_title">More Actions</string>
<string name="more_actions_action_title">All Actions</string>
<string name="action_kind_action_key">Action Key</string>
<string name="action_kind_pinned_key">Pinned Action(s)</string>

View File

@ -108,13 +108,20 @@ fun MoreActionsView() {
useDataStoreValue(ActionsSettings)
}
val map = remember(actionList) {
actionList.toActionEditorItems().toActionMap()
}
val actions = remember(actionList) {
actionList.toActionEditorItems().toActionMap()[ActionCategory.More] ?: listOf()
(map[ActionCategory.Favorites] ?: listOf()) +
(map[ActionCategory.ActionKey] ?: listOf()) +
(map[ActionCategory.PinnedKey] ?: listOf()) +
(map[ActionCategory.More] ?: listOf())
}
if(actions.isEmpty()) {
ScreenTitle("No actions are assigned to More Actions")
ScreenTitle("No actions are enabled")
}
LazyVerticalGrid(
@ -249,7 +256,7 @@ val MoreActionsAction = Action(
super.WindowTitleBar(rowScope)
OutlinedButton(onClick = { manager.showActionEditor() }, modifier = Modifier.padding(8.dp, 0.dp)) {
Text("Edit Pinned", color = MaterialTheme.colorScheme.onBackground)
Text("Edit actions", color = MaterialTheme.colorScheme.onBackground)
}
}