mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-30 00:12:50 -05:00
Compare commits
5 Commits
61630e447b
...
a5b9ff98c0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a5b9ff98c0 | ||
|
|
6feaecd92e | ||
|
|
b066a25308 | ||
|
|
777a552b57 | ||
|
|
7dbe608c28 |
@@ -73,6 +73,8 @@ Singleton {
|
||||
property string widgetBackgroundColor: "sch"
|
||||
property string widgetColorMode: "default"
|
||||
property real cornerRadius: 12
|
||||
property int niriLayoutGapsOverride: -1
|
||||
property int niriLayoutRadiusOverride: -1
|
||||
|
||||
property bool use24HourClock: true
|
||||
property bool showSeconds: false
|
||||
@@ -312,6 +314,8 @@ Singleton {
|
||||
property int overviewColumns: 5
|
||||
property real overviewScale: 0.16
|
||||
|
||||
property bool modalDarkenBackground: true
|
||||
|
||||
property bool lockScreenShowPowerActions: true
|
||||
property bool lockScreenShowSystemIcons: true
|
||||
property bool lockScreenShowTime: true
|
||||
@@ -1724,6 +1728,8 @@ Singleton {
|
||||
const txt = settingsFile.text();
|
||||
const obj = (txt && txt.trim()) ? JSON.parse(txt) : null;
|
||||
Store.parse(root, obj);
|
||||
applyStoredTheme();
|
||||
applyStoredIconTheme();
|
||||
} catch (e) {
|
||||
console.warn("SettingsData: Failed to reload settings:", e.message);
|
||||
}
|
||||
|
||||
@@ -19,6 +19,8 @@ var SPEC = {
|
||||
widgetBackgroundColor: { def: "sch" },
|
||||
widgetColorMode: { def: "default" },
|
||||
cornerRadius: { def: 12, onChange: "updateNiriLayout" },
|
||||
niriLayoutGapsOverride: { def: -1, onChange: "updateNiriLayout" },
|
||||
niriLayoutRadiusOverride: { def: -1, onChange: "updateNiriLayout" },
|
||||
|
||||
use24HourClock: { def: true },
|
||||
showSeconds: { def: false },
|
||||
@@ -211,6 +213,8 @@ var SPEC = {
|
||||
overviewColumns: { def: 5, persist: false },
|
||||
overviewScale: { def: 0.16, persist: false },
|
||||
|
||||
modalDarkenBackground: { def: true },
|
||||
|
||||
lockScreenShowPowerActions: { def: true },
|
||||
lockScreenShowSystemIcons: { def: true },
|
||||
lockScreenShowTime: { def: true },
|
||||
|
||||
@@ -19,6 +19,8 @@ Item {
|
||||
readonly property real screenWidth: effectiveScreen?.width ?? 1920
|
||||
readonly property real screenHeight: effectiveScreen?.height ?? 1080
|
||||
readonly property real dpr: effectiveScreen ? CompositorService.getScreenScale(effectiveScreen) : 1
|
||||
property bool showBackground: true
|
||||
property real backgroundOpacity: 0.5
|
||||
property string positioning: "center"
|
||||
property point customPosition: Qt.point(0, 0)
|
||||
property bool closeOnEscapeKey: true
|
||||
@@ -46,7 +48,8 @@ Item {
|
||||
readonly property alias contentWindow: contentWindow
|
||||
readonly property alias clickCatcher: clickCatcher
|
||||
readonly property bool useHyprlandFocusGrab: CompositorService.useHyprlandFocusGrab
|
||||
readonly property bool useSingleWindow: useHyprlandFocusGrab
|
||||
readonly property bool useBackground: showBackground && SettingsData.modalDarkenBackground
|
||||
readonly property bool useSingleWindow: useHyprlandFocusGrab || useBackground
|
||||
|
||||
signal opened
|
||||
signal dialogClosed
|
||||
@@ -272,6 +275,23 @@ Item {
|
||||
onClicked: root.backgroundClicked()
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
z: -1
|
||||
color: "black"
|
||||
opacity: root.useBackground ? (root.shouldBeVisible ? root.backgroundOpacity : 0) : 0
|
||||
visible: root.useBackground
|
||||
|
||||
Behavior on opacity {
|
||||
enabled: root.animationsEnabled
|
||||
NumberAnimation {
|
||||
duration: root.animationDuration
|
||||
easing.type: Easing.BezierSpline
|
||||
easing.bezierCurve: root.shouldBeVisible ? root.animationEnterCurve : root.animationExitCurve
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Item {
|
||||
id: modalContainer
|
||||
x: root.useSingleWindow ? root.alignedX : shadowBuffer
|
||||
|
||||
@@ -444,14 +444,11 @@ Item {
|
||||
}
|
||||
}
|
||||
|
||||
Image {
|
||||
CachingImage {
|
||||
id: thumbnailImage
|
||||
anchors.fill: parent
|
||||
source: modelData ? `file://${modelData}` : ""
|
||||
fillMode: Image.PreserveAspectCrop
|
||||
asynchronous: true
|
||||
cache: true
|
||||
smooth: true
|
||||
imagePath: modelData || ""
|
||||
maxCacheSize: 256
|
||||
|
||||
layer.enabled: true
|
||||
layer.effect: MultiEffect {
|
||||
|
||||
@@ -106,8 +106,7 @@ Singleton {
|
||||
if (current[outputName])
|
||||
continue;
|
||||
|
||||
const hasSettings = settings.colorManagement || settings.bitdepth ||
|
||||
settings.sdrBrightness !== undefined || settings.sdrSaturation !== undefined;
|
||||
const hasSettings = settings.colorManagement || settings.bitdepth || settings.sdrBrightness !== undefined || settings.sdrSaturation !== undefined;
|
||||
if (!hasSettings)
|
||||
continue;
|
||||
|
||||
@@ -965,8 +964,7 @@ Singleton {
|
||||
kdlContent += ` mode "${mode.width}x${mode.height}@${(mode.refresh_rate / 1000).toFixed(3)}"\n`;
|
||||
}
|
||||
if (output.logical) {
|
||||
if (output.logical.scale && output.logical.scale !== 1.0)
|
||||
kdlContent += ` scale ${output.logical.scale}\n`;
|
||||
kdlContent += ` scale ${output.logical.scale ?? 1.0}\n`;
|
||||
if (output.logical.transform && output.logical.transform !== "Normal") {
|
||||
const transformMap = {
|
||||
"Normal": "normal",
|
||||
|
||||
@@ -876,6 +876,92 @@ Item {
|
||||
}
|
||||
}
|
||||
|
||||
SettingsCard {
|
||||
tab: "theme"
|
||||
tags: ["niri", "layout", "gaps", "radius", "window"]
|
||||
title: I18n.tr("Niri Layout Overrides")
|
||||
iconName: "crop_square"
|
||||
visible: CompositorService.isNiri
|
||||
|
||||
SettingsToggleRow {
|
||||
tab: "theme"
|
||||
tags: ["niri", "gaps", "override"]
|
||||
settingKey: "niriLayoutGapsOverrideEnabled"
|
||||
text: I18n.tr("Override Gaps")
|
||||
description: I18n.tr("Use custom gaps instead of bar spacing")
|
||||
checked: SettingsData.niriLayoutGapsOverride >= 0
|
||||
onToggled: checked => {
|
||||
if (checked) {
|
||||
const currentGaps = Math.max(4, (SettingsData.barConfigs[0]?.spacing ?? 4));
|
||||
SettingsData.set("niriLayoutGapsOverride", currentGaps);
|
||||
return;
|
||||
}
|
||||
SettingsData.set("niriLayoutGapsOverride", -1);
|
||||
}
|
||||
}
|
||||
|
||||
SettingsSliderRow {
|
||||
tab: "theme"
|
||||
tags: ["niri", "gaps", "override"]
|
||||
settingKey: "niriLayoutGapsOverride"
|
||||
text: I18n.tr("Window Gaps")
|
||||
description: I18n.tr("Space between windows")
|
||||
visible: SettingsData.niriLayoutGapsOverride >= 0
|
||||
value: Math.max(0, SettingsData.niriLayoutGapsOverride)
|
||||
minimum: 0
|
||||
maximum: 50
|
||||
unit: "px"
|
||||
defaultValue: Math.max(4, (SettingsData.barConfigs[0]?.spacing ?? 4))
|
||||
onSliderValueChanged: newValue => SettingsData.set("niriLayoutGapsOverride", newValue)
|
||||
}
|
||||
|
||||
SettingsToggleRow {
|
||||
tab: "theme"
|
||||
tags: ["niri", "radius", "override"]
|
||||
settingKey: "niriLayoutRadiusOverrideEnabled"
|
||||
text: I18n.tr("Override Corner Radius")
|
||||
description: I18n.tr("Use custom window radius instead of theme radius")
|
||||
checked: SettingsData.niriLayoutRadiusOverride >= 0
|
||||
onToggled: checked => {
|
||||
if (checked) {
|
||||
SettingsData.set("niriLayoutRadiusOverride", SettingsData.cornerRadius);
|
||||
return;
|
||||
}
|
||||
SettingsData.set("niriLayoutRadiusOverride", -1);
|
||||
}
|
||||
}
|
||||
|
||||
SettingsSliderRow {
|
||||
tab: "theme"
|
||||
tags: ["niri", "radius", "override"]
|
||||
settingKey: "niriLayoutRadiusOverride"
|
||||
text: I18n.tr("Window Corner Radius")
|
||||
description: I18n.tr("Rounded corners for windows")
|
||||
visible: SettingsData.niriLayoutRadiusOverride >= 0
|
||||
value: Math.max(0, SettingsData.niriLayoutRadiusOverride)
|
||||
minimum: 0
|
||||
maximum: 100
|
||||
unit: "px"
|
||||
defaultValue: SettingsData.cornerRadius
|
||||
onSliderValueChanged: newValue => SettingsData.set("niriLayoutRadiusOverride", newValue)
|
||||
}
|
||||
}
|
||||
|
||||
SettingsCard {
|
||||
tab: "theme"
|
||||
tags: ["modal", "darken", "background", "overlay"]
|
||||
|
||||
SettingsToggleRow {
|
||||
tab: "theme"
|
||||
tags: ["modal", "darken", "background", "overlay"]
|
||||
settingKey: "modalDarkenBackground"
|
||||
text: I18n.tr("Darken Modal Background")
|
||||
description: I18n.tr("Show darkened overlay behind modal dialogs")
|
||||
checked: SettingsData.modalDarkenBackground
|
||||
onToggled: checked => SettingsData.set("modalDarkenBackground", checked)
|
||||
}
|
||||
}
|
||||
|
||||
SettingsCard {
|
||||
tab: "theme"
|
||||
tags: ["applications", "portal", "dark", "terminal"]
|
||||
|
||||
@@ -990,8 +990,11 @@ Singleton {
|
||||
function doGenerateNiriLayoutConfig() {
|
||||
console.log("NiriService: Generating layout config...");
|
||||
|
||||
const cornerRadius = typeof SettingsData !== "undefined" ? SettingsData.cornerRadius : 12;
|
||||
const gaps = typeof SettingsData !== "undefined" ? Math.max(4, (SettingsData.barConfigs[0]?.spacing ?? 4)) : 4;
|
||||
const defaultRadius = typeof SettingsData !== "undefined" ? SettingsData.cornerRadius : 12;
|
||||
const defaultGaps = typeof SettingsData !== "undefined" ? Math.max(4, (SettingsData.barConfigs[0]?.spacing ?? 4)) : 4;
|
||||
|
||||
const cornerRadius = (typeof SettingsData !== "undefined" && SettingsData.niriLayoutRadiusOverride >= 0) ? SettingsData.niriLayoutRadiusOverride : defaultRadius;
|
||||
const gaps = (typeof SettingsData !== "undefined" && SettingsData.niriLayoutGapsOverride >= 0) ? SettingsData.niriLayoutGapsOverride : defaultGaps;
|
||||
|
||||
const dmsWarning = `// ! DO NOT EDIT !
|
||||
// ! AUTO-GENERATED BY DMS !
|
||||
@@ -1154,9 +1157,7 @@ Singleton {
|
||||
}
|
||||
|
||||
if (output.logical) {
|
||||
if (output.logical.scale && output.logical.scale !== 1.0) {
|
||||
kdlContent += ` scale ${output.logical.scale}\n`;
|
||||
}
|
||||
kdlContent += ` scale ${output.logical.scale ?? 1.0}\n`;
|
||||
|
||||
if (output.logical.transform && output.logical.transform !== "Normal") {
|
||||
const transformMap = {
|
||||
|
||||
Reference in New Issue
Block a user