manager: show webui and action label when a module has it

This commit is contained in:
rifsxd
2025-05-28 20:42:57 +06:00
parent 18f0eb8a36
commit 15b703b5f2
2 changed files with 24 additions and 7 deletions

View File

@@ -679,10 +679,7 @@ fun ModuleItem(
LabelItem(
text = if (module.enabled) stringResource(R.string.enabled) else stringResource(R.string.disabled),
style = if (module.enabled)
com.dergoogler.mmrl.ui.component.LabelItemDefaults.style.copy(
containerColor = MaterialTheme.colorScheme.primaryContainer,
contentColor = MaterialTheme.colorScheme.onPrimaryContainer
)
com.dergoogler.mmrl.ui.component.LabelItemDefaults.style.copy()
else
com.dergoogler.mmrl.ui.component.LabelItemDefaults.style.copy(
containerColor = MaterialTheme.colorScheme.errorContainer,
@@ -690,12 +687,31 @@ fun ModuleItem(
)
)
// Update notifier indicator
if (module.hasWebUi) {
LabelItem(
text = stringResource(R.string.webui),
style = com.dergoogler.mmrl.ui.component.LabelItemDefaults.style.copy(
containerColor = MaterialTheme.colorScheme.primaryContainer,
contentColor = MaterialTheme.colorScheme.onPrimaryContainer
)
)
}
// Update notifier indicator
if (module.hasActionScript) {
LabelItem(
text = stringResource(R.string.action),
style = com.dergoogler.mmrl.ui.component.LabelItemDefaults.style.copy(
containerColor = MaterialTheme.colorScheme.secondaryContainer,
contentColor = MaterialTheme.colorScheme.onSecondaryContainer
)
)
}
if (updateUrl.isNotEmpty() && !module.remove) {
LabelItem(
text = stringResource(R.string.module_update),
style = com.dergoogler.mmrl.ui.component.LabelItemDefaults.style.copy(
containerColor = MaterialTheme.colorScheme.secondaryContainer,
contentColor = MaterialTheme.colorScheme.onSecondaryContainer
containerColor = MaterialTheme.colorScheme.onTertiary,
contentColor = MaterialTheme.colorScheme.onTertiaryContainer
)
)
}
@@ -774,7 +790,7 @@ fun ModuleItem(
// WebUI
if (module.hasWebUi) {
DropdownMenuItem(
text = { Text(stringResource(R.string.open)) },
text = { Text(stringResource(R.string.webui)) },
onClick = {
menuExpanded = false
onClick(module)

View File

@@ -177,6 +177,7 @@
<string name="settings_check_update_summary">Automatically check for updates when opening the app.</string>
<string name="grant_root_failed">Failed to grant root!</string>
<string name="action">Action</string>
<string name="webui">WebUI</string>
<string name="open">Open</string>
<string name="enable_web_debugging">Enable WebView debugging</string>
<string name="enable_web_debugging_summary">Can be used to debug WebUI. Please enable only when needed.</string>