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

meta: Vertical Bar, Notification Popup Position Options, ++

- CC Color picker widget
- Tooltips in more places
- Attempt to improve niri screen transitiosn
This commit is contained in:
bbedward
2025-09-30 09:51:18 -04:00
parent d280505b9f
commit e875d1a5d7
84 changed files with 4937 additions and 2019 deletions

View File

@@ -623,11 +623,24 @@ Item {
DankButtonGroup {
id: positionButtonGroup
anchors.verticalCenter: parent.verticalCenter
model: ["Top", "Bottom"]
currentIndex: SettingsData.dankBarAtBottom ? 1 : 0
model: ["Top", "Bottom", "Left", "Right"]
currentIndex: {
switch (SettingsData.dankBarPosition) {
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) {
SettingsData.setDankBarAtBottom(index === 1)
switch (index) {
case 0: SettingsData.setDankBarPosition(SettingsData.Position.Top); break
case 1: SettingsData.setDankBarPosition(SettingsData.Position.Bottom); break
case 2: SettingsData.setDankBarPosition(SettingsData.Position.Left); break
case 3: SettingsData.setDankBarPosition(SettingsData.Position.Right); break
}
}
}
}
@@ -876,7 +889,7 @@ Item {
spacing: Theme.spacingS
StyledText {
text: "Height to Edge Gap (Exclusive Zone)"
text: "Exclusive Zone Offset"
font.pixelSize: Theme.fontSizeSmall
color: Theme.surfaceText
font.weight: Font.Medium
@@ -1086,7 +1099,7 @@ Item {
width: parent.width
spacing: Theme.spacingL
// Left Section
// Left/Top Section
StyledRect {
width: parent.width
height: leftSection.implicitHeight + Theme.spacingL * 2
@@ -1100,7 +1113,7 @@ Item {
id: leftSection
anchors.fill: parent
anchors.margins: Theme.spacingL
title: "Left Section"
title: SettingsData.dankBarIsVertical ? "Top Section" : "Left Section"
titleIcon: "format_align_left"
sectionId: "left"
allWidgets: dankBarTab.baseWidgetDefinitions
@@ -1230,7 +1243,7 @@ Item {
}
}
// Right Section
// Right/Bottom Section
StyledRect {
width: parent.width
height: rightSection.implicitHeight + Theme.spacingL * 2
@@ -1244,7 +1257,7 @@ Item {
id: rightSection
anchors.fill: parent
anchors.margins: Theme.spacingL
title: "Right Section"
title: SettingsData.dankBarIsVertical ? "Bottom Section" : "Right Section"
titleIcon: "format_align_right"
sectionId: "right"
allWidgets: dankBarTab.baseWidgetDefinitions

View File

@@ -985,7 +985,8 @@ Item {
text: "Light Mode"
description: "Use light theme instead of dark theme"
checked: SessionData.isLightMode
onToggled: checked => {
onToggleCompleted: checked => {
Theme.screenTransition()
Theme.setLightMode(checked)
}
}
@@ -1331,17 +1332,17 @@ Item {
}
}
// Lock Screen Settings
// Notification Popup Settings
StyledRect {
width: parent.width
height: lockScreenSection.implicitHeight + Theme.spacingL * 2
height: notificationPopupSection.implicitHeight + Theme.spacingL * 2
radius: Theme.cornerRadius
color: Theme.surfaceContainerHigh
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
border.width: 0
Column {
id: lockScreenSection
id: notificationPopupSection
anchors.fill: parent
anchors.margins: Theme.spacingL
@@ -1352,14 +1353,14 @@ Item {
spacing: Theme.spacingM
DankIcon {
name: "lock"
name: "notifications"
size: Theme.iconSize
color: Theme.primary
anchors.verticalCenter: parent.verticalCenter
}
StyledText {
text: "Lock Screen"
text: "Notification Popups"
font.pixelSize: Theme.fontSizeLarge
font.weight: Font.Medium
color: Theme.surfaceText
@@ -1367,14 +1368,48 @@ Item {
}
}
DankToggle {
DankDropdown {
width: parent.width
text: "Show Power Actions"
description: "Show power, restart, and logout buttons on the lock screen"
checked: SettingsData.lockScreenShowPowerActions
onToggled: checked => {
SettingsData.setLockScreenShowPowerActions(checked)
}
text: "Popup Position"
description: "Choose where notification popups appear on screen"
currentValue: {
if (SettingsData.notificationPopupPosition === -1) {
return "Top Center"
}
switch (SettingsData.notificationPopupPosition) {
case SettingsData.Position.Top:
return "Top Right"
case SettingsData.Position.Bottom:
return "Bottom Left"
case SettingsData.Position.Left:
return "Top Left"
case SettingsData.Position.Right:
return "Bottom Right"
default:
return "Top Right"
}
}
options: ["Top Right", "Top Left", "Top Center", "Bottom Right", "Bottom Left"]
onValueChanged: value => {
switch (value) {
case "Top Right":
SettingsData.setNotificationPopupPosition(SettingsData.Position.Top)
break
case "Top Left":
SettingsData.setNotificationPopupPosition(SettingsData.Position.Left)
break
case "Top Center":
SettingsData.setNotificationPopupPosition(-1)
break
case "Bottom Right":
SettingsData.setNotificationPopupPosition(SettingsData.Position.Right)
break
case "Bottom Left":
SettingsData.setNotificationPopupPosition(SettingsData.Position.Bottom)
break
}
SettingsData.sendTestNotifications()
}
}
}
}
@@ -1611,6 +1646,54 @@ Item {
}
}
}
// Lock Screen Settings
StyledRect {
width: parent.width
height: lockScreenSection.implicitHeight + Theme.spacingL * 2
radius: Theme.cornerRadius
color: Theme.surfaceContainerHigh
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
border.width: 0
Column {
id: lockScreenSection
anchors.fill: parent
anchors.margins: Theme.spacingL
spacing: Theme.spacingM
Row {
width: parent.width
spacing: Theme.spacingM
DankIcon {
name: "lock"
size: Theme.iconSize
color: Theme.primary
anchors.verticalCenter: parent.verticalCenter
}
StyledText {
text: "Lock Screen"
font.pixelSize: Theme.fontSizeLarge
font.weight: Font.Medium
color: Theme.surfaceText
anchors.verticalCenter: parent.verticalCenter
}
}
DankToggle {
width: parent.width
text: "Show Power Actions"
description: "Show power, restart, and logout buttons on the lock screen"
checked: SettingsData.lockScreenShowPowerActions
onToggled: checked => {
SettingsData.setLockScreenShowPowerActions(checked)
}
}
}
}
}
}

View File

@@ -226,6 +226,7 @@ Item {
if (Theme.currentThemeCategory === "catppuccin") return 1
return 0
}
property int pendingThemeIndex: -1
model: ["Generic", "Catppuccin", "Auto", "Custom"]
currentIndex: currentThemeIndex
@@ -233,7 +234,11 @@ Item {
anchors.horizontalCenter: parent.horizontalCenter
onSelectionChanged: (index, selected) => {
if (!selected) return
switch (index) {
pendingThemeIndex = index
}
onAnimationCompleted: {
if (pendingThemeIndex === -1) return
switch (pendingThemeIndex) {
case 0: Theme.switchThemeCategory("generic", "blue"); break
case 1: Theme.switchThemeCategory("catppuccin", "cat-mauve"); break
case 2:
@@ -242,14 +247,15 @@ Item {
else if (ToastService.wallpaperErrorStatus === "error")
ToastService.showError("Wallpaper processing failed - check wallpaper path")
else
Theme.switchTheme(Theme.dynamic, true, false)
Theme.switchTheme(Theme.dynamic, true, true)
break
case 3:
if (Theme.currentThemeName !== "custom") {
Theme.switchTheme("custom", true, false)
Theme.switchTheme("custom", true, true)
}
break
}
pendingThemeIndex = -1
}
}

View File

@@ -305,6 +305,19 @@ Column {
onClicked: {
root.compactModeChanged("music", 0)
}
onEntered: {
smallTooltipLoader.active = true
if (smallTooltipLoader.item) {
const p = smallSizeButton.mapToItem(null, smallSizeButton.width / 2, 0)
smallTooltipLoader.item.show("Small", p.x, p.y - 40, null)
}
}
onExited: {
if (smallTooltipLoader.item) {
smallTooltipLoader.item.hide()
}
smallTooltipLoader.active = false
}
}
DankActionButton {
@@ -318,6 +331,19 @@ Column {
onClicked: {
root.compactModeChanged("music", 1)
}
onEntered: {
mediumTooltipLoader.active = true
if (mediumTooltipLoader.item) {
const p = mediumSizeButton.mapToItem(null, mediumSizeButton.width / 2, 0)
mediumTooltipLoader.item.show("Medium", p.x, p.y - 40, null)
}
}
onExited: {
if (mediumTooltipLoader.item) {
mediumTooltipLoader.item.hide()
}
mediumTooltipLoader.active = false
}
}
DankActionButton {
@@ -331,6 +357,19 @@ Column {
onClicked: {
root.compactModeChanged("music", 2)
}
onEntered: {
largeTooltipLoader.active = true
if (largeTooltipLoader.item) {
const p = largeSizeButton.mapToItem(null, largeSizeButton.width / 2, 0)
largeTooltipLoader.item.show("Large", p.x, p.y - 40, null)
}
}
onExited: {
if (largeTooltipLoader.item) {
largeTooltipLoader.item.hide()
}
largeTooltipLoader.active = false
}
}
DankActionButton {
@@ -373,6 +412,27 @@ Column {
!SettingsData.runningAppsCompactMode)
}
}
onEntered: {
compactTooltipLoader.active = true
if (compactTooltipLoader.item) {
let tooltipText = "Toggle Compact Mode"
if (modelData.id === "clock") {
tooltipText = SettingsData.clockCompactMode ? "Full Size" : "Compact"
} else if (modelData.id === "focusedWindow") {
tooltipText = SettingsData.focusedWindowCompactMode ? "Full Size" : "Compact"
} else if (modelData.id === "runningApps") {
tooltipText = SettingsData.runningAppsCompactMode ? "Full Size" : "Compact"
}
const p = compactModeButton.mapToItem(null, compactModeButton.width / 2, 0)
compactTooltipLoader.item.show(tooltipText, p.x, p.y - 40, null)
}
}
onExited: {
if (compactTooltipLoader.item) {
compactTooltipLoader.item.hide()
}
compactTooltipLoader.active = false
}
}
Rectangle {
@@ -426,6 +486,7 @@ Column {
}
DankActionButton {
id: visibilityButton
visible: modelData.id !== "spacer"
buttonSize: 32
iconName: modelData.enabled ? "visibility" : "visibility_off"
@@ -436,6 +497,20 @@ Column {
modelData.id,
!modelData.enabled)
}
onEntered: {
visibilityTooltipLoader.active = true
if (visibilityTooltipLoader.item) {
const tooltipText = modelData.enabled ? "Hide" : "Show"
const p = visibilityButton.mapToItem(null, visibilityButton.width / 2, 0)
visibilityTooltipLoader.item.show(tooltipText, p.x, p.y - 40, null)
}
}
onExited: {
if (visibilityTooltipLoader.item) {
visibilityTooltipLoader.item.hide()
}
visibilityTooltipLoader.active = false
}
}
Row {
@@ -791,4 +866,34 @@ Column {
}
}
Loader {
id: smallTooltipLoader
active: false
sourceComponent: DankTooltip {}
}
Loader {
id: mediumTooltipLoader
active: false
sourceComponent: DankTooltip {}
}
Loader {
id: largeTooltipLoader
active: false
sourceComponent: DankTooltip {}
}
Loader {
id: compactTooltipLoader
active: false
sourceComponent: DankTooltip {}
}
Loader {
id: visibilityTooltipLoader
active: false
sourceComponent: DankTooltip {}
}
}