mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-04-30 09:32:05 -04:00
(dbar): Settings reorg
This commit is contained in:
@@ -311,9 +311,7 @@ Item {
|
|||||||
const prefs = cfg?.screenPreferences || ["all"];
|
const prefs = cfg?.screenPreferences || ["all"];
|
||||||
if (prefs.includes("all") || (typeof prefs[0] === "string" && prefs[0] === "all"))
|
if (prefs.includes("all") || (typeof prefs[0] === "string" && prefs[0] === "all"))
|
||||||
return I18n.tr("All displays");
|
return I18n.tr("All displays");
|
||||||
return prefs.length === 1
|
return prefs.length === 1 ? I18n.tr("%1 display").arg(prefs.length) : I18n.tr("%1 displays").arg(prefs.length);
|
||||||
? I18n.tr("%1 display").arg(prefs.length)
|
|
||||||
: I18n.tr("%1 displays").arg(prefs.length);
|
|
||||||
}
|
}
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
color: Theme.surfaceVariantText
|
color: Theme.surfaceVariantText
|
||||||
@@ -421,10 +419,70 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SettingsCard {
|
||||||
|
iconName: "vertical_align_center"
|
||||||
|
title: I18n.tr("Position")
|
||||||
|
settingKey: "barPosition"
|
||||||
|
visible: selectedBarConfig?.enabled
|
||||||
|
|
||||||
|
Item {
|
||||||
|
width: parent.width
|
||||||
|
height: positionButtonGroup.height
|
||||||
|
|
||||||
|
DankButtonGroup {
|
||||||
|
id: positionButtonGroup
|
||||||
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
model: [I18n.tr("Top"), I18n.tr("Bottom"), I18n.tr("Left"), I18n.tr("Right")]
|
||||||
|
currentIndex: {
|
||||||
|
selectedBarId;
|
||||||
|
const config = SettingsData.getBarConfig(selectedBarId);
|
||||||
|
const pos = config?.position ?? 0;
|
||||||
|
switch (pos) {
|
||||||
|
case SettingsData.Position.Top:
|
||||||
|
return 0;
|
||||||
|
case SettingsData.Position.Bottom:
|
||||||
|
return 1;
|
||||||
|
case SettingsData.Position.Left:
|
||||||
|
return 2;
|
||||||
|
case SettingsData.Position.Right:
|
||||||
|
return 3;
|
||||||
|
default:
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
onSelectionChanged: (index, selected) => {
|
||||||
|
if (!selected)
|
||||||
|
return;
|
||||||
|
let newPos = 0;
|
||||||
|
switch (index) {
|
||||||
|
case 0:
|
||||||
|
newPos = SettingsData.Position.Top;
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
newPos = SettingsData.Position.Bottom;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
newPos = SettingsData.Position.Left;
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
newPos = SettingsData.Position.Right;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
SettingsData.updateBarConfig(selectedBarId, {
|
||||||
|
position: newPos
|
||||||
|
});
|
||||||
|
notifyHorizontalBarChange();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
SettingsCard {
|
SettingsCard {
|
||||||
iconName: "display_settings"
|
iconName: "display_settings"
|
||||||
title: I18n.tr("Display Assignment")
|
title: I18n.tr("Display Assignment")
|
||||||
settingKey: "barDisplay"
|
settingKey: "barDisplay"
|
||||||
|
collapsible: true
|
||||||
|
expanded: false
|
||||||
visible: selectedBarConfig?.enabled
|
visible: selectedBarConfig?.enabled
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
@@ -526,68 +584,12 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SettingsCard {
|
|
||||||
iconName: "vertical_align_center"
|
|
||||||
title: I18n.tr("Position")
|
|
||||||
settingKey: "barPosition"
|
|
||||||
visible: selectedBarConfig?.enabled
|
|
||||||
|
|
||||||
Item {
|
|
||||||
width: parent.width
|
|
||||||
height: positionButtonGroup.height
|
|
||||||
|
|
||||||
DankButtonGroup {
|
|
||||||
id: positionButtonGroup
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
model: [I18n.tr("Top"), I18n.tr("Bottom"), I18n.tr("Left"), I18n.tr("Right")]
|
|
||||||
currentIndex: {
|
|
||||||
selectedBarId;
|
|
||||||
const config = SettingsData.getBarConfig(selectedBarId);
|
|
||||||
const pos = config?.position ?? 0;
|
|
||||||
switch (pos) {
|
|
||||||
case SettingsData.Position.Top:
|
|
||||||
return 0;
|
|
||||||
case SettingsData.Position.Bottom:
|
|
||||||
return 1;
|
|
||||||
case SettingsData.Position.Left:
|
|
||||||
return 2;
|
|
||||||
case SettingsData.Position.Right:
|
|
||||||
return 3;
|
|
||||||
default:
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
onSelectionChanged: (index, selected) => {
|
|
||||||
if (!selected)
|
|
||||||
return;
|
|
||||||
let newPos = 0;
|
|
||||||
switch (index) {
|
|
||||||
case 0:
|
|
||||||
newPos = SettingsData.Position.Top;
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
newPos = SettingsData.Position.Bottom;
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
newPos = SettingsData.Position.Left;
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
newPos = SettingsData.Position.Right;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
SettingsData.updateBarConfig(selectedBarId, {
|
|
||||||
position: newPos
|
|
||||||
});
|
|
||||||
notifyHorizontalBarChange();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
SettingsCard {
|
SettingsCard {
|
||||||
iconName: "visibility_off"
|
iconName: "visibility_off"
|
||||||
title: I18n.tr("Visibility")
|
title: I18n.tr("Visibility")
|
||||||
settingKey: "barVisibility"
|
settingKey: "barVisibility"
|
||||||
|
collapsible: true
|
||||||
|
expanded: false
|
||||||
visible: selectedBarConfig?.enabled
|
visible: selectedBarConfig?.enabled
|
||||||
|
|
||||||
SettingsToggleRow {
|
SettingsToggleRow {
|
||||||
@@ -703,110 +705,6 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SettingsToggleCard {
|
|
||||||
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)
|
|
||||||
checked: selectedBarConfig?.maximizeDetection ?? true
|
|
||||||
onToggled: checked => SettingsData.updateBarConfig(selectedBarId, {
|
|
||||||
maximizeDetection: checked
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
SettingsToggleCard {
|
|
||||||
iconName: "filter_b_and_w"
|
|
||||||
title: I18n.tr("Monochrome System Tray Icons")
|
|
||||||
description: I18n.tr("Desaturate all system tray icons for a uniform monochrome look")
|
|
||||||
visible: selectedBarConfig?.enabled
|
|
||||||
checked: SettingsData.systemTrayMonochromeIcons
|
|
||||||
onToggled: checked => SettingsData.set("systemTrayMonochromeIcons", checked)
|
|
||||||
}
|
|
||||||
|
|
||||||
SettingsToggleCard {
|
|
||||||
iconName: "mouse"
|
|
||||||
title: I18n.tr("Scroll Wheel")
|
|
||||||
description: I18n.tr("Control workspaces and columns by scrolling on the bar")
|
|
||||||
visible: selectedBarConfig?.enabled
|
|
||||||
checked: selectedBarConfig?.scrollEnabled ?? true
|
|
||||||
onToggled: checked => SettingsData.updateBarConfig(selectedBarId, {
|
|
||||||
scrollEnabled: checked
|
|
||||||
})
|
|
||||||
|
|
||||||
SettingsButtonGroupRow {
|
|
||||||
text: I18n.tr("Y Axis")
|
|
||||||
model: CompositorService.isNiri ? [I18n.tr("None"), I18n.tr("Workspace"), I18n.tr("Column")] : [I18n.tr("None"), I18n.tr("Workspace")]
|
|
||||||
currentIndex: {
|
|
||||||
switch (selectedBarConfig?.scrollYBehavior || "workspace") {
|
|
||||||
case "none":
|
|
||||||
return 0;
|
|
||||||
case "workspace":
|
|
||||||
return 1;
|
|
||||||
case "column":
|
|
||||||
return 2;
|
|
||||||
default:
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
onSelectionChanged: (index, selected) => {
|
|
||||||
if (!selected)
|
|
||||||
return;
|
|
||||||
let behavior = "workspace";
|
|
||||||
switch (index) {
|
|
||||||
case 0:
|
|
||||||
behavior = "none";
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
behavior = "workspace";
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
behavior = "column";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
SettingsData.updateBarConfig(selectedBarId, {
|
|
||||||
scrollYBehavior: behavior
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
SettingsButtonGroupRow {
|
|
||||||
text: I18n.tr("X Axis")
|
|
||||||
visible: CompositorService.isNiri
|
|
||||||
model: [I18n.tr("None"), I18n.tr("Workspace"), I18n.tr("Column")]
|
|
||||||
currentIndex: {
|
|
||||||
switch (selectedBarConfig?.scrollXBehavior || "column") {
|
|
||||||
case "none":
|
|
||||||
return 0;
|
|
||||||
case "workspace":
|
|
||||||
return 1;
|
|
||||||
case "column":
|
|
||||||
return 2;
|
|
||||||
default:
|
|
||||||
return 2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
onSelectionChanged: (index, selected) => {
|
|
||||||
if (!selected)
|
|
||||||
return;
|
|
||||||
let behavior = "column";
|
|
||||||
switch (index) {
|
|
||||||
case 0:
|
|
||||||
behavior = "none";
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
behavior = "workspace";
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
behavior = "column";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
SettingsData.updateBarConfig(selectedBarId, {
|
|
||||||
scrollXBehavior: behavior
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
SettingsCard {
|
SettingsCard {
|
||||||
iconName: "space_bar"
|
iconName: "space_bar"
|
||||||
title: I18n.tr("Spacing")
|
title: I18n.tr("Spacing")
|
||||||
@@ -954,56 +852,6 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SettingsSliderCard {
|
|
||||||
id: fontScaleSliderCard
|
|
||||||
iconName: "text_fields"
|
|
||||||
title: I18n.tr("Font Scale")
|
|
||||||
description: I18n.tr("Scale DankBar font sizes independently")
|
|
||||||
visible: selectedBarConfig?.enabled
|
|
||||||
minimum: 50
|
|
||||||
maximum: 200
|
|
||||||
value: Math.round((selectedBarConfig?.fontScale ?? 1.0) * 100)
|
|
||||||
unit: "%"
|
|
||||||
defaultValue: 100
|
|
||||||
onSliderValueChanged: newValue => {
|
|
||||||
SettingsData.updateBarConfig(selectedBarId, {
|
|
||||||
fontScale: newValue / 100
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
Binding {
|
|
||||||
target: fontScaleSliderCard
|
|
||||||
property: "value"
|
|
||||||
value: Math.round((selectedBarConfig?.fontScale ?? 1.0) * 100)
|
|
||||||
restoreMode: Binding.RestoreBinding
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
SettingsSliderCard {
|
|
||||||
id: iconScaleSliderCard
|
|
||||||
iconName: "interests"
|
|
||||||
title: I18n.tr("Icon Scale")
|
|
||||||
description: I18n.tr("Scale DankBar icon sizes independently")
|
|
||||||
visible: selectedBarConfig?.enabled
|
|
||||||
minimum: 50
|
|
||||||
maximum: 200
|
|
||||||
value: Math.round((selectedBarConfig?.iconScale ?? 1.0) * 100)
|
|
||||||
unit: "%"
|
|
||||||
defaultValue: 100
|
|
||||||
onSliderValueChanged: newValue => {
|
|
||||||
SettingsData.updateBarConfig(selectedBarId, {
|
|
||||||
iconScale: newValue / 100
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
Binding {
|
|
||||||
target: iconScaleSliderCard
|
|
||||||
property: "value"
|
|
||||||
value: Math.round((selectedBarConfig?.iconScale ?? 1.0) * 100)
|
|
||||||
restoreMode: Binding.RestoreBinding
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
SettingsCard {
|
SettingsCard {
|
||||||
iconName: "opacity"
|
iconName: "opacity"
|
||||||
title: I18n.tr("Transparency")
|
title: I18n.tr("Transparency")
|
||||||
@@ -1055,13 +903,365 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SettingsSliderCard {
|
||||||
|
id: fontScaleSliderCard
|
||||||
|
iconName: "text_fields"
|
||||||
|
title: I18n.tr("Font Scale")
|
||||||
|
description: I18n.tr("Scale DankBar font sizes independently")
|
||||||
|
visible: selectedBarConfig?.enabled
|
||||||
|
minimum: 50
|
||||||
|
maximum: 200
|
||||||
|
value: Math.round((selectedBarConfig?.fontScale ?? 1.0) * 100)
|
||||||
|
unit: "%"
|
||||||
|
defaultValue: 100
|
||||||
|
onSliderValueChanged: newValue => {
|
||||||
|
SettingsData.updateBarConfig(selectedBarId, {
|
||||||
|
fontScale: newValue / 100
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
Binding {
|
||||||
|
target: fontScaleSliderCard
|
||||||
|
property: "value"
|
||||||
|
value: Math.round((selectedBarConfig?.fontScale ?? 1.0) * 100)
|
||||||
|
restoreMode: Binding.RestoreBinding
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SettingsSliderCard {
|
||||||
|
id: iconScaleSliderCard
|
||||||
|
iconName: "interests"
|
||||||
|
title: I18n.tr("Icon Scale")
|
||||||
|
description: I18n.tr("Scale DankBar icon sizes independently")
|
||||||
|
visible: selectedBarConfig?.enabled
|
||||||
|
minimum: 50
|
||||||
|
maximum: 200
|
||||||
|
value: Math.round((selectedBarConfig?.iconScale ?? 1.0) * 100)
|
||||||
|
unit: "%"
|
||||||
|
defaultValue: 100
|
||||||
|
onSliderValueChanged: newValue => {
|
||||||
|
SettingsData.updateBarConfig(selectedBarId, {
|
||||||
|
iconScale: newValue / 100
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
Binding {
|
||||||
|
target: iconScaleSliderCard
|
||||||
|
property: "value"
|
||||||
|
value: Math.round((selectedBarConfig?.iconScale ?? 1.0) * 100)
|
||||||
|
restoreMode: Binding.RestoreBinding
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SettingsCard {
|
||||||
|
iconName: "rounded_corner"
|
||||||
|
title: I18n.tr("Corners & Background")
|
||||||
|
settingKey: "barCorners"
|
||||||
|
collapsible: true
|
||||||
|
expanded: false
|
||||||
|
visible: selectedBarConfig?.enabled
|
||||||
|
|
||||||
|
SettingsToggleRow {
|
||||||
|
text: I18n.tr("Square Corners")
|
||||||
|
checked: selectedBarConfig?.squareCorners ?? false
|
||||||
|
onToggled: checked => SettingsData.updateBarConfig(selectedBarId, {
|
||||||
|
squareCorners: checked
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
SettingsToggleRow {
|
||||||
|
text: I18n.tr("No Background")
|
||||||
|
checked: selectedBarConfig?.noBackground ?? false
|
||||||
|
onToggled: checked => SettingsData.updateBarConfig(selectedBarId, {
|
||||||
|
noBackground: checked
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
SettingsToggleRow {
|
||||||
|
text: I18n.tr("Maximize Widget Icons")
|
||||||
|
checked: selectedBarConfig?.maximizeWidgetIcons ?? false
|
||||||
|
onToggled: checked => SettingsData.updateBarConfig(selectedBarId, {
|
||||||
|
maximizeWidgetIcons: checked
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
SettingsToggleRow {
|
||||||
|
text: I18n.tr("Maximize Widget Text")
|
||||||
|
checked: selectedBarConfig?.maximizeWidgetText ?? false
|
||||||
|
onToggled: checked => SettingsData.updateBarConfig(selectedBarId, {
|
||||||
|
maximizeWidgetText: checked
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
SettingsToggleRow {
|
||||||
|
text: I18n.tr("Remove Widget Padding")
|
||||||
|
checked: selectedBarConfig?.removeWidgetPadding ?? false
|
||||||
|
onToggled: checked => SettingsData.updateBarConfig(selectedBarId, {
|
||||||
|
removeWidgetPadding: checked
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
width: parent.width
|
||||||
|
height: 1
|
||||||
|
color: Theme.outline
|
||||||
|
opacity: 0.15
|
||||||
|
}
|
||||||
|
|
||||||
|
SettingsToggleRow {
|
||||||
|
text: I18n.tr("Goth Corners")
|
||||||
|
checked: selectedBarConfig?.gothCornersEnabled ?? false
|
||||||
|
onToggled: checked => SettingsData.updateBarConfig(selectedBarId, {
|
||||||
|
gothCornersEnabled: checked
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
SettingsToggleRow {
|
||||||
|
text: I18n.tr("Corner Radius Override")
|
||||||
|
checked: selectedBarConfig?.gothCornerRadiusOverride ?? false
|
||||||
|
visible: selectedBarConfig?.gothCornersEnabled ?? false
|
||||||
|
onToggled: checked => SettingsData.updateBarConfig(selectedBarId, {
|
||||||
|
gothCornerRadiusOverride: checked
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
Column {
|
||||||
|
width: parent.width
|
||||||
|
spacing: Theme.spacingS
|
||||||
|
visible: (selectedBarConfig?.gothCornersEnabled ?? false) && (selectedBarConfig?.gothCornerRadiusOverride ?? false)
|
||||||
|
leftPadding: Theme.spacingM
|
||||||
|
|
||||||
|
SettingsSliderRow {
|
||||||
|
id: gothCornerRadiusSlider
|
||||||
|
width: parent.width - parent.leftPadding
|
||||||
|
text: I18n.tr("Goth Corner Radius")
|
||||||
|
value: selectedBarConfig?.gothCornerRadiusValue ?? 12
|
||||||
|
minimum: 0
|
||||||
|
maximum: 64
|
||||||
|
defaultValue: 12
|
||||||
|
onSliderDragFinished: finalValue => {
|
||||||
|
SettingsData.updateBarConfig(selectedBarId, {
|
||||||
|
gothCornerRadiusValue: finalValue
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
Binding {
|
||||||
|
target: gothCornerRadiusSlider
|
||||||
|
property: "value"
|
||||||
|
value: selectedBarConfig?.gothCornerRadiusValue ?? 12
|
||||||
|
restoreMode: Binding.RestoreBinding
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SettingsToggleCard {
|
||||||
|
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)
|
||||||
|
checked: selectedBarConfig?.maximizeDetection ?? true
|
||||||
|
onToggled: checked => SettingsData.updateBarConfig(selectedBarId, {
|
||||||
|
maximizeDetection: checked
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
SettingsToggleCard {
|
||||||
|
iconName: "filter_b_and_w"
|
||||||
|
title: I18n.tr("Monochrome System Tray Icons")
|
||||||
|
description: I18n.tr("Desaturate all system tray icons for a uniform monochrome look")
|
||||||
|
visible: selectedBarConfig?.enabled
|
||||||
|
checked: SettingsData.systemTrayMonochromeIcons
|
||||||
|
onToggled: checked => SettingsData.set("systemTrayMonochromeIcons", checked)
|
||||||
|
}
|
||||||
|
|
||||||
|
SettingsToggleCard {
|
||||||
|
iconName: "border_style"
|
||||||
|
title: I18n.tr("Border")
|
||||||
|
visible: selectedBarConfig?.enabled
|
||||||
|
checked: selectedBarConfig?.borderEnabled ?? false
|
||||||
|
onToggled: checked => SettingsData.updateBarConfig(selectedBarId, {
|
||||||
|
borderEnabled: checked
|
||||||
|
})
|
||||||
|
|
||||||
|
SettingsButtonGroupRow {
|
||||||
|
text: I18n.tr("Color")
|
||||||
|
model: ["Surface", "Secondary", "Primary"]
|
||||||
|
currentIndex: {
|
||||||
|
switch (selectedBarConfig?.borderColor || "surfaceText") {
|
||||||
|
case "surfaceText":
|
||||||
|
return 0;
|
||||||
|
case "secondary":
|
||||||
|
return 1;
|
||||||
|
case "primary":
|
||||||
|
return 2;
|
||||||
|
default:
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
onSelectionChanged: (index, selected) => {
|
||||||
|
if (!selected)
|
||||||
|
return;
|
||||||
|
let newColor = "surfaceText";
|
||||||
|
switch (index) {
|
||||||
|
case 0:
|
||||||
|
newColor = "surfaceText";
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
newColor = "secondary";
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
newColor = "primary";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
SettingsData.updateBarConfig(selectedBarId, {
|
||||||
|
borderColor: newColor
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SettingsSliderRow {
|
||||||
|
id: borderOpacitySlider
|
||||||
|
text: I18n.tr("Opacity")
|
||||||
|
value: (selectedBarConfig?.borderOpacity ?? 1.0) * 100
|
||||||
|
minimum: 0
|
||||||
|
maximum: 100
|
||||||
|
unit: "%"
|
||||||
|
defaultValue: 100
|
||||||
|
onSliderDragFinished: finalValue => {
|
||||||
|
SettingsData.updateBarConfig(selectedBarId, {
|
||||||
|
borderOpacity: finalValue / 100
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
Binding {
|
||||||
|
target: borderOpacitySlider
|
||||||
|
property: "value"
|
||||||
|
value: (selectedBarConfig?.borderOpacity ?? 1.0) * 100
|
||||||
|
restoreMode: Binding.RestoreBinding
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SettingsSliderRow {
|
||||||
|
id: borderThicknessSlider
|
||||||
|
text: I18n.tr("Thickness")
|
||||||
|
value: selectedBarConfig?.borderThickness ?? 1
|
||||||
|
minimum: 1
|
||||||
|
maximum: 10
|
||||||
|
unit: "px"
|
||||||
|
defaultValue: 1
|
||||||
|
onSliderDragFinished: finalValue => {
|
||||||
|
SettingsData.updateBarConfig(selectedBarId, {
|
||||||
|
borderThickness: finalValue
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
Binding {
|
||||||
|
target: borderThicknessSlider
|
||||||
|
property: "value"
|
||||||
|
value: selectedBarConfig?.borderThickness ?? 1
|
||||||
|
restoreMode: Binding.RestoreBinding
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SettingsToggleCard {
|
||||||
|
iconName: "highlight"
|
||||||
|
title: I18n.tr("Widget Outline")
|
||||||
|
visible: selectedBarConfig?.enabled
|
||||||
|
checked: selectedBarConfig?.widgetOutlineEnabled ?? false
|
||||||
|
onToggled: checked => SettingsData.updateBarConfig(selectedBarId, {
|
||||||
|
widgetOutlineEnabled: checked
|
||||||
|
})
|
||||||
|
|
||||||
|
SettingsButtonGroupRow {
|
||||||
|
text: I18n.tr("Color")
|
||||||
|
model: ["Surface", "Secondary", "Primary"]
|
||||||
|
currentIndex: {
|
||||||
|
switch (selectedBarConfig?.widgetOutlineColor || "primary") {
|
||||||
|
case "surfaceText":
|
||||||
|
return 0;
|
||||||
|
case "secondary":
|
||||||
|
return 1;
|
||||||
|
case "primary":
|
||||||
|
return 2;
|
||||||
|
default:
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
onSelectionChanged: (index, selected) => {
|
||||||
|
if (!selected)
|
||||||
|
return;
|
||||||
|
let newColor = "primary";
|
||||||
|
switch (index) {
|
||||||
|
case 0:
|
||||||
|
newColor = "surfaceText";
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
newColor = "secondary";
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
newColor = "primary";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
SettingsData.updateBarConfig(selectedBarId, {
|
||||||
|
widgetOutlineColor: newColor
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SettingsSliderRow {
|
||||||
|
id: widgetOutlineOpacitySlider
|
||||||
|
text: I18n.tr("Opacity")
|
||||||
|
value: (selectedBarConfig?.widgetOutlineOpacity ?? 1.0) * 100
|
||||||
|
minimum: 0
|
||||||
|
maximum: 100
|
||||||
|
unit: "%"
|
||||||
|
defaultValue: 100
|
||||||
|
onSliderDragFinished: finalValue => {
|
||||||
|
SettingsData.updateBarConfig(selectedBarId, {
|
||||||
|
widgetOutlineOpacity: finalValue / 100
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
Binding {
|
||||||
|
target: widgetOutlineOpacitySlider
|
||||||
|
property: "value"
|
||||||
|
value: (selectedBarConfig?.widgetOutlineOpacity ?? 1.0) * 100
|
||||||
|
restoreMode: Binding.RestoreBinding
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SettingsSliderRow {
|
||||||
|
id: widgetOutlineThicknessSlider
|
||||||
|
text: I18n.tr("Thickness")
|
||||||
|
value: selectedBarConfig?.widgetOutlineThickness ?? 1
|
||||||
|
minimum: 1
|
||||||
|
maximum: 10
|
||||||
|
unit: "px"
|
||||||
|
defaultValue: 1
|
||||||
|
onSliderDragFinished: finalValue => {
|
||||||
|
SettingsData.updateBarConfig(selectedBarId, {
|
||||||
|
widgetOutlineThickness: finalValue
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
Binding {
|
||||||
|
target: widgetOutlineThicknessSlider
|
||||||
|
property: "value"
|
||||||
|
value: selectedBarConfig?.widgetOutlineThickness ?? 1
|
||||||
|
restoreMode: Binding.RestoreBinding
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
SettingsCard {
|
SettingsCard {
|
||||||
id: shadowCard
|
id: shadowCard
|
||||||
iconName: "layers"
|
iconName: "layers"
|
||||||
title: I18n.tr("Shadow Override", "bar shadow settings card")
|
title: I18n.tr("Shadow Override", "bar shadow settings card")
|
||||||
settingKey: "barShadow"
|
settingKey: "barShadow"
|
||||||
collapsible: true
|
collapsible: true
|
||||||
expanded: true
|
expanded: false
|
||||||
visible: selectedBarConfig?.enabled
|
visible: selectedBarConfig?.enabled
|
||||||
|
|
||||||
readonly property bool shadowActive: (selectedBarConfig?.shadowIntensity ?? 0) > 0
|
readonly property bool shadowActive: (selectedBarConfig?.shadowIntensity ?? 0) > 0
|
||||||
@@ -1286,217 +1486,63 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SettingsCard {
|
|
||||||
iconName: "rounded_corner"
|
|
||||||
title: I18n.tr("Corners & Background")
|
|
||||||
settingKey: "barCorners"
|
|
||||||
collapsible: true
|
|
||||||
expanded: false
|
|
||||||
visible: selectedBarConfig?.enabled
|
|
||||||
|
|
||||||
SettingsToggleRow {
|
|
||||||
text: I18n.tr("Square Corners")
|
|
||||||
checked: selectedBarConfig?.squareCorners ?? false
|
|
||||||
onToggled: checked => SettingsData.updateBarConfig(selectedBarId, {
|
|
||||||
squareCorners: checked
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
SettingsToggleRow {
|
|
||||||
text: I18n.tr("No Background")
|
|
||||||
checked: selectedBarConfig?.noBackground ?? false
|
|
||||||
onToggled: checked => SettingsData.updateBarConfig(selectedBarId, {
|
|
||||||
noBackground: checked
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
SettingsToggleRow {
|
|
||||||
text: I18n.tr("Maximize Widget Icons")
|
|
||||||
checked: selectedBarConfig?.maximizeWidgetIcons ?? false
|
|
||||||
onToggled: checked => SettingsData.updateBarConfig(selectedBarId, {
|
|
||||||
maximizeWidgetIcons: checked
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
SettingsToggleRow {
|
|
||||||
text: I18n.tr("Maximize Widget Text")
|
|
||||||
checked: selectedBarConfig?.maximizeWidgetText ?? false
|
|
||||||
onToggled: checked => SettingsData.updateBarConfig(selectedBarId, {
|
|
||||||
maximizeWidgetText: checked
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
SettingsToggleRow {
|
|
||||||
text: I18n.tr("Remove Widget Padding")
|
|
||||||
checked: selectedBarConfig?.removeWidgetPadding ?? false
|
|
||||||
onToggled: checked => SettingsData.updateBarConfig(selectedBarId, {
|
|
||||||
removeWidgetPadding: checked
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
width: parent.width
|
|
||||||
height: 1
|
|
||||||
color: Theme.outline
|
|
||||||
opacity: 0.15
|
|
||||||
}
|
|
||||||
|
|
||||||
SettingsToggleRow {
|
|
||||||
text: I18n.tr("Goth Corners")
|
|
||||||
checked: selectedBarConfig?.gothCornersEnabled ?? false
|
|
||||||
onToggled: checked => SettingsData.updateBarConfig(selectedBarId, {
|
|
||||||
gothCornersEnabled: checked
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
SettingsToggleRow {
|
|
||||||
text: I18n.tr("Corner Radius Override")
|
|
||||||
checked: selectedBarConfig?.gothCornerRadiusOverride ?? false
|
|
||||||
visible: selectedBarConfig?.gothCornersEnabled ?? false
|
|
||||||
onToggled: checked => SettingsData.updateBarConfig(selectedBarId, {
|
|
||||||
gothCornerRadiusOverride: checked
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
Column {
|
|
||||||
width: parent.width
|
|
||||||
spacing: Theme.spacingS
|
|
||||||
visible: (selectedBarConfig?.gothCornersEnabled ?? false) && (selectedBarConfig?.gothCornerRadiusOverride ?? false)
|
|
||||||
leftPadding: Theme.spacingM
|
|
||||||
|
|
||||||
SettingsSliderRow {
|
|
||||||
id: gothCornerRadiusSlider
|
|
||||||
width: parent.width - parent.leftPadding
|
|
||||||
text: I18n.tr("Goth Corner Radius")
|
|
||||||
value: selectedBarConfig?.gothCornerRadiusValue ?? 12
|
|
||||||
minimum: 0
|
|
||||||
maximum: 64
|
|
||||||
defaultValue: 12
|
|
||||||
onSliderDragFinished: finalValue => {
|
|
||||||
SettingsData.updateBarConfig(selectedBarId, {
|
|
||||||
gothCornerRadiusValue: finalValue
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
Binding {
|
|
||||||
target: gothCornerRadiusSlider
|
|
||||||
property: "value"
|
|
||||||
value: selectedBarConfig?.gothCornerRadiusValue ?? 12
|
|
||||||
restoreMode: Binding.RestoreBinding
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
SettingsToggleCard {
|
SettingsToggleCard {
|
||||||
iconName: "border_style"
|
iconName: "mouse"
|
||||||
title: I18n.tr("Border")
|
title: I18n.tr("Scroll Wheel")
|
||||||
|
description: I18n.tr("Control workspaces and columns by scrolling on the bar")
|
||||||
visible: selectedBarConfig?.enabled
|
visible: selectedBarConfig?.enabled
|
||||||
checked: selectedBarConfig?.borderEnabled ?? false
|
checked: selectedBarConfig?.scrollEnabled ?? true
|
||||||
onToggled: checked => SettingsData.updateBarConfig(selectedBarId, {
|
onToggled: checked => SettingsData.updateBarConfig(selectedBarId, {
|
||||||
borderEnabled: checked
|
scrollEnabled: checked
|
||||||
})
|
})
|
||||||
|
|
||||||
SettingsButtonGroupRow {
|
SettingsButtonGroupRow {
|
||||||
text: I18n.tr("Color")
|
text: I18n.tr("Y Axis")
|
||||||
model: ["Surface", "Secondary", "Primary"]
|
model: CompositorService.isNiri ? [I18n.tr("None"), I18n.tr("Workspace"), I18n.tr("Column")] : [I18n.tr("None"), I18n.tr("Workspace")]
|
||||||
currentIndex: {
|
currentIndex: {
|
||||||
switch (selectedBarConfig?.borderColor || "surfaceText") {
|
switch (selectedBarConfig?.scrollYBehavior || "workspace") {
|
||||||
case "surfaceText":
|
case "none":
|
||||||
return 0;
|
return 0;
|
||||||
case "secondary":
|
case "workspace":
|
||||||
return 1;
|
return 1;
|
||||||
case "primary":
|
case "column":
|
||||||
return 2;
|
return 2;
|
||||||
default:
|
default:
|
||||||
return 0;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
onSelectionChanged: (index, selected) => {
|
onSelectionChanged: (index, selected) => {
|
||||||
if (!selected)
|
if (!selected)
|
||||||
return;
|
return;
|
||||||
let newColor = "surfaceText";
|
let behavior = "workspace";
|
||||||
switch (index) {
|
switch (index) {
|
||||||
case 0:
|
case 0:
|
||||||
newColor = "surfaceText";
|
behavior = "none";
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
newColor = "secondary";
|
behavior = "workspace";
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
newColor = "primary";
|
behavior = "column";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
SettingsData.updateBarConfig(selectedBarId, {
|
SettingsData.updateBarConfig(selectedBarId, {
|
||||||
borderColor: newColor
|
scrollYBehavior: behavior
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SettingsSliderRow {
|
|
||||||
id: borderOpacitySlider
|
|
||||||
text: I18n.tr("Opacity")
|
|
||||||
value: (selectedBarConfig?.borderOpacity ?? 1.0) * 100
|
|
||||||
minimum: 0
|
|
||||||
maximum: 100
|
|
||||||
unit: "%"
|
|
||||||
defaultValue: 100
|
|
||||||
onSliderDragFinished: finalValue => {
|
|
||||||
SettingsData.updateBarConfig(selectedBarId, {
|
|
||||||
borderOpacity: finalValue / 100
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
Binding {
|
|
||||||
target: borderOpacitySlider
|
|
||||||
property: "value"
|
|
||||||
value: (selectedBarConfig?.borderOpacity ?? 1.0) * 100
|
|
||||||
restoreMode: Binding.RestoreBinding
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
SettingsSliderRow {
|
|
||||||
id: borderThicknessSlider
|
|
||||||
text: I18n.tr("Thickness")
|
|
||||||
value: selectedBarConfig?.borderThickness ?? 1
|
|
||||||
minimum: 1
|
|
||||||
maximum: 10
|
|
||||||
unit: "px"
|
|
||||||
defaultValue: 1
|
|
||||||
onSliderDragFinished: finalValue => {
|
|
||||||
SettingsData.updateBarConfig(selectedBarId, {
|
|
||||||
borderThickness: finalValue
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
Binding {
|
|
||||||
target: borderThicknessSlider
|
|
||||||
property: "value"
|
|
||||||
value: selectedBarConfig?.borderThickness ?? 1
|
|
||||||
restoreMode: Binding.RestoreBinding
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
SettingsToggleCard {
|
|
||||||
iconName: "highlight"
|
|
||||||
title: I18n.tr("Widget Outline")
|
|
||||||
visible: selectedBarConfig?.enabled
|
|
||||||
checked: selectedBarConfig?.widgetOutlineEnabled ?? false
|
|
||||||
onToggled: checked => SettingsData.updateBarConfig(selectedBarId, {
|
|
||||||
widgetOutlineEnabled: checked
|
|
||||||
})
|
|
||||||
|
|
||||||
SettingsButtonGroupRow {
|
SettingsButtonGroupRow {
|
||||||
text: I18n.tr("Color")
|
text: I18n.tr("X Axis")
|
||||||
model: ["Surface", "Secondary", "Primary"]
|
visible: CompositorService.isNiri
|
||||||
|
model: [I18n.tr("None"), I18n.tr("Workspace"), I18n.tr("Column")]
|
||||||
currentIndex: {
|
currentIndex: {
|
||||||
switch (selectedBarConfig?.widgetOutlineColor || "primary") {
|
switch (selectedBarConfig?.scrollXBehavior || "column") {
|
||||||
case "surfaceText":
|
case "none":
|
||||||
return 0;
|
return 0;
|
||||||
case "secondary":
|
case "workspace":
|
||||||
return 1;
|
return 1;
|
||||||
case "primary":
|
case "column":
|
||||||
return 2;
|
return 2;
|
||||||
default:
|
default:
|
||||||
return 2;
|
return 2;
|
||||||
@@ -1505,67 +1551,23 @@ Item {
|
|||||||
onSelectionChanged: (index, selected) => {
|
onSelectionChanged: (index, selected) => {
|
||||||
if (!selected)
|
if (!selected)
|
||||||
return;
|
return;
|
||||||
let newColor = "primary";
|
let behavior = "column";
|
||||||
switch (index) {
|
switch (index) {
|
||||||
case 0:
|
case 0:
|
||||||
newColor = "surfaceText";
|
behavior = "none";
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
newColor = "secondary";
|
behavior = "workspace";
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
newColor = "primary";
|
behavior = "column";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
SettingsData.updateBarConfig(selectedBarId, {
|
SettingsData.updateBarConfig(selectedBarId, {
|
||||||
widgetOutlineColor: newColor
|
scrollXBehavior: behavior
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SettingsSliderRow {
|
|
||||||
id: widgetOutlineOpacitySlider
|
|
||||||
text: I18n.tr("Opacity")
|
|
||||||
value: (selectedBarConfig?.widgetOutlineOpacity ?? 1.0) * 100
|
|
||||||
minimum: 0
|
|
||||||
maximum: 100
|
|
||||||
unit: "%"
|
|
||||||
defaultValue: 100
|
|
||||||
onSliderDragFinished: finalValue => {
|
|
||||||
SettingsData.updateBarConfig(selectedBarId, {
|
|
||||||
widgetOutlineOpacity: finalValue / 100
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
Binding {
|
|
||||||
target: widgetOutlineOpacitySlider
|
|
||||||
property: "value"
|
|
||||||
value: (selectedBarConfig?.widgetOutlineOpacity ?? 1.0) * 100
|
|
||||||
restoreMode: Binding.RestoreBinding
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
SettingsSliderRow {
|
|
||||||
id: widgetOutlineThicknessSlider
|
|
||||||
text: I18n.tr("Thickness")
|
|
||||||
value: selectedBarConfig?.widgetOutlineThickness ?? 1
|
|
||||||
minimum: 1
|
|
||||||
maximum: 10
|
|
||||||
unit: "px"
|
|
||||||
defaultValue: 1
|
|
||||||
onSliderDragFinished: finalValue => {
|
|
||||||
SettingsData.updateBarConfig(selectedBarId, {
|
|
||||||
widgetOutlineThickness: finalValue
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
Binding {
|
|
||||||
target: widgetOutlineThicknessSlider
|
|
||||||
property: "value"
|
|
||||||
value: selectedBarConfig?.widgetOutlineThickness ?? 1
|
|
||||||
restoreMode: Binding.RestoreBinding
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user