1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-25 05:52:50 -05:00

general little UX consistencies and improvements

This commit is contained in:
bbedward
2025-11-09 15:13:44 -05:00
parent 0197961175
commit b5c49573e5
16 changed files with 188 additions and 194 deletions

View File

@@ -210,8 +210,8 @@ DankPopout {
anchors.horizontalCenter: parent.horizontalCenter
height: 52
cornerRadius: Theme.cornerRadius
backgroundColor: Theme.withAlpha(Theme.surfaceVariant, Theme.popupTransparency)
normalBorderColor: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.3)
backgroundColor: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
normalBorderColor: Theme.outlineMedium
focusedBorderColor: Theme.primary
leftIconName: "search"
leftIconSize: Theme.iconSize

View File

@@ -123,9 +123,11 @@ Rectangle {
spacing: Theme.spacingS
Repeater {
model: Pipewire.nodes.values.filter(node => {
return node.audio && !node.isSink && !node.isStream
})
model: ScriptModel {
values: Pipewire.nodes.values.filter(node => {
return node.audio && !node.isSink && !node.isStream
})
}
delegate: Rectangle {
required property var modelData

View File

@@ -128,9 +128,11 @@ Rectangle {
spacing: Theme.spacingS
Repeater {
model: Pipewire.nodes.values.filter(node => {
return node.audio && node.isSink && !node.isStream
})
model: ScriptModel {
values: Pipewire.nodes.values.filter(node => {
return node.audio && node.isSink && !node.isStream
})
}
delegate: Rectangle {
required property var modelData

View File

@@ -210,19 +210,20 @@ Rectangle {
spacing: Theme.spacingS
Repeater {
model: sortedNetworks
property var sortedNetworks: {
const currentUuid = NetworkService.ethernetConnectionUuid
const networks = NetworkService.wiredConnections
let sorted = [...networks]
sorted.sort((a, b) => {
if (a.isActive && !b.isActive) return -1
if (!a.isActive && b.isActive) return 1
return a.id.localeCompare(b.id)
})
return sorted
model: ScriptModel {
values: {
const currentUuid = NetworkService.ethernetConnectionUuid
const networks = NetworkService.wiredConnections
let sorted = [...networks]
sorted.sort((a, b) => {
if (a.isActive && !b.isActive) return -1
if (!a.isActive && b.isActive) return 1
return a.id.localeCompare(b.id)
})
return sorted
}
}
delegate: Rectangle {
required property var modelData
required property int index
@@ -406,22 +407,23 @@ Rectangle {
}
Repeater {
model: wifiContent.menuOpen ? wifiContent.frozenNetworks : sortedNetworks
property var sortedNetworks: {
const ssid = NetworkService.currentWifiSSID
const networks = NetworkService.wifiNetworks
let sorted = [...networks]
sorted.sort((a, b) => {
if (a.ssid === ssid) return -1
if (b.ssid === ssid) return 1
return b.signal - a.signal
})
if (!wifiContent.menuOpen) {
wifiContent.frozenNetworks = sorted
model: ScriptModel {
values: {
const ssid = NetworkService.currentWifiSSID
const networks = NetworkService.wifiNetworks
let sorted = [...networks]
sorted.sort((a, b) => {
if (a.ssid === ssid) return -1
if (b.ssid === ssid) return 1
return b.signal - a.signal
})
if (!wifiContent.menuOpen) {
wifiContent.frozenNetworks = sorted
}
return wifiContent.menuOpen ? wifiContent.frozenNetworks : sorted
}
return sorted
}
delegate: Rectangle {
required property var modelData
required property int index

View File

@@ -381,7 +381,9 @@ DankPopout {
}
Repeater {
model: BatteryService.batteries
model: ScriptModel {
values: BatteryService.batteries
}
delegate: StyledRect {
required property var modelData

View File

@@ -435,7 +435,9 @@ Item {
flow: isVertical ? Flow.TopToBottom : Flow.LeftToRight
Repeater {
model: root.workspaceList
model: ScriptModel {
values: root.workspaceList
}
Item {
id: delegateRoot
@@ -658,7 +660,9 @@ Item {
visible: loadedIcons.length > 0
Repeater {
model: loadedIcons.slice(0, SettingsData.maxWorkspaceIcons)
model: ScriptModel {
values: loadedIcons.slice(0, SettingsData.maxWorkspaceIcons)
}
delegate: Item {
width: 18
height: 18
@@ -727,7 +731,9 @@ Item {
visible: loadedIcons.length > 0
Repeater {
model: loadedIcons.slice(0, SettingsData.maxWorkspaceIcons)
model: ScriptModel {
values: loadedIcons.slice(0, SettingsData.maxWorkspaceIcons)
}
delegate: Item {
width: 18
height: 18

View File

@@ -321,7 +321,9 @@ Rectangle {
spacing: 16
Repeater {
model: notificationGroup?.notifications?.slice(0, 10) || []
model: ScriptModel {
values: notificationGroup?.notifications?.slice(0, 10) || []
}
delegate: Rectangle {
required property var modelData

View File

@@ -1,5 +1,6 @@
import QtQuick
import QtQuick.Controls
import Quickshell
import qs.Common
import qs.Services
import qs.Widgets
@@ -248,7 +249,10 @@ Column {
height: parent.height - columnHeaders.height
clip: true
spacing: 4
model: DgopService.processes
model: ScriptModel {
values: DgopService.processes
objectProp: "pid"
}
delegate: ProcessListItem {
process: modelData

View File

@@ -111,6 +111,60 @@ Item {
width: parent.width
spacing: Theme.spacingM
DankIcon {
name: "dock_to_bottom"
size: Theme.iconSize
color: Theme.primary
anchors.verticalCenter: parent.verticalCenter
}
Column {
width: parent.width - Theme.iconSize - Theme.spacingM
- enableToggle.width - Theme.spacingM
spacing: Theme.spacingXS
anchors.verticalCenter: parent.verticalCenter
StyledText {
text: I18n.tr("Show Dock")
font.pixelSize: Theme.fontSizeLarge
font.weight: Font.Medium
color: Theme.surfaceText
}
StyledText {
text: I18n.tr("Display a dock with pinned and running applications that can be positioned at the top, bottom, left, or right edge of the screen")
font.pixelSize: Theme.fontSizeSmall
color: Theme.surfaceVariantText
wrapMode: Text.WordWrap
width: parent.width
}
}
DankToggle {
id: enableToggle
anchors.verticalCenter: parent.verticalCenter
checked: SettingsData.showDock
onToggled: checked => {
SettingsData.setShowDock(checked)
}
}
}
Rectangle {
width: parent.width
height: 1
color: Theme.outline
opacity: 0.2
visible: SettingsData.showDock
}
Row {
width: parent.width
spacing: Theme.spacingM
visible: SettingsData.showDock
opacity: visible ? 1 : 0
DankIcon {
name: "visibility_off"
size: Theme.iconSize
@@ -149,56 +203,12 @@ Item {
SettingsData.set("dockAutoHide", checked)
}
}
}
Rectangle {
width: parent.width
height: 1
color: Theme.outline
opacity: 0.2
}
Row {
width: parent.width
spacing: Theme.spacingM
DankIcon {
name: "dock_to_bottom"
size: Theme.iconSize
color: Theme.primary
anchors.verticalCenter: parent.verticalCenter
}
Column {
width: parent.width - Theme.iconSize - Theme.spacingM
- enableToggle.width - Theme.spacingM
spacing: Theme.spacingXS
anchors.verticalCenter: parent.verticalCenter
StyledText {
text: I18n.tr("Show Dock")
font.pixelSize: Theme.fontSizeLarge
font.weight: Font.Medium
color: Theme.surfaceText
Behavior on opacity {
NumberAnimation {
duration: Theme.mediumDuration
easing.type: Theme.emphasizedEasing
}
StyledText {
text: I18n.tr("Display a dock with pinned and running applications that can be positioned at the top, bottom, left, or right edge of the screen")
font.pixelSize: Theme.fontSizeSmall
color: Theme.surfaceVariantText
wrapMode: Text.WordWrap
width: parent.width
}
}
DankToggle {
id: enableToggle
anchors.verticalCenter: parent.verticalCenter
checked: SettingsData.showDock
onToggled: checked => {
SettingsData.setShowDock(checked)
}
}
}
@@ -266,8 +276,6 @@ Item {
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g,
Theme.outline.b, 0.2)
border.width: 0
visible: SettingsData.showDock
opacity: visible ? 1 : 0
Column {
id: groupByAppSection
@@ -320,13 +328,6 @@ Item {
}
}
}
Behavior on opacity {
NumberAnimation {
duration: Theme.mediumDuration
easing.type: Theme.emphasizedEasing
}
}
}
// Indicator Style Section
@@ -338,8 +339,6 @@ Item {
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g,
Theme.outline.b, 0.2)
border.width: 0
visible: SettingsData.showDock
opacity: visible ? 1 : 0
Column {
id: indicatorStyleSection
@@ -386,13 +385,6 @@ Item {
}
}
}
Behavior on opacity {
NumberAnimation {
duration: Theme.mediumDuration
easing.type: Theme.emphasizedEasing
}
}
}
// Icon Size Section
@@ -404,8 +396,6 @@ Item {
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g,
Theme.outline.b, 0.2)
border.width: 0
visible: SettingsData.showDock
opacity: visible ? 1 : 0
Column {
id: iconSizeSection
@@ -449,13 +439,6 @@ Item {
}
}
}
Behavior on opacity {
NumberAnimation {
duration: Theme.mediumDuration
easing.type: Theme.emphasizedEasing
}
}
}
// Dock Spacing Section
@@ -467,8 +450,6 @@ Item {
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g,
Theme.outline.b, 0.2)
border.width: 0
visible: SettingsData.showDock
opacity: visible ? 1 : 0
Column {
id: dockSpacingSection
@@ -580,13 +561,6 @@ Item {
}
}
}
Behavior on opacity {
NumberAnimation {
duration: Theme.mediumDuration
easing.type: Theme.emphasizedEasing
}
}
}
// Dock Transparency Section
@@ -598,8 +572,6 @@ Item {
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g,
Theme.outline.b, 0.2)
border.width: 0
visible: SettingsData.showDock
opacity: visible ? 1 : 0
Column {
id: transparencySection
@@ -644,13 +616,6 @@ Item {
}
}
}
Behavior on opacity {
NumberAnimation {
duration: Theme.mediumDuration
easing.type: Theme.emphasizedEasing
}
}
}
}
}

View File

@@ -1,6 +1,7 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import Quickshell
import qs.Common
import qs.Modals.Common
import qs.Services
@@ -312,7 +313,9 @@ DankModal {
anchors.topMargin: Theme.spacingS
anchors.bottomMargin: Theme.spacingS
spacing: Theme.spacingS
model: root.filteredPlugins
model: ScriptModel {
values: root.filteredPlugins
}
clip: true
visible: !root.isLoading

View File

@@ -273,8 +273,8 @@ Item {
width: parent.width
height: 48
placeholderText: "myPkgMngr --sysupdate"
backgroundColor: Theme.surfaceVariant
normalBorderColor: Theme.primarySelected
backgroundColor: Theme.withAlpha(Theme.surfaceContainerHighest, Theme.popupTransparency)
normalBorderColor: Theme.outlineMedium
focusedBorderColor: Theme.primary
Component.onCompleted: {
@@ -320,8 +320,8 @@ Item {
width: parent.width
height: 48
placeholderText: "-T udpClass"
backgroundColor: Theme.surfaceVariant
normalBorderColor: Theme.primarySelected
backgroundColor: Theme.withAlpha(Theme.surfaceContainerHighest, Theme.popupTransparency)
normalBorderColor: Theme.outlineMedium
focusedBorderColor: Theme.primary
Component.onCompleted: {