1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-06-15 07:35:20 -04:00

settings: add DankSpinner, re-org some settings

This commit is contained in:
bbedward
2026-06-10 18:53:43 -04:00
parent 12438d63c2
commit cd672c341f
39 changed files with 4788 additions and 4523 deletions
@@ -145,7 +145,7 @@ Item {
tags: ["hyprland", "gaps", "override"]
settingKey: "hyprlandLayoutGapsOverride"
text: I18n.tr("Window Gaps")
description: I18n.tr("Space between windows (gaps_in and gaps_out)")
description: I18n.tr("Space between windows") + " (gaps_in/gaps_out)"
visible: SettingsData.hyprlandLayoutGapsOverride >= 0
value: Math.max(0, SettingsData.hyprlandLayoutGapsOverride)
minimum: 0
@@ -159,7 +159,7 @@ Item {
tags: ["hyprland", "radius", "override", "rounding"]
settingKey: "hyprlandLayoutRadiusOverrideEnabled"
text: I18n.tr("Override Corner Radius")
description: I18n.tr("Use custom window rounding instead of theme radius")
description: I18n.tr("Use custom window radius instead of theme radius")
checked: SettingsData.hyprlandLayoutRadiusOverride >= 0
onToggled: checked => {
if (checked) {
@@ -173,8 +173,8 @@ Item {
SettingsSliderRow {
tags: ["hyprland", "radius", "override", "rounding"]
settingKey: "hyprlandLayoutRadiusOverride"
text: I18n.tr("Window Rounding")
description: I18n.tr("Rounded corners for windows (decoration.rounding)")
text: I18n.tr("Window Corner Radius")
description: I18n.tr("Rounded corners for windows") + " (decoration.rounding)"
visible: SettingsData.hyprlandLayoutRadiusOverride >= 0
value: Math.max(0, SettingsData.hyprlandLayoutRadiusOverride)
minimum: 0
@@ -203,7 +203,7 @@ Item {
tags: ["hyprland", "border", "override"]
settingKey: "hyprlandLayoutBorderSize"
text: I18n.tr("Border Size")
description: I18n.tr("Width of window border (general.border_size)")
description: I18n.tr("Width of window border") + " (general.border_size)"
visible: SettingsData.hyprlandLayoutBorderSize >= 0
value: Math.max(0, SettingsData.hyprlandLayoutBorderSize)
minimum: 0
@@ -251,7 +251,7 @@ Item {
tags: ["mangowc", "mango", "gaps", "override"]
settingKey: "mangoLayoutGapsOverride"
text: I18n.tr("Window Gaps")
description: I18n.tr("Space between windows (gappih/gappiv/gappoh/gappov)")
description: I18n.tr("Space between windows") + " (gappih/gappiv/gappoh/gappov)"
visible: SettingsData.mangoLayoutGapsOverride >= 0
value: Math.max(0, SettingsData.mangoLayoutGapsOverride)
minimum: 0
@@ -280,7 +280,7 @@ Item {
tags: ["mangowc", "mango", "radius", "override"]
settingKey: "mangoLayoutRadiusOverride"
text: I18n.tr("Window Corner Radius")
description: I18n.tr("Rounded corners for windows (border_radius)")
description: I18n.tr("Rounded corners for windows") + " (border_radius)"
visible: SettingsData.mangoLayoutRadiusOverride >= 0
value: Math.max(0, SettingsData.mangoLayoutRadiusOverride)
minimum: 0
@@ -309,7 +309,7 @@ Item {
tags: ["mangowc", "mango", "border", "override"]
settingKey: "mangoLayoutBorderSize"
text: I18n.tr("Border Size")
description: I18n.tr("Width of window border (borderpx)")
description: I18n.tr("Width of window border") + " (borderpx)"
visible: SettingsData.mangoLayoutBorderSize >= 0
value: Math.max(0, SettingsData.mangoLayoutBorderSize)
minimum: 0
@@ -1,167 +0,0 @@
pragma ComponentBehavior: Bound
import QtQuick
import QtQuick.Layouts
import qs.Common
import qs.Services
import qs.Widgets
Item {
id: root
LayoutMirroring.enabled: I18n.isRtl
LayoutMirroring.childrenInherit: true
property int subTabIndex: 0
readonly property var workspaceSections: ({
"workspaceSettings": true,
"showWorkspaceIndex": true,
"showWorkspaceName": true,
"showWorkspacePadding": true,
"showWorkspaceApps": true,
"groupWorkspaceApps": true,
"groupActiveWorkspaceApps": true,
"workspaceActiveAppHighlightEnabled": true,
"workspaceFollowFocus": true,
"showOccupiedWorkspacesOnly": true,
"reverseScrolling": true,
"workspaceDragReorder": true,
"dwlShowAllTags": true,
"workspaceIcons": true
})
readonly property var layoutSections: ({
"niriLayout": true,
"niriLayoutGapsOverrideEnabled": true,
"niriLayoutGapsOverride": true,
"niriLayoutRadiusOverrideEnabled": true,
"niriLayoutRadiusOverride": true,
"niriLayoutBorderSizeEnabled": true,
"niriLayoutBorderSize": true,
"hyprlandLayout": true,
"hyprlandLayoutGapsOverrideEnabled": true,
"hyprlandLayoutGapsOverride": true,
"hyprlandLayoutRadiusOverrideEnabled": true,
"hyprlandLayoutRadiusOverride": true,
"hyprlandLayoutBorderSizeEnabled": true,
"hyprlandLayoutBorderSize": true,
"hyprlandResizeOnBorder": true,
"mangoLayout": true,
"mangoLayoutGapsOverrideEnabled": true,
"mangoLayoutGapsOverride": true,
"mangoLayoutRadiusOverrideEnabled": true,
"mangoLayoutRadiusOverride": true,
"mangoLayoutBorderSizeEnabled": true,
"mangoLayoutBorderSize": true
})
function routeSearchTarget(target) {
if (!target)
return;
if (workspaceSections[target]) {
subTabIndex = 0;
} else if (layoutSections[target]) {
subTabIndex = 1;
} else if (target === "windowRules" || target.startsWith("windowRule")) {
subTabIndex = 2;
}
}
Component.onCompleted: routeSearchTarget(SettingsSearchService.targetSection)
Connections {
target: SettingsSearchService
function onTargetSectionChanged() {
root.routeSearchTarget(SettingsSearchService.targetSection);
}
}
ColumnLayout {
anchors.fill: parent
spacing: 0
Rectangle {
Layout.fillWidth: true
Layout.preferredHeight: 60
color: "transparent"
DankTabBar {
id: compositorTabBar
width: Math.min(500, parent.width - Theme.spacingL * 2)
height: 45
anchors.centerIn: parent
model: [
{
"text": I18n.tr("Workspaces"),
"icon": "view_module"
},
{
"text": I18n.tr("Window Layout"),
"icon": "crop_square"
},
{
"text": I18n.tr("Window Rules"),
"icon": "select_window"
}
]
currentIndex: root.subTabIndex
onTabClicked: index => root.subTabIndex = index
}
Rectangle {
anchors.horizontalCenter: parent.horizontalCenter
y: compositorTabBar.y + compositorTabBar.height + 10
width: compositorTabBar.width
height: 1
color: Theme.surface
opacity: 0.56
}
}
Item {
Layout.fillWidth: true
Layout.fillHeight: true
clip: true
Loader {
anchors.fill: parent
active: root.subTabIndex === 0
visible: active
sourceComponent: WorkspacesTab {}
}
Loader {
anchors.fill: parent
active: root.subTabIndex === 1
visible: active
sourceComponent: CompositorLayoutTab {}
}
Loader {
id: windowRulesLoader
property bool loadedOnce: false
anchors.fill: parent
active: root.subTabIndex === 2 || loadedOnce
visible: root.subTabIndex === 2 && status === Loader.Ready
asynchronous: true
sourceComponent: WindowRulesTab {
pageActive: root.subTabIndex === 2
}
onLoaded: loadedOnce = true
}
StyledText {
anchors.centerIn: parent
visible: root.subTabIndex === 2 && windowRulesLoader.status === Loader.Loading
text: I18n.tr("Loading...", "loading indicator")
color: Theme.surfaceVariantText
font.pixelSize: Theme.fontSizeMedium
}
}
}
}
+2 -2
View File
@@ -41,8 +41,8 @@ Item {
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);
return I18n.tr("Bar", "fallback name for an unnamed bar");
return SettingsData.barConfigs[index].name || I18n.tr("Bar %1", "numbered name for an unnamed bar, %1 is its position").arg(index + 1);
}
property bool selectedBarIsVertical: {
+4 -4
View File
@@ -151,7 +151,7 @@ Item {
function runGreeterInstallAction() {
root.greeterPendingAction = !root.greeterInstalled ? "install" : !root.greeterEnabled ? "activate" : "uninstall";
greeterStatusText = I18n.tr("Opening terminal: ") + root.greeterActionLabel + "";
greeterStatusText = I18n.tr("Opening terminal: ") + root.greeterActionLabel + "...";
greeterInstallActionRunning = true;
greeterInstallActionProcess.running = true;
}
@@ -188,7 +188,7 @@ Item {
greeterSudoProbeStderr = "";
greeterTerminalFallbackStderr = "";
greeterTerminalFallbackFromPrecheck = false;
greeterStatusText = I18n.tr("Checking whether sudo authentication is needed");
greeterStatusText = I18n.tr("Checking whether sudo authentication is needed...");
greeterSyncRunning = true;
greeterSudoProbeProcess.running = true;
}
@@ -327,7 +327,7 @@ Item {
onExited: exitCode => {
const err = (root.greeterSudoProbeStderr || "").trim();
if (exitCode === 0) {
root.greeterStatusText = I18n.tr("Running greeter sync");
root.greeterStatusText = I18n.tr("Running greeter sync...");
greeterSyncProcess.running = true;
return;
}
@@ -468,7 +468,7 @@ Item {
id: statusTextArea
anchors.fill: parent
anchors.margins: Theme.spacingM
text: root.greeterStatusRunning ? I18n.tr("Checking", "greeter status loading") : (root.greeterStatusText || I18n.tr("Click Refresh to check status.", "greeter status placeholder"))
text: root.greeterStatusRunning ? I18n.tr("Checking...", "greeter status loading") : (root.greeterStatusText || I18n.tr("Click Refresh to check status.", "greeter status placeholder"))
font.pixelSize: Theme.fontSizeSmall
font.family: "monospace"
color: root.greeterStatusRunning ? Theme.surfaceVariantText : Theme.surfaceText
+6 -102
View File
@@ -643,41 +643,9 @@ Item {
height: NetworkService.networkWiredInfoLoading ? 40 : 0
visible: NetworkService.networkWiredInfoLoading
Row {
DankSpinner {
anchors.centerIn: parent
spacing: Theme.spacingS
DankIcon {
id: wiredLoadIcon
name: "sync"
size: 16
color: Theme.surfaceVariantText
SequentialAnimation {
running: NetworkService.networkWiredInfoLoading
loops: Animation.Infinite
OpacityAnimator {
target: wiredLoadIcon
to: 0.3
duration: 400
easing.type: Easing.InOutQuad
}
OpacityAnimator {
target: wiredLoadIcon
to: 1.0
duration: 400
easing.type: Easing.InOutQuad
}
onRunningChanged: if (!running)
wiredLoadIcon.opacity = 1.0
}
}
StyledText {
text: I18n.tr("Loading...")
font.pixelSize: Theme.fontSizeSmall
color: Theme.surfaceVariantText
}
size: 20
}
}
}
@@ -1360,41 +1328,9 @@ Item {
height: NetworkService.networkInfoLoading ? 40 : 0
visible: NetworkService.networkInfoLoading
Row {
DankSpinner {
anchors.centerIn: parent
spacing: Theme.spacingS
DankIcon {
id: wifiInfoLoadIcon
name: "sync"
size: 16
color: Theme.surfaceVariantText
SequentialAnimation {
running: NetworkService.networkInfoLoading
loops: Animation.Infinite
OpacityAnimator {
target: wifiInfoLoadIcon
to: 0.3
duration: 400
easing.type: Easing.InOutQuad
}
OpacityAnimator {
target: wifiInfoLoadIcon
to: 1.0
duration: 400
easing.type: Easing.InOutQuad
}
onRunningChanged: if (!running)
wifiInfoLoadIcon.opacity = 1.0
}
}
StyledText {
text: I18n.tr("Loading...")
font.pixelSize: Theme.fontSizeSmall
color: Theme.surfaceVariantText
}
size: 20
}
}
@@ -1849,41 +1785,9 @@ Item {
height: VPNService.configLoading ? 40 : 0
visible: VPNService.configLoading
Row {
DankSpinner {
anchors.centerIn: parent
spacing: Theme.spacingS
DankIcon {
id: vpnLoadIcon
name: "sync"
size: 16
color: Theme.surfaceVariantText
SequentialAnimation {
running: VPNService.configLoading
loops: Animation.Infinite
OpacityAnimator {
target: vpnLoadIcon
to: 0.3
duration: 400
easing.type: Easing.InOutQuad
}
OpacityAnimator {
target: vpnLoadIcon
to: 1.0
duration: 400
easing.type: Easing.InOutQuad
}
onRunningChanged: if (!running)
vpnLoadIcon.opacity = 1.0
}
}
StyledText {
text: I18n.tr("Loading...")
font.pixelSize: Theme.fontSizeSmall
color: Theme.surfaceVariantText
}
size: 20
}
}
+34 -35
View File
@@ -33,11 +33,31 @@ FloatingWindow {
}
readonly property var sortChipOptions: [
{ id: "installed", label: I18n.tr("Installed", "plugin browser filter chip"), toggle: true },
{ id: "default", label: I18n.tr("Default", "plugin browser sort option"), toggle: false },
{ id: "name", label: I18n.tr("Name", "plugin browser sort option"), toggle: false },
{ id: "author", label: I18n.tr("Contributor", "plugin browser sort option"), toggle: false },
{ id: "category", label: I18n.tr("Category", "plugin browser sort option"), toggle: false }
{
id: "installed",
label: I18n.tr("Installed", "plugin browser filter chip"),
toggle: true
},
{
id: "default",
label: I18n.tr("Default", "plugin browser sort option"),
toggle: false
},
{
id: "name",
label: I18n.tr("Name", "plugin browser sort option"),
toggle: false
},
{
id: "author",
label: I18n.tr("Contributor", "plugin browser sort option"),
toggle: false
},
{
id: "category",
label: I18n.tr("Category", "plugin browser sort option"),
toggle: false
}
]
function normalizedSortMode(mode) {
@@ -107,11 +127,13 @@ FloatingWindow {
counts[cat] = (counts[cat] || 0) + 1;
}
var keys = Object.keys(counts).sort();
var options = [{
key: "all",
label: I18n.tr("All", "plugin browser category filter"),
count: plugins.length
}];
var options = [
{
key: "all",
label: I18n.tr("All", "plugin browser category filter"),
count: plugins.length
}
];
for (var j = 0; j < keys.length; j++) {
var key = keys[j];
options.push({
@@ -726,32 +748,9 @@ FloatingWindow {
anchors.fill: parent
visible: root.isLoading
Column {
DankSpinner {
anchors.centerIn: parent
spacing: Theme.spacingM
DankIcon {
name: "sync"
size: 48
color: Theme.primary
anchors.horizontalCenter: parent.horizontalCenter
smoothTransform: root.isLoading
RotationAnimator on rotation {
from: 0
to: -360
duration: 1000
loops: Animation.Infinite
running: root.isLoading
}
}
StyledText {
text: I18n.tr("Loading...", "loading indicator")
font.pixelSize: Theme.fontSizeMedium
color: Theme.surfaceVariantText
anchors.horizontalCenter: parent.horizontalCenter
}
running: root.isLoading
}
}
+2 -25
View File
@@ -335,32 +335,9 @@ FloatingWindow {
anchors.fill: parent
visible: root.isLoading
Column {
DankSpinner {
anchors.centerIn: parent
spacing: Theme.spacingM
DankIcon {
name: "sync"
size: 48
color: Theme.primary
anchors.horizontalCenter: parent.horizontalCenter
smoothTransform: root.isLoading
RotationAnimator on rotation {
from: 0
to: 360
duration: 1000
loops: Animation.Infinite
running: root.isLoading
}
}
StyledText {
text: I18n.tr("Loading...", "loading indicator")
font.pixelSize: Theme.fontSizeMedium
color: Theme.surfaceVariantText
anchors.horizontalCenter: parent.horizontalCenter
}
running: root.isLoading
}
}
+2 -2
View File
@@ -139,7 +139,7 @@ Item {
}
StyledText {
text: UsersService.refreshing ? I18n.tr("Refreshing") : ""
text: UsersService.refreshing ? I18n.tr("Refreshing...") : ""
font.pixelSize: Theme.fontSizeSmall
color: Theme.surfaceVariantText
anchors.verticalCenter: parent.verticalCenter
@@ -474,7 +474,7 @@ Item {
spacing: Theme.spacingM
DankButton {
text: root.operationPending ? I18n.tr("Working") : I18n.tr("Create User")
text: root.operationPending ? I18n.tr("Working...") : I18n.tr("Create User")
iconName: "person_add"
backgroundColor: Theme.primary
textColor: Theme.primaryText