1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-24 21:42:51 -05:00

better fuzzy search, sweeping clean and qmlfmt of Widgets

This commit is contained in:
bbedward
2025-09-03 12:52:03 -04:00
parent 886c6877d5
commit d4db8a01fe
50 changed files with 2112 additions and 2010 deletions

View File

@@ -1,5 +1,4 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Effects
import Quickshell
import Quickshell.Io
@@ -271,16 +270,6 @@ DankPopout {
iconSize: 20
iconColor: appLauncher.viewMode
=== "list" ? Theme.primary : Theme.surfaceText
hoverColor: appLauncher.viewMode
=== "list" ? Qt.rgba(
Theme.primary.r,
Theme.primary.g,
Theme.primary.b,
0.12) : Qt.rgba(
Theme.surfaceVariant.r,
Theme.surfaceVariant.g,
Theme.surfaceVariant.b,
0.08)
backgroundColor: appLauncher.viewMode
=== "list" ? Qt.rgba(
Theme.primary.r,
@@ -299,16 +288,6 @@ DankPopout {
iconSize: 20
iconColor: appLauncher.viewMode
=== "grid" ? Theme.primary : Theme.surfaceText
hoverColor: appLauncher.viewMode
=== "grid" ? Qt.rgba(
Theme.primary.r,
Theme.primary.g,
Theme.primary.b,
0.12) : Qt.rgba(
Theme.surfaceVariant.r,
Theme.surfaceVariant.g,
Theme.surfaceVariant.b,
0.08)
backgroundColor: appLauncher.viewMode
=== "grid" ? Qt.rgba(
Theme.primary.r,
@@ -391,14 +370,6 @@ DankPopout {
appLauncher.keyboardNavigationActive = false
}
ScrollBar.vertical: ScrollBar {
policy: ScrollBar.AlwaysOn
}
ScrollBar.horizontal: ScrollBar {
policy: ScrollBar.AlwaysOff
}
delegate: Rectangle {
width: ListView.view.width
height: appList.itemHeight
@@ -576,14 +547,6 @@ DankPopout {
appLauncher.keyboardNavigationActive = false
}
ScrollBar.vertical: ScrollBar {
policy: ScrollBar.AsNeeded
}
ScrollBar.horizontal: ScrollBar {
policy: ScrollBar.AlwaysOff
}
delegate: Rectangle {
width: appGrid.cellWidth - appGrid.cellPadding
height: appGrid.cellHeight - appGrid.cellPadding

View File

@@ -1,5 +1,4 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Effects
import qs.Common
import qs.Services
@@ -156,11 +155,6 @@ Rectangle {
}
}
ScrollBar.vertical: ScrollBar {
policy: eventsList.contentHeight
> eventsList.height ? ScrollBar.AsNeeded : ScrollBar.AlwaysOff
}
Behavior on opacity {
NumberAnimation {
duration: Theme.mediumDuration

View File

@@ -246,9 +246,6 @@ DankPopout {
Theme.surfaceVariant.g,
Theme.surfaceVariant.b,
0.5)
hoverColor: Qt.rgba(Theme.primary.r,
Theme.primary.g,
Theme.primary.b, 0.12)
onClicked: {
root.close()
root.lockRequested()
@@ -265,9 +262,6 @@ DankPopout {
Theme.surfaceVariant.g,
Theme.surfaceVariant.b,
0.5)
hoverColor: Qt.rgba(Theme.primary.r,
Theme.primary.g,
Theme.primary.b, 0.12)
onClicked: {
root.powerOptionsExpanded = !root.powerOptionsExpanded
}
@@ -284,9 +278,6 @@ DankPopout {
Theme.surfaceVariant.g,
Theme.surfaceVariant.b,
0.5)
hoverColor: Qt.rgba(Theme.primary.r,
Theme.primary.g,
Theme.primary.b, 0.12)
onClicked: {
root.close()
settingsModal.show()

View File

@@ -81,8 +81,6 @@ PanelWindow {
iconName: "close"
iconSize: Theme.iconSize - 4
iconColor: Theme.surfaceText
hoverColor: Qt.rgba(Theme.error.r, Theme.error.g,
Theme.error.b, 0.12)
onClicked: {
powerMenuVisible = false
}

View File

@@ -12,7 +12,6 @@ DankActionButton {
height: 40
property bool isShift: false
color: Theme.surface
hoverColor: Theme.surfacePressed
StyledText {
id: contentItem

View File

@@ -41,10 +41,7 @@ Item {
active: !SessionData.wallpaperPath
asynchronous: true
sourceComponent: DankBackdrop {
screenWidth: parent.width
screenHeight: parent.height
}
sourceComponent: DankBackdrop {}
}
Image {

View File

@@ -92,14 +92,14 @@ Column {
}
}
ScrollView {
DankFlickable {
clip: true
width: parent.width
height: parent.height - 40
clip: true
ScrollBar.vertical.policy: ScrollBar.AsNeeded
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
contentHeight: coreUsageColumn.implicitHeight
Column {
id: coreUsageColumn
width: parent.width
spacing: 6

View File

@@ -4,11 +4,9 @@ import qs.Common
import qs.Services
import qs.Widgets
ScrollView {
DankFlickable {
anchors.fill: parent
clip: true
ScrollBar.vertical.policy: ScrollBar.AsNeeded
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
contentHeight: systemColumn.implicitHeight
Component.onCompleted: {
DgopService.addRef(["system", "hardware", "diskmounts"])
}
@@ -17,6 +15,7 @@ ScrollView {
}
Column {
id: systemColumn
width: parent.width
spacing: Theme.spacingM

View File

@@ -286,7 +286,6 @@ Item {
enabled: SessionData.wallpaperPath
opacity: SessionData.wallpaperPath ? 1 : 0.5
backgroundColor: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.5)
hoverColor: Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.12)
iconColor: Theme.surfaceText
onClicked: {
WallpaperCyclingService.cyclePrevManually();
@@ -300,7 +299,6 @@ Item {
enabled: SessionData.wallpaperPath
opacity: SessionData.wallpaperPath ? 1 : 0.5
backgroundColor: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.5)
hoverColor: Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.12)
iconColor: Theme.surfaceText
onClicked: {
WallpaperCyclingService.cycleNextManually();
@@ -395,9 +393,11 @@ Item {
width: 200
height: 32
model: [{
"text": "Interval"
"text": "Interval",
"icon": "schedule"
}, {
"text": "Time"
"text": "Time",
"icon": "access_time"
}]
currentIndex: SessionData.wallpaperCyclingMode === "time" ? 1 : 0
onTabClicked: (index) => {
@@ -702,9 +702,11 @@ Item {
width: 200
height: 32
model: [{
"text": "Time"
"text": "Time",
"icon": "access_time"
}, {
"text": "Location"
"text": "Location",
"icon": "place"
}]
Component.onCompleted: {

View File

@@ -93,8 +93,6 @@ Item {
iconName: "delete_sweep"
iconSize: Theme.iconSize - 2
iconColor: Theme.error
hoverColor: Qt.rgba(Theme.error.r, Theme.error.g,
Theme.error.b, 0.12)
anchors.verticalCenter: parent.verticalCenter
onClicked: {
AppUsageHistoryData.appUsageRanking = {}
@@ -218,9 +216,6 @@ Item {
iconName: "close"
iconSize: 16
iconColor: Theme.error
hoverColor: Qt.rgba(Theme.error.r,
Theme.error.g,
Theme.error.b, 0.12)
onClicked: {
var currentRanking = Object.assign(
{},

View File

@@ -1152,7 +1152,7 @@ Item {
}
}
DankWidgetSelectionPopup {
WidgetSelectionPopup {
id: widgetSelectionPopup
anchors.centerIn: parent

View File

@@ -0,0 +1,183 @@
import QtQuick
import QtQuick.Controls
import qs.Common
import qs.Widgets
Popup {
id: root
property var allWidgets: []
property string targetSection: ""
property bool isOpening: false
signal widgetSelected(string widgetId, string targetSection)
function safeOpen() {
if (!isOpening && !visible) {
isOpening = true
open()
}
}
width: 400
height: 450
modal: true
closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside
onOpened: {
isOpening = false
}
onClosed: {
isOpening = false
allWidgets = []
targetSection = ""
}
background: Rectangle {
color: Qt.rgba(Theme.surfaceContainer.r, Theme.surfaceContainer.g,
Theme.surfaceContainer.b, 1)
border.color: Theme.primarySelected
border.width: 1
radius: Theme.cornerRadius
}
contentItem: Item {
anchors.fill: parent
DankActionButton {
iconName: "close"
iconSize: Theme.iconSize - 2
iconColor: Theme.outline
anchors.top: parent.top
anchors.topMargin: Theme.spacingM
anchors.right: parent.right
anchors.rightMargin: Theme.spacingM
onClicked: root.close()
}
Column {
id: contentColumn
spacing: Theme.spacingM
anchors.fill: parent
anchors.margins: Theme.spacingL
anchors.topMargin: Theme.spacingL + 30 // Space for close button
Row {
width: parent.width
spacing: Theme.spacingM
DankIcon {
name: "add_circle"
size: Theme.iconSize
color: Theme.primary
anchors.verticalCenter: parent.verticalCenter
}
StyledText {
text: "Add Widget to " + root.targetSection + " Section"
font.pixelSize: Theme.fontSizeLarge
font.weight: Font.Medium
color: Theme.surfaceText
anchors.verticalCenter: parent.verticalCenter
}
}
StyledText {
text: "Select a widget to add to the " + root.targetSection.toLowerCase(
) + " section of the top bar. You can add multiple instances of the same widget if needed."
font.pixelSize: Theme.fontSizeSmall
color: Theme.outline
width: parent.width
wrapMode: Text.WordWrap
}
DankListView {
id: widgetList
width: parent.width
height: parent.height - y
spacing: Theme.spacingS
model: root.allWidgets
clip: true
delegate: Rectangle {
width: widgetList.width
height: 60
radius: Theme.cornerRadius
color: widgetArea.containsMouse ? Theme.primaryHover : Qt.rgba(
Theme.surfaceVariant.r,
Theme.surfaceVariant.g,
Theme.surfaceVariant.b,
0.3)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g,
Theme.outline.b, 0.2)
border.width: 1
Row {
anchors.fill: parent
anchors.margins: Theme.spacingM
spacing: Theme.spacingM
DankIcon {
name: modelData.icon
size: Theme.iconSize
color: Theme.primary
anchors.verticalCenter: parent.verticalCenter
}
Column {
anchors.verticalCenter: parent.verticalCenter
spacing: 2
width: parent.width - Theme.iconSize - Theme.spacingM * 3
StyledText {
text: modelData.text
font.pixelSize: Theme.fontSizeMedium
font.weight: Font.Medium
color: Theme.surfaceText
elide: Text.ElideRight
width: parent.width
}
StyledText {
text: modelData.description
font.pixelSize: Theme.fontSizeSmall
color: Theme.outline
elide: Text.ElideRight
width: parent.width
wrapMode: Text.WordWrap
}
}
DankIcon {
name: "add"
size: Theme.iconSize - 4
color: Theme.primary
anchors.verticalCenter: parent.verticalCenter
}
}
MouseArea {
id: widgetArea
anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: {
root.widgetSelected(modelData.id,
root.targetSection)
root.close()
}
}
Behavior on color {
ColorAnimation {
duration: Theme.shortDuration
easing.type: Theme.standardEasing
}
}
}
}
}
}
}

View File

@@ -44,9 +44,12 @@ Item {
id: launcherContent
anchors.fill: parent
radius: SettingsData.topBarNoBackground ? 0 : Theme.cornerRadius
color: SettingsData.topBarNoBackground ? "transparent" : Qt.rgba(Theme.surfaceTextHover.r, Theme.surfaceTextHover.g,
Theme.surfaceTextHover.b,
Theme.surfaceTextHover.a * Theme.widgetTransparency)
color: {
if (SettingsData.topBarNoBackground) return "transparent"
const baseColor = launcherArea.containsMouse ? Theme.primaryPressed : (SessionService.idleInhibited ? Theme.primaryHover : Theme.secondaryHover)
return Qt.rgba(baseColor.r, baseColor.g, baseColor.b,
baseColor.a * Theme.widgetTransparency)
}
SystemLogo {
visible: SettingsData.useOSLogo
@@ -65,5 +68,12 @@ Item {
size: Theme.iconSize - 6
color: Theme.surfaceText
}
Behavior on color {
ColorAnimation {
duration: Theme.shortDuration
easing.type: Theme.standardEasing
}
}
}
}

View File

@@ -49,10 +49,7 @@ LazyLoader {
active: !root.source
asynchronous: true
sourceComponent: DankBackdrop {
screenWidth: wallpaperWindow.modelData.width
screenHeight: wallpaperWindow.modelData.height
}
sourceComponent: DankBackdrop {}
}
Img {