1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2025-12-07 14:05:38 -05:00

fix modal unloading

This commit is contained in:
bbedward
2025-08-13 16:15:57 -04:00
parent 141dd7c66b
commit 79d69ed2b8
2 changed files with 1092 additions and 1087 deletions

View File

@@ -27,21 +27,23 @@ PanelWindow {
property real borderWidth: 1
property real cornerRadius: Theme.cornerRadius
property bool enableShadow: false
// Expose the focusScope for external access
property alias modalFocusScope: focusScope
signal opened
signal dialogClosed
signal backgroundClicked
signal opened()
signal dialogClosed()
signal backgroundClicked()
function open() {
visible = true
visible = true;
}
function close() {
visible = false
visible = false;
}
function toggle() {
visible = !visible
visible = !visible;
}
color: "transparent"
@@ -50,22 +52,22 @@ PanelWindow {
WlrLayershell.keyboardFocus: {
switch (root.keyboardFocus) {
case "exclusive":
return WlrKeyboardFocus.Exclusive
return WlrKeyboardFocus.Exclusive;
case "none":
return WlrKeyboardFocus.None
return WlrKeyboardFocus.None;
default:
return WlrKeyboardFocus.OnDemand
return WlrKeyboardFocus.OnDemand;
}
}
onVisibleChanged: {
if (root.visible) {
opened()
opened();
} else {
if (Qt.inputMethod) {
Qt.inputMethod.hide()
Qt.inputMethod.reset()
Qt.inputMethod.hide();
Qt.inputMethod.reset();
}
dialogClosed()
dialogClosed();
}
}
@@ -87,12 +89,11 @@ PanelWindow {
MouseArea {
anchors.fill: parent
enabled: root.closeOnBackgroundClick
onClicked: mouse => {
var localPos = mapToItem(contentContainer, mouse.x, mouse.y)
if (localPos.x < 0 || localPos.x > contentContainer.width
|| localPos.y < 0
|| localPos.y > contentContainer.height)
root.backgroundClicked()
onClicked: (mouse) => {
var localPos = mapToItem(contentContainer, mouse.x, mouse.y);
if (localPos.x < 0 || localPos.x > contentContainer.width || localPos.y < 0 || localPos.y > contentContainer.height)
root.backgroundClicked();
}
}
@@ -101,7 +102,9 @@ PanelWindow {
duration: root.animationDuration
easing.type: root.animationEasing
}
}
}
Rectangle {
@@ -112,18 +115,17 @@ PanelWindow {
anchors.centerIn: positioning === "center" ? parent : undefined
x: {
if (positioning === "top-right")
return Math.max(Theme.spacingL,
root.screenWidth - width - Theme.spacingL)
return Math.max(Theme.spacingL, root.screenWidth - width - Theme.spacingL);
else if (positioning === "custom")
return root.customPosition.x
return 0 // Will be overridden by anchors.centerIn when positioning === "center"
return root.customPosition.x;
return 0; // Will be overridden by anchors.centerIn when positioning === "center"
}
y: {
if (positioning === "top-right")
return Theme.barHeight + Theme.spacingXS
return Theme.barHeight + Theme.spacingXS;
else if (positioning === "custom")
return root.customPosition.y
return 0 // Will be overridden by anchors.centerIn when positioning === "center"
return root.customPosition.y;
return 0; // Will be overridden by anchors.centerIn when positioning === "center"
}
color: root.backgroundColor
radius: root.cornerRadius
@@ -133,9 +135,9 @@ PanelWindow {
opacity: root.visible ? 1 : 0
scale: {
if (root.animationType === "scale")
return root.visible ? 1 : 0.9
return root.visible ? 1 : 0.9;
return 1
return 1;
}
transform: root.animationType === "slide" ? slideTransform : null
@@ -150,7 +152,7 @@ PanelWindow {
id: contentLoader
anchors.fill: parent
active: true
active: root.visible
asynchronous: false
}
@@ -159,6 +161,7 @@ PanelWindow {
duration: root.animationDuration
easing.type: root.animationEasing
}
}
Behavior on scale {
@@ -168,6 +171,7 @@ PanelWindow {
duration: root.animationDuration
easing.type: root.animationEasing
}
}
layer.effect: MultiEffect {
@@ -178,31 +182,29 @@ PanelWindow {
shadowColor: Theme.shadowStrong
shadowOpacity: 0.3
}
}
FocusScope {
id: focusScope
objectName: "modalFocusScope"
objectName: "modalFocusScope"
anchors.fill: parent
visible: root.visible // Only active when the modal is visible
focus: root.visible
Keys.onEscapePressed: event => {
Keys.onEscapePressed: (event) => {
if (root.closeOnEscapeKey) {
root.visible = false
event.accepted = true
root.visible = false;
event.accepted = true;
}
}
onVisibleChanged: {
if (visible) {
if (visible)
Qt.callLater(function() {
focusScope.forceActiveFocus()
})
}
focusScope.forceActiveFocus();
});
}
}
// Expose the focusScope for external access
property alias modalFocusScope: focusScope
}

View File

@@ -8,6 +8,10 @@ import qs.Widgets
Item {
id: appearanceTab
property var cachedFontFamilies: []
property var cachedMonoFamilies: []
property bool fontsEnumerated: false
DankFlickable {
anchors.fill: parent
anchors.topMargin: Theme.spacingL
@@ -18,18 +22,68 @@ Item {
Column {
id: mainColumn
function enumerateFonts() {
var fonts = ["Default (" + SettingsData.defaultFontFamily + ")"];
var availableFonts = Qt.fontFamilies();
var rootFamilies = [];
var seenFamilies = new Set();
for (var i = 0; i < availableFonts.length; i++) {
var fontName = availableFonts[i];
if (fontName.startsWith("."))
continue;
if (fontName === SettingsData.defaultFontFamily)
continue;
var rootName = fontName.replace(/ (Thin|Extra Light|Light|Regular|Medium|Semi Bold|Demi Bold|Bold|Extra Bold|Black|Heavy)$/i, "").replace(/ (Italic|Oblique|Condensed|Extended|Narrow|Wide)$/i, "").replace(/ (UI|Display|Text|Mono|Sans|Serif)$/i, function(match, suffix) {
return match;
}).trim();
if (!seenFamilies.has(rootName) && rootName !== "") {
seenFamilies.add(rootName);
rootFamilies.push(rootName);
}
}
cachedFontFamilies = fonts.concat(rootFamilies.sort());
var monoFonts = ["Default"];
var monoFamilies = [];
var seenMonoFamilies = new Set();
for (var j = 0; j < availableFonts.length; j++) {
var fontName2 = availableFonts[j];
if (fontName2.startsWith("."))
continue;
if (fontName2 === SettingsData.defaultMonoFontFamily)
continue;
var lowerName = fontName2.toLowerCase();
if (lowerName.includes("mono") || lowerName.includes("code") || lowerName.includes("console") || lowerName.includes("terminal") || lowerName.includes("courier") || lowerName.includes("dejavu sans mono") || lowerName.includes("jetbrains") || lowerName.includes("fira") || lowerName.includes("hack") || lowerName.includes("source code") || lowerName.includes("ubuntu mono") || lowerName.includes("cascadia")) {
var rootName2 = fontName2.replace(/ (Thin|Extra Light|Light|Regular|Medium|Semi Bold|Demi Bold|Bold|Extra Bold|Black|Heavy)$/i, "").replace(/ (Italic|Oblique|Condensed|Extended|Narrow|Wide)$/i, "").trim();
if (!seenMonoFamilies.has(rootName2) && rootName2 !== "") {
seenMonoFamilies.add(rootName2);
monoFamilies.push(rootName2);
}
}
}
cachedMonoFamilies = monoFonts.concat(monoFamilies.sort());
}
width: parent.width
spacing: Theme.spacingXL
Component.onCompleted: {
if (!fontsEnumerated) {
enumerateFonts();
fontsEnumerated = true;
}
}
// Display Settings
StyledRect {
width: parent.width
height: displaySection.implicitHeight + Theme.spacingL * 2
radius: Theme.cornerRadius
color: 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)
color: 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
Column {
@@ -57,29 +111,33 @@ Item {
color: Theme.surfaceText
anchors.verticalCenter: parent.verticalCenter
}
}
DankToggle {
id: nightModeToggle
width: parent.width
text: "Night Mode"
description: "Apply warm color temperature to reduce eye strain"
checked: BrightnessService.nightModeActive
onToggled: checked => {
onToggled: (checked) => {
if (checked !== BrightnessService.nightModeActive) {
if (checked)
BrightnessService.enableNightMode()
BrightnessService.enableNightMode();
else
BrightnessService.disableNightMode()
BrightnessService.disableNightMode();
}
}
Connections {
target: BrightnessService
function onNightModeActiveChanged() {
nightModeToggle.checked = BrightnessService.nightModeActive
nightModeToggle.checked = BrightnessService.nightModeActive;
}
target: BrightnessService
}
}
DankDropdown {
@@ -87,7 +145,7 @@ Item {
text: "Night Mode Temperature"
description: BrightnessService.nightModeActive ? "Disable night mode to adjust" : "Set temperature for night mode"
enabled: !BrightnessService.nightModeActive
opacity: !BrightnessService.nightModeActive ? 1.0 : 0.6
opacity: !BrightnessService.nightModeActive ? 1 : 0.6
currentValue: SessionData.nightModeTemperature + "K"
options: {
var temps = [];
@@ -96,7 +154,7 @@ Item {
}
return temps;
}
onValueChanged: value => {
onValueChanged: (value) => {
var temp = parseInt(value.replace("K", ""));
SessionData.setNightModeTemperature(temp);
}
@@ -107,10 +165,10 @@ Item {
text: "Light Mode"
description: "Use light theme instead of dark theme"
checked: SessionData.isLightMode
onToggled: checked => {
SessionData.setLightMode(checked)
Theme.isLightMode = checked
PortalService.setLightMode(checked)
onToggled: (checked) => {
SessionData.setLightMode(checked);
Theme.isLightMode = checked;
PortalService.setLightMode(checked);
}
}
@@ -123,16 +181,14 @@ Item {
popupWidthOffset: 100
maxPopupHeight: 400
options: {
SettingsData.detectAvailableIconThemes()
return SettingsData.availableIconThemes
SettingsData.detectAvailableIconThemes();
return SettingsData.availableIconThemes;
}
onValueChanged: value => {
SettingsData.setIconTheme(value)
if (value !== "System Default"
&& !SettingsData.qt5ctAvailable
&& !SettingsData.qt6ctAvailable)
ToastService.showWarning(
"qt5ct or qt6ct not found - Qt app themes may not update without these tools")
onValueChanged: (value) => {
SettingsData.setIconTheme(value);
if (value !== "System Default" && !SettingsData.qt5ctAvailable && !SettingsData.qt6ctAvailable)
ToastService.showWarning("qt5ct or qt6ct not found - Qt app themes may not update without these tools");
}
}
@@ -142,48 +198,19 @@ Item {
description: "Select system font family"
currentValue: {
if (SettingsData.fontFamily === SettingsData.defaultFontFamily)
return "Default (" + SettingsData.defaultFontFamily + ")"
return "Default (" + SettingsData.defaultFontFamily + ")";
else
return SettingsData.fontFamily
|| "Default (" + SettingsData.defaultFontFamily + ")"
return SettingsData.fontFamily || "Default (" + SettingsData.defaultFontFamily + ")";
}
enableFuzzySearch: true
popupWidthOffset: 100
maxPopupHeight: 400
options: {
var fonts = ["Default (" + SettingsData.defaultFontFamily + ")"]
var availableFonts = Qt.fontFamilies()
var rootFamilies = []
var seenFamilies = new Set()
for (var i = 0; i < availableFonts.length; i++) {
var fontName = availableFonts[i]
if (fontName.startsWith("."))
continue
if (fontName === SettingsData.defaultFontFamily)
continue
var rootName = fontName.replace(
/ (Thin|Extra Light|Light|Regular|Medium|Semi Bold|Demi Bold|Bold|Extra Bold|Black|Heavy)$/i,
"").replace(
/ (Italic|Oblique|Condensed|Extended|Narrow|Wide)$/i,
"").replace(/ (UI|Display|Text|Mono|Sans|Serif)$/i,
function (match, suffix) {
return match
}).trim()
if (!seenFamilies.has(rootName) && rootName !== "") {
seenFamilies.add(rootName)
rootFamilies.push(rootName)
}
}
return fonts.concat(rootFamilies.sort())
}
onValueChanged: value => {
options: cachedFontFamilies
onValueChanged: (value) => {
if (value.startsWith("Default ("))
SettingsData.setFontFamily(
SettingsData.defaultFontFamily)
SettingsData.setFontFamily(SettingsData.defaultFontFamily);
else
SettingsData.setFontFamily(value)
SettingsData.setFontFamily(value);
}
}
@@ -194,63 +221,63 @@ Item {
currentValue: {
switch (SettingsData.fontWeight) {
case Font.Thin:
return "Thin"
return "Thin";
case Font.ExtraLight:
return "Extra Light"
return "Extra Light";
case Font.Light:
return "Light"
return "Light";
case Font.Normal:
return "Regular"
return "Regular";
case Font.Medium:
return "Medium"
return "Medium";
case Font.DemiBold:
return "Demi Bold"
return "Demi Bold";
case Font.Bold:
return "Bold"
return "Bold";
case Font.ExtraBold:
return "Extra Bold"
return "Extra Bold";
case Font.Black:
return "Black"
return "Black";
default:
return "Regular"
return "Regular";
}
}
options: ["Thin", "Extra Light", "Light", "Regular", "Medium", "Demi Bold", "Bold", "Extra Bold", "Black"]
onValueChanged: value => {
var weight
onValueChanged: (value) => {
var weight;
switch (value) {
case "Thin":
weight = Font.Thin
break
weight = Font.Thin;
break;
case "Extra Light":
weight = Font.ExtraLight
break
weight = Font.ExtraLight;
break;
case "Light":
weight = Font.Light
break
weight = Font.Light;
break;
case "Regular":
weight = Font.Normal
break
weight = Font.Normal;
break;
case "Medium":
weight = Font.Medium
break
weight = Font.Medium;
break;
case "Demi Bold":
weight = Font.DemiBold
break
weight = Font.DemiBold;
break;
case "Bold":
weight = Font.Bold
break
weight = Font.Bold;
break;
case "Extra Bold":
weight = Font.ExtraBold
break
weight = Font.ExtraBold;
break;
case "Black":
weight = Font.Black
break
weight = Font.Black;
break;
default:
weight = Font.Normal
break
weight = Font.Normal;
break;
}
SettingsData.setFontWeight(weight)
SettingsData.setFontWeight(weight);
}
}
@@ -260,59 +287,24 @@ Item {
description: "Select monospace font for process list and technical displays"
currentValue: {
if (SettingsData.monoFontFamily === SettingsData.defaultMonoFontFamily)
return "Default"
return "Default";
return SettingsData.monoFontFamily || "Default"
return SettingsData.monoFontFamily || "Default";
}
enableFuzzySearch: true
popupWidthOffset: 100
maxPopupHeight: 400
options: {
var fonts = ["Default"]
var availableFonts = Qt.fontFamilies()
var monoFamilies = []
var seenFamilies = new Set()
for (var i = 0; i < availableFonts.length; i++) {
var fontName = availableFonts[i]
if (fontName.startsWith("."))
continue
if (fontName === SettingsData.defaultMonoFontFamily)
continue
var lowerName = fontName.toLowerCase()
if (lowerName.includes("mono") || lowerName.includes(
"code") || lowerName.includes(
"console") || lowerName.includes(
"terminal") || lowerName.includes(
"courier") || lowerName.includes(
"dejavu sans mono") || lowerName.includes(
"jetbrains") || lowerName.includes(
"fira") || lowerName.includes("hack") || lowerName.includes(
"source code") || lowerName.includes(
"ubuntu mono") || lowerName.includes("cascadia")) {
var rootName = fontName.replace(
/ (Thin|Extra Light|Light|Regular|Medium|Semi Bold|Demi Bold|Bold|Extra Bold|Black|Heavy)$/i,
"").replace(
/ (Italic|Oblique|Condensed|Extended|Narrow|Wide)$/i,
"").trim()
if (!seenFamilies.has(rootName) && rootName !== "") {
seenFamilies.add(rootName)
monoFamilies.push(rootName)
}
}
}
return fonts.concat(monoFamilies.sort())
}
onValueChanged: value => {
options: cachedMonoFamilies
onValueChanged: (value) => {
if (value === "Default")
SettingsData.setMonoFontFamily(
SettingsData.defaultMonoFontFamily)
SettingsData.setMonoFontFamily(SettingsData.defaultMonoFontFamily);
else
SettingsData.setMonoFontFamily(value)
SettingsData.setMonoFontFamily(value);
}
}
}
}
// Transparency Settings
@@ -320,10 +312,8 @@ Item {
width: parent.width
height: transparencySection.implicitHeight + Theme.spacingL * 2
radius: Theme.cornerRadius
color: 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)
color: 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
Column {
@@ -351,6 +341,7 @@ Item {
color: Theme.surfaceText
anchors.verticalCenter: parent.verticalCenter
}
}
Column {
@@ -372,11 +363,11 @@ Item {
maximum: 100
unit: ""
showValue: true
onSliderValueChanged: newValue => {
SettingsData.setTopBarTransparency(
newValue / 100)
onSliderValueChanged: (newValue) => {
SettingsData.setTopBarTransparency(newValue / 100);
}
}
}
Column {
@@ -398,11 +389,11 @@ Item {
maximum: 100
unit: ""
showValue: true
onSliderValueChanged: newValue => {
SettingsData.setTopBarWidgetTransparency(
newValue / 100)
onSliderValueChanged: (newValue) => {
SettingsData.setTopBarWidgetTransparency(newValue / 100);
}
}
}
Column {
@@ -424,13 +415,15 @@ Item {
maximum: 100
unit: ""
showValue: true
onSliderValueChanged: newValue => {
SettingsData.setPopupTransparency(
newValue / 100)
onSliderValueChanged: (newValue) => {
SettingsData.setPopupTransparency(newValue / 100);
}
}
}
}
}
// Corner Radius
@@ -438,10 +431,8 @@ Item {
width: parent.width
height: cornerRadiusSection.implicitHeight + Theme.spacingL * 2
radius: Theme.cornerRadius
color: 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)
color: 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
Column {
@@ -469,6 +460,7 @@ Item {
color: Theme.surfaceText
anchors.verticalCenter: parent.verticalCenter
}
}
Column {
@@ -490,12 +482,15 @@ Item {
maximum: 32
unit: ""
showValue: true
onSliderValueChanged: newValue => {
SettingsData.setCornerRadius(newValue)
onSliderValueChanged: (newValue) => {
SettingsData.setCornerRadius(newValue);
}
}
}
}
}
// Theme Color
@@ -503,10 +498,8 @@ Item {
width: parent.width
height: themeSection.implicitHeight + Theme.spacingL * 2
radius: Theme.cornerRadius
color: 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)
color: 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
Column {
@@ -534,6 +527,7 @@ Item {
color: Theme.surfaceText
anchors.verticalCenter: parent.verticalCenter
}
}
Column {
@@ -551,10 +545,10 @@ Item {
StyledText {
text: {
if (Theme.isDynamicTheme)
return "Wallpaper-based dynamic colors"
return "Wallpaper-based dynamic colors";
var descriptions = ["Material blue inspired by modern interfaces", "Deep blue inspired by material 3", "Rich purple tones for BB elegance", "Natural green for productivity", "Energetic orange for creativity", "Bold red for impact", "Cool cyan for tranquility", "Vibrant pink for expression", "Warm amber for comfort", "Soft coral for gentle warmth"]
return descriptions[Theme.currentThemeIndex] || "Select a theme"
var descriptions = ["Material blue inspired by modern interfaces", "Deep blue inspired by material 3", "Rich purple tones for BB elegance", "Natural green for productivity", "Energetic orange for creativity", "Bold red for impact", "Cool cyan for tranquility", "Vibrant pink for expression", "Warm amber for comfort", "Soft coral for gentle warmth"];
return descriptions[Theme.currentThemeIndex] || "Select a theme";
}
font.pixelSize: Theme.fontSizeSmall
color: Theme.surfaceVariantText
@@ -563,6 +557,7 @@ Item {
width: Math.min(parent.width, 400)
horizontalAlignment: Text.AlignHCenter
}
}
Column {
@@ -582,10 +577,8 @@ Item {
radius: 16
color: Theme.themes[index].primary
border.color: Theme.outline
border.width: (Theme.currentThemeIndex === index
&& !Theme.isDynamicTheme) ? 2 : 1
scale: (Theme.currentThemeIndex === index
&& !Theme.isDynamicTheme) ? 1.1 : 1
border.width: (Theme.currentThemeIndex === index && !Theme.isDynamicTheme) ? 2 : 1
scale: (Theme.currentThemeIndex === index && !Theme.isDynamicTheme) ? 1.1 : 1
Rectangle {
width: nameText.contentWidth + Theme.spacingS * 2
@@ -607,6 +600,7 @@ Item {
color: Theme.surfaceText
anchors.centerIn: parent
}
}
MouseArea {
@@ -616,7 +610,7 @@ Item {
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: {
Theme.switchTheme(index, false)
Theme.switchTheme(index, false);
}
}
@@ -625,6 +619,7 @@ Item {
duration: Theme.shortDuration
easing.type: Theme.emphasizedEasing
}
}
Behavior on border.width {
@@ -632,9 +627,13 @@ Item {
duration: Theme.shortDuration
easing.type: Theme.emphasizedEasing
}
}
}
}
}
Row {
@@ -650,8 +649,7 @@ Item {
width: 32
height: 32
radius: 16
color: themeIndex
< Theme.themes.length ? Theme.themes[themeIndex].primary : "transparent"
color: themeIndex < Theme.themes.length ? Theme.themes[themeIndex].primary : "transparent"
border.color: Theme.outline
border.width: Theme.currentThemeIndex === themeIndex ? 2 : 1
visible: themeIndex < Theme.themes.length
@@ -667,8 +665,7 @@ Item {
anchors.bottom: parent.top
anchors.bottomMargin: Theme.spacingXS
anchors.horizontalCenter: parent.horizontalCenter
visible: mouseArea2.containsMouse
&& themeIndex < Theme.themes.length
visible: mouseArea2.containsMouse && themeIndex < Theme.themes.length
StyledText {
id: nameText2
@@ -678,6 +675,7 @@ Item {
color: Theme.surfaceText
anchors.centerIn: parent
}
}
MouseArea {
@@ -688,7 +686,8 @@ Item {
cursorShape: Qt.PointingHandCursor
onClicked: {
if (themeIndex < Theme.themes.length)
Theme.switchTheme(themeIndex)
Theme.switchTheme(themeIndex);
}
}
@@ -697,6 +696,7 @@ Item {
duration: Theme.shortDuration
easing.type: Theme.emphasizedEasing
}
}
Behavior on border.width {
@@ -704,9 +704,13 @@ Item {
duration: Theme.shortDuration
easing.type: Theme.emphasizedEasing
}
}
}
}
}
Item {
@@ -720,22 +724,18 @@ Item {
radius: 20
anchors.horizontalCenter: parent.horizontalCenter
color: {
if (ToastService.wallpaperErrorStatus === "error"
|| ToastService.wallpaperErrorStatus === "matugen_missing")
return Qt.rgba(Theme.error.r, Theme.error.g,
Theme.error.b, 0.12)
if (ToastService.wallpaperErrorStatus === "error" || ToastService.wallpaperErrorStatus === "matugen_missing")
return Qt.rgba(Theme.error.r, Theme.error.g, Theme.error.b, 0.12);
else
return Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g,
Theme.surfaceVariant.b, 0.3)
return Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.3);
}
border.color: {
if (ToastService.wallpaperErrorStatus === "error"
|| ToastService.wallpaperErrorStatus === "matugen_missing")
return Qt.rgba(Theme.error.r, Theme.error.g, Theme.error.b, 0.5)
if (ToastService.wallpaperErrorStatus === "error" || ToastService.wallpaperErrorStatus === "matugen_missing")
return Qt.rgba(Theme.error.r, Theme.error.g, Theme.error.b, 0.5);
else if (Theme.isDynamicTheme)
return Theme.primary
return Theme.primary;
else
return Theme.outline
return Theme.outline;
}
border.width: Theme.isDynamicTheme ? 2 : 1
scale: Theme.isDynamicTheme ? 1.1 : (autoMouseArea.containsMouse ? 1.02 : 1)
@@ -746,19 +746,17 @@ Item {
DankIcon {
name: {
if (ToastService.wallpaperErrorStatus === "error"
|| ToastService.wallpaperErrorStatus === "matugen_missing")
return "error"
if (ToastService.wallpaperErrorStatus === "error" || ToastService.wallpaperErrorStatus === "matugen_missing")
return "error";
else
return "palette"
return "palette";
}
size: 16
color: {
if (ToastService.wallpaperErrorStatus === "error"
|| ToastService.wallpaperErrorStatus === "matugen_missing")
return Theme.error
if (ToastService.wallpaperErrorStatus === "error" || ToastService.wallpaperErrorStatus === "matugen_missing")
return Theme.error;
else
return Theme.surfaceText
return Theme.surfaceText;
}
anchors.verticalCenter: parent.verticalCenter
}
@@ -766,23 +764,23 @@ Item {
StyledText {
text: {
if (ToastService.wallpaperErrorStatus === "error")
return "Error"
return "Error";
else if (ToastService.wallpaperErrorStatus === "matugen_missing")
return "No matugen"
return "No matugen";
else
return "Auto"
return "Auto";
}
font.pixelSize: Theme.fontSizeMedium
color: {
if (ToastService.wallpaperErrorStatus === "error"
|| ToastService.wallpaperErrorStatus === "matugen_missing")
return Theme.error
if (ToastService.wallpaperErrorStatus === "error" || ToastService.wallpaperErrorStatus === "matugen_missing")
return Theme.error;
else
return Theme.surfaceText
return Theme.surfaceText;
}
font.weight: Font.Medium
anchors.verticalCenter: parent.verticalCenter
}
}
MouseArea {
@@ -793,13 +791,11 @@ Item {
cursorShape: Qt.PointingHandCursor
onClicked: {
if (ToastService.wallpaperErrorStatus === "matugen_missing")
ToastService.showError(
"matugen not found - install matugen package for dynamic theming")
ToastService.showError("matugen not found - install matugen package for dynamic theming");
else if (ToastService.wallpaperErrorStatus === "error")
ToastService.showError(
"Wallpaper processing failed - check wallpaper path")
ToastService.showError("Wallpaper processing failed - check wallpaper path");
else
Theme.switchTheme(10, true)
Theme.switchTheme(10, true);
}
}
@@ -813,29 +809,25 @@ Item {
anchors.bottom: parent.top
anchors.bottomMargin: Theme.spacingS
anchors.horizontalCenter: parent.horizontalCenter
visible: autoMouseArea.containsMouse
&& (!Theme.isDynamicTheme
|| ToastService.wallpaperErrorStatus === "error"
|| ToastService.wallpaperErrorStatus === "matugen_missing")
visible: autoMouseArea.containsMouse && (!Theme.isDynamicTheme || ToastService.wallpaperErrorStatus === "error" || ToastService.wallpaperErrorStatus === "matugen_missing")
StyledText {
id: autoTooltipText
text: {
if (ToastService.wallpaperErrorStatus === "matugen_missing")
return "Install matugen package for dynamic themes"
return "Install matugen package for dynamic themes";
else
return "Dynamic wallpaper-based colors"
return "Dynamic wallpaper-based colors";
}
font.pixelSize: Theme.fontSizeSmall
color: (ToastService.wallpaperErrorStatus === "error"
|| ToastService.wallpaperErrorStatus
=== "matugen_missing") ? Theme.error : Theme.surfaceText
color: (ToastService.wallpaperErrorStatus === "error" || ToastService.wallpaperErrorStatus === "matugen_missing") ? Theme.error : Theme.surfaceText
anchors.centerIn: parent
wrapMode: Text.WordWrap
width: Math.min(implicitWidth, 250)
horizontalAlignment: Text.AlignHCenter
}
}
Behavior on scale {
@@ -843,6 +835,7 @@ Item {
duration: Theme.shortDuration
easing.type: Theme.emphasizedEasing
}
}
Behavior on color {
@@ -850,6 +843,7 @@ Item {
duration: Theme.mediumDuration
easing.type: Theme.standardEasing
}
}
Behavior on border.color {
@@ -857,10 +851,15 @@ Item {
duration: Theme.mediumDuration
easing.type: Theme.standardEasing
}
}
}
}
}
}
// System App Theming
@@ -868,10 +867,8 @@ Item {
width: parent.width
height: systemThemingSection.implicitHeight + Theme.spacingL * 2
radius: Theme.cornerRadius
color: 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)
color: 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
visible: Theme.isDynamicTheme && Colors.matugenAvailable
@@ -900,6 +897,7 @@ Item {
color: Theme.surfaceText
anchors.verticalCenter: parent.verticalCenter
}
}
DankToggle {
@@ -909,9 +907,10 @@ Item {
enabled: Colors.gtkThemingEnabled
checked: Colors.gtkThemingEnabled && SettingsData.gtkThemingEnabled
onToggled: function(checked) {
SettingsData.setGtkThemingEnabled(checked)
SettingsData.setGtkThemingEnabled(checked);
if (checked && Theme.isDynamicTheme)
Colors.generateGtkThemes()
Colors.generateGtkThemes();
}
}
@@ -922,15 +921,19 @@ Item {
enabled: Colors.qtThemingEnabled
checked: Colors.qtThemingEnabled && SettingsData.qtThemingEnabled
onToggled: function(checked) {
SettingsData.setQtThemingEnabled(checked)
SettingsData.setQtThemingEnabled(checked);
if (checked && Theme.isDynamicTheme)
Colors.generateQtThemes()
}
}
}
}
Colors.generateQtThemes();
}
}
}
}
}
}
}