mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-06-10 05:03:28 -04:00
feat(settings): add compositor section & restructured settings
- add dedicated Compositor pages for comp specifc features - add Dank Bar Appearance subsection - improve lazy loading, caching, search routing, & IPC navigation - standardized responsive Setting categories from global animations
This commit is contained in:
@@ -13,7 +13,22 @@ Item {
|
||||
LayoutMirroring.childrenInherit: true
|
||||
|
||||
property var parentModal: null
|
||||
property string selectedBarId: "default"
|
||||
property bool appearanceOnly: false
|
||||
property string selectedBarId: SettingsUiState.selectedBarId
|
||||
|
||||
onSelectedBarIdChanged: {
|
||||
if (SettingsUiState.selectedBarId !== selectedBarId)
|
||||
SettingsUiState.selectedBarId = selectedBarId;
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: SettingsUiState
|
||||
|
||||
function onSelectedBarIdChanged() {
|
||||
if (dankBarTab.selectedBarId !== SettingsUiState.selectedBarId)
|
||||
dankBarTab.selectedBarId = SettingsUiState.selectedBarId;
|
||||
}
|
||||
}
|
||||
|
||||
property var selectedBarConfig: {
|
||||
selectedBarId;
|
||||
@@ -21,6 +36,14 @@ Item {
|
||||
const index = SettingsData.barConfigs.findIndex(cfg => cfg.id === selectedBarId);
|
||||
return index !== -1 ? SettingsData.barConfigs[index] : SettingsData.barConfigs[0];
|
||||
}
|
||||
readonly property string selectedBarName: {
|
||||
selectedBarId;
|
||||
SettingsData.barConfigs;
|
||||
const index = SettingsData.barConfigs.findIndex(config => config.id === selectedBarId);
|
||||
if (index < 0)
|
||||
return I18n.tr("Bar");
|
||||
return SettingsData.barConfigs[index].name || I18n.tr("Bar %1").arg(index + 1);
|
||||
}
|
||||
|
||||
property bool selectedBarIsVertical: {
|
||||
selectedBarId;
|
||||
@@ -210,10 +233,33 @@ Item {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
spacing: Theme.spacingXL
|
||||
|
||||
SettingsCard {
|
||||
tab: "appearance"
|
||||
iconName: "toolbar"
|
||||
title: I18n.tr("Dank Bar")
|
||||
settingKey: "barAppearance"
|
||||
visible: dankBarTab.appearanceOnly
|
||||
|
||||
SettingsButtonGroupRow {
|
||||
text: I18n.tr("Editing changes on %1").arg(dankBarTab.selectedBarName)
|
||||
model: SettingsData.barConfigs.map((config, index) => config.name || I18n.tr("Bar %1").arg(index + 1))
|
||||
currentIndex: {
|
||||
const index = SettingsData.barConfigs.findIndex(config => config.id === dankBarTab.selectedBarId);
|
||||
return Math.max(0, index);
|
||||
}
|
||||
onSelectionChanged: (index, selected) => {
|
||||
if (!selected || index < 0 || index >= SettingsData.barConfigs.length)
|
||||
return;
|
||||
dankBarTab.selectedBarId = SettingsData.barConfigs[index].id;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SettingsCard {
|
||||
iconName: "dashboard"
|
||||
title: I18n.tr("Bar Configurations")
|
||||
settingKey: "barConfigurations"
|
||||
visible: !dankBarTab.appearanceOnly
|
||||
|
||||
RowLayout {
|
||||
width: parent.width
|
||||
@@ -410,7 +456,7 @@ Item {
|
||||
SettingsCard {
|
||||
iconName: selectedBarConfig?.enabled ? "visibility" : "visibility_off"
|
||||
title: I18n.tr("Enable Bar")
|
||||
visible: selectedBarId !== "default"
|
||||
visible: !dankBarTab.appearanceOnly && selectedBarId !== "default"
|
||||
|
||||
SettingsToggleRow {
|
||||
text: I18n.tr("Toggle visibility of this bar configuration")
|
||||
@@ -426,7 +472,7 @@ Item {
|
||||
iconName: "vertical_align_center"
|
||||
title: I18n.tr("Position")
|
||||
settingKey: "barPosition"
|
||||
visible: selectedBarConfig?.enabled
|
||||
visible: !dankBarTab.appearanceOnly && selectedBarConfig?.enabled
|
||||
|
||||
Item {
|
||||
width: parent.width
|
||||
@@ -486,7 +532,7 @@ Item {
|
||||
settingKey: "barDisplay"
|
||||
collapsible: true
|
||||
expanded: false
|
||||
visible: selectedBarConfig?.enabled
|
||||
visible: !dankBarTab.appearanceOnly && selectedBarConfig?.enabled
|
||||
|
||||
StyledText {
|
||||
width: parent.width
|
||||
@@ -588,12 +634,12 @@ Item {
|
||||
}
|
||||
|
||||
SettingsCard {
|
||||
iconName: "visibility_off"
|
||||
iconName: "visibility"
|
||||
title: I18n.tr("Visibility")
|
||||
settingKey: "barVisibility"
|
||||
collapsible: true
|
||||
expanded: false
|
||||
visible: selectedBarConfig?.enabled
|
||||
expanded: true
|
||||
visible: !dankBarTab.appearanceOnly && selectedBarConfig?.enabled
|
||||
|
||||
SettingsToggleRow {
|
||||
text: I18n.tr("Auto-hide")
|
||||
@@ -751,7 +797,7 @@ Item {
|
||||
}
|
||||
|
||||
SettingsControlledByFrame {
|
||||
visible: SettingsData.frameEnabled
|
||||
visible: !dankBarTab.appearanceOnly && SettingsData.frameEnabled
|
||||
parentModal: dankBarTab.parentModal
|
||||
settingLabel: I18n.tr("Bar spacing and size")
|
||||
reason: I18n.tr("Managed by Frame")
|
||||
@@ -761,7 +807,7 @@ Item {
|
||||
iconName: "space_bar"
|
||||
title: I18n.tr("Spacing")
|
||||
settingKey: "barSpacing"
|
||||
visible: (selectedBarConfig?.enabled ?? false) && !SettingsData.frameEnabled
|
||||
visible: !dankBarTab.appearanceOnly && (selectedBarConfig?.enabled ?? false) && !SettingsData.frameEnabled
|
||||
|
||||
SettingsSliderRow {
|
||||
id: edgeSpacingSlider
|
||||
@@ -911,10 +957,11 @@ Item {
|
||||
}
|
||||
|
||||
SettingsCard {
|
||||
tab: "appearance"
|
||||
iconName: "opacity"
|
||||
title: I18n.tr("Transparency")
|
||||
settingKey: "barTransparency"
|
||||
visible: selectedBarConfig?.enabled
|
||||
visible: dankBarTab.appearanceOnly && selectedBarConfig?.enabled
|
||||
|
||||
SettingsSliderRow {
|
||||
id: barTransparencySlider
|
||||
@@ -973,10 +1020,12 @@ Item {
|
||||
|
||||
SettingsSliderCard {
|
||||
id: fontScaleSliderCard
|
||||
tab: "appearance"
|
||||
settingKey: "barFontScale"
|
||||
iconName: "text_fields"
|
||||
title: I18n.tr("Font Scale")
|
||||
description: I18n.tr("Scale DankBar font sizes independently")
|
||||
visible: selectedBarConfig?.enabled
|
||||
visible: dankBarTab.appearanceOnly && selectedBarConfig?.enabled
|
||||
minimum: 50
|
||||
maximum: 200
|
||||
value: Math.round((selectedBarConfig?.fontScale ?? 1.0) * 100)
|
||||
@@ -998,10 +1047,12 @@ Item {
|
||||
|
||||
SettingsSliderCard {
|
||||
id: iconScaleSliderCard
|
||||
tab: "appearance"
|
||||
settingKey: "barIconScale"
|
||||
iconName: "interests"
|
||||
title: I18n.tr("Icon Scale")
|
||||
description: I18n.tr("Scale DankBar icon sizes independently")
|
||||
visible: selectedBarConfig?.enabled
|
||||
visible: dankBarTab.appearanceOnly && selectedBarConfig?.enabled
|
||||
minimum: 50
|
||||
maximum: 200
|
||||
value: Math.round((selectedBarConfig?.iconScale ?? 1.0) * 100)
|
||||
@@ -1021,13 +1072,18 @@ Item {
|
||||
}
|
||||
}
|
||||
|
||||
WorkspaceAppearanceCard {
|
||||
visible: dankBarTab.appearanceOnly
|
||||
}
|
||||
|
||||
SettingsCard {
|
||||
tab: "appearance"
|
||||
iconName: "rounded_corner"
|
||||
title: I18n.tr("Corners & Background")
|
||||
settingKey: "barCorners"
|
||||
collapsible: true
|
||||
expanded: false
|
||||
visible: selectedBarConfig?.enabled
|
||||
expanded: true
|
||||
visible: dankBarTab.appearanceOnly && selectedBarConfig?.enabled
|
||||
|
||||
SettingsControlledByFrame {
|
||||
visible: SettingsData.frameEnabled
|
||||
@@ -1144,7 +1200,7 @@ Item {
|
||||
iconName: "fit_screen"
|
||||
title: I18n.tr("Maximize Detection")
|
||||
description: I18n.tr("Remove gaps and border when windows are maximized")
|
||||
visible: selectedBarConfig?.enabled && (CompositorService.isNiri || CompositorService.isHyprland || CompositorService.isMango)
|
||||
visible: !dankBarTab.appearanceOnly && selectedBarConfig?.enabled && (CompositorService.isNiri || CompositorService.isHyprland || CompositorService.isMango)
|
||||
checked: selectedBarConfig?.maximizeDetection ?? true
|
||||
onToggled: checked => SettingsData.updateBarConfig(selectedBarId, {
|
||||
maximizeDetection: checked
|
||||
@@ -1152,10 +1208,11 @@ Item {
|
||||
}
|
||||
|
||||
SettingsCard {
|
||||
tab: "appearance"
|
||||
iconName: "filter_b_and_w"
|
||||
title: I18n.tr("System Tray Icon Tint")
|
||||
settingKey: "trayIconTint"
|
||||
visible: selectedBarConfig?.enabled
|
||||
visible: dankBarTab.appearanceOnly && selectedBarConfig?.enabled
|
||||
|
||||
StyledText {
|
||||
text: I18n.tr("Choose monochrome or a theme color tint for system tray icons")
|
||||
@@ -1251,9 +1308,11 @@ Item {
|
||||
}
|
||||
|
||||
SettingsToggleCard {
|
||||
tab: "appearance"
|
||||
settingKey: "barBorder"
|
||||
iconName: "border_style"
|
||||
title: I18n.tr("Border")
|
||||
visible: selectedBarConfig?.enabled
|
||||
visible: dankBarTab.appearanceOnly && selectedBarConfig?.enabled && !dankBarTab.connectedFrameModeActive
|
||||
checked: selectedBarConfig?.borderEnabled ?? false
|
||||
onToggled: checked => SettingsData.updateBarConfig(selectedBarId, {
|
||||
borderEnabled: checked
|
||||
@@ -1344,9 +1403,11 @@ Item {
|
||||
}
|
||||
|
||||
SettingsToggleCard {
|
||||
tab: "appearance"
|
||||
settingKey: "barWidgetOutline"
|
||||
iconName: "highlight"
|
||||
title: I18n.tr("Widget Outline")
|
||||
visible: selectedBarConfig?.enabled
|
||||
visible: dankBarTab.appearanceOnly && selectedBarConfig?.enabled
|
||||
checked: selectedBarConfig?.widgetOutlineEnabled ?? false
|
||||
onToggled: checked => SettingsData.updateBarConfig(selectedBarId, {
|
||||
widgetOutlineEnabled: checked
|
||||
@@ -1437,7 +1498,7 @@ Item {
|
||||
}
|
||||
|
||||
SettingsControlledByFrame {
|
||||
visible: dankBarTab.connectedFrameModeActive
|
||||
visible: dankBarTab.appearanceOnly && dankBarTab.connectedFrameModeActive
|
||||
parentModal: dankBarTab.parentModal
|
||||
settingLabel: I18n.tr("Bar shadow, border, and corners")
|
||||
reason: I18n.tr("Managed by Frame in Connected Mode")
|
||||
@@ -1445,12 +1506,13 @@ Item {
|
||||
|
||||
SettingsCard {
|
||||
id: shadowCard
|
||||
tab: "appearance"
|
||||
iconName: "layers"
|
||||
title: I18n.tr("Shadow Override", "bar shadow settings card")
|
||||
settingKey: "barShadow"
|
||||
collapsible: true
|
||||
expanded: false
|
||||
visible: (selectedBarConfig?.enabled ?? false) && !dankBarTab.connectedFrameModeActive
|
||||
visible: dankBarTab.appearanceOnly && (selectedBarConfig?.enabled ?? false) && !dankBarTab.connectedFrameModeActive
|
||||
|
||||
readonly property bool shadowActive: (selectedBarConfig?.shadowIntensity ?? 0) > 0
|
||||
readonly property bool isCustomColor: (selectedBarConfig?.shadowColorMode ?? "default") === "custom"
|
||||
@@ -1512,6 +1574,7 @@ Item {
|
||||
}
|
||||
|
||||
SettingsDropdownRow {
|
||||
tab: "appearance"
|
||||
visible: shadowCard.shadowActive
|
||||
text: I18n.tr("Direction Source", "bar shadow direction source")
|
||||
description: I18n.tr("Choose how this bar resolves shadow direction")
|
||||
@@ -1545,6 +1608,7 @@ Item {
|
||||
}
|
||||
|
||||
SettingsDropdownRow {
|
||||
tab: "appearance"
|
||||
visible: shadowCard.shadowActive && shadowCard.directionSource === "manual"
|
||||
text: I18n.tr("Manual Direction", "bar manual shadow direction")
|
||||
description: I18n.tr("Use a fixed shadow direction for this bar")
|
||||
@@ -1680,7 +1744,7 @@ Item {
|
||||
iconName: "mouse"
|
||||
title: I18n.tr("Scroll Wheel")
|
||||
description: I18n.tr("Control workspaces and columns by scrolling on the bar")
|
||||
visible: selectedBarConfig?.enabled
|
||||
visible: !dankBarTab.appearanceOnly && selectedBarConfig?.enabled
|
||||
checked: selectedBarConfig?.scrollEnabled ?? true
|
||||
onToggled: checked => SettingsData.updateBarConfig(selectedBarId, {
|
||||
scrollEnabled: checked
|
||||
|
||||
Reference in New Issue
Block a user