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

refactor: mega refactoring of a bunch of things

This commit is contained in:
bbedward
2025-07-23 11:56:18 -04:00
parent 14eef59c9f
commit 19adcf3578
52 changed files with 4260 additions and 3879 deletions

View File

@@ -14,4 +14,5 @@ Column {
return Prefs.setClockFormat(checked);
}
}
}
}

View File

@@ -5,6 +5,7 @@ import qs.Widgets
Column {
id: root
width: parent.width
spacing: Theme.spacingL
@@ -158,4 +159,5 @@ Column {
}
}
}
}

View File

@@ -146,7 +146,6 @@ Column {
onEditingFinished: {
Prefs.setProfileImage(text);
}
}
}
@@ -164,4 +163,5 @@ Column {
}
}
}
}

View File

@@ -11,22 +11,27 @@ DankModal {
signal closingModal()
onVisibleChanged: {
if (!visible) {
if (!visible)
closingModal();
}
}
}
// DankModal configuration
visible: settingsVisible
width: 650
height: 750
keyboardFocus: "ondemand"
enableShadow: true
onBackgroundClicked: {
settingsVisible = false;
}
// Keyboard focus and shortcuts
FocusScope {
anchors.fill: parent
focus: settingsModal.settingsVisible
Keys.onEscapePressed: settingsModal.settingsVisible = false
}
content: Component {
Column {
anchors.fill: parent
@@ -73,6 +78,7 @@ DankModal {
// Settings sections
ScrollView {
id: settingsScrollView
width: parent.width
height: parent.height - 50
clip: true
@@ -81,6 +87,7 @@ DankModal {
Column {
id: settingsColumn
width: settingsScrollView.width - 20
spacing: Theme.spacingL
bottomPadding: Theme.spacingL
@@ -89,42 +96,60 @@ DankModal {
SettingsSection {
title: "Profile"
iconName: "person"
content: ProfileTab {}
content: ProfileTab {
}
}
// Clock Settings
SettingsSection {
title: "Clock & Time"
iconName: "schedule"
content: ClockTab {}
content: ClockTab {
}
}
// Weather Settings
SettingsSection {
title: "Weather"
iconName: "wb_sunny"
content: WeatherTab {}
content: WeatherTab {
}
}
// Widget Visibility Settings
SettingsSection {
title: "Top Bar Widgets"
iconName: "widgets"
content: WidgetsTab {}
content: WidgetsTab {
}
}
// Workspace Settings
SettingsSection {
title: "Workspaces"
iconName: "tab"
content: WorkspaceTab {}
content: WorkspaceTab {
}
}
// Display Settings
SettingsSection {
title: "Display & Appearance"
iconName: "palette"
content: DisplayTab {}
content: DisplayTab {
}
}
}
@@ -132,13 +157,7 @@ DankModal {
}
}
}
// Keyboard focus and shortcuts
FocusScope {
anchors.fill: parent
focus: settingsModal.settingsVisible
Keys.onEscapePressed: settingsModal.settingsVisible = false
}
}
}

View File

@@ -48,4 +48,4 @@ Column {
width: parent.width
}
}
}

View File

@@ -14,49 +14,44 @@ Column {
return Prefs.setTemperatureUnit(checked);
}
}
// Weather Location Override
Column {
width: parent.width
spacing: Theme.spacingM
DankToggle {
text: "Override Location"
description: "Use a specific location instead of auto-detection"
checked: Prefs.weatherLocationOverrideEnabled
onToggled: (checked) => Prefs.setWeatherLocationOverrideEnabled(checked)
onToggled: (checked) => {
return Prefs.setWeatherLocationOverrideEnabled(checked);
}
}
// Location input - only visible when override is enabled
Column {
width: parent.width
spacing: Theme.spacingS
visible: Prefs.weatherLocationOverrideEnabled
opacity: visible ? 1.0 : 0.0
Behavior on opacity {
NumberAnimation {
duration: Theme.mediumDuration
easing.type: Theme.emphasizedEasing
}
}
opacity: visible ? 1 : 0
Text {
text: "Location"
font.pixelSize: Theme.fontSizeMedium
color: Theme.surfaceText
font.weight: Font.Medium
}
DankLocationSearch {
width: parent.width
currentLocation: Prefs.weatherLocationOverride
placeholderText: "Search for a location..."
onLocationSelected: (displayName, coordinates) => {
Prefs.setWeatherLocationOverride(coordinates)
Prefs.setWeatherLocationOverride(coordinates);
}
}
Text {
text: "Examples: \"New York\", \"Tokyo\", \"44511\""
font.pixelSize: Theme.fontSizeSmall
@@ -64,6 +59,17 @@ Column {
wrapMode: Text.WordWrap
width: parent.width
}
Behavior on opacity {
NumberAnimation {
duration: Theme.mediumDuration
easing.type: Theme.emphasizedEasing
}
}
}
}
}
}

View File

@@ -109,13 +109,13 @@ Column {
bottomPadding: Theme.spacingS
onEditingFinished: {
var color = text.trim();
if (color === "" || /^#[0-9A-Fa-f]{6}$/.test(color)) {
if (color === "" || /^#[0-9A-Fa-f]{6}$/.test(color))
Prefs.setOSLogoColorOverride(color);
} else {
else
text = Prefs.osLogoColorOverride;
}
}
}
}
Row {
@@ -139,9 +139,10 @@ Column {
unit: ""
showValue: false
onSliderValueChanged: (newValue) => {
Prefs.setOSLogoBrightness(newValue / 100.0);
Prefs.setOSLogoBrightness(newValue / 100);
}
}
}
Row {
@@ -165,9 +166,12 @@ Column {
unit: ""
showValue: false
onSliderValueChanged: (newValue) => {
Prefs.setOSLogoContrast(newValue / 100.0);
Prefs.setOSLogoContrast(newValue / 100);
}
}
}
}
}
}

View File

@@ -23,4 +23,5 @@ Column {
return Prefs.setShowWorkspacePadding(checked);
}
}
}
}