diff --git a/Modules/Bar/Bar.qml b/Modules/Bar/Bar.qml index 5f8f1d9..41731f8 100644 --- a/Modules/Bar/Bar.qml +++ b/Modules/Bar/Bar.qml @@ -26,7 +26,7 @@ PanelWindow { Rectangle { anchors.fill: parent - color: Theme.backgroundPrimary + color: Colors.backgroundPrimary layer.enabled: true } diff --git a/Modules/Bar/Clock.qml b/Modules/Bar/Clock.qml index 4a94e21..da71018 100644 --- a/Modules/Bar/Clock.qml +++ b/Modules/Bar/Clock.qml @@ -14,10 +14,10 @@ Rectangle { Text { id: textItem text: Time.time - font.family: Theme.fontFamily + font.family: Settings.settings.fontFamily font.weight: Font.Bold font.pointSize: Style.fontMedium * scaling - color: Theme.textPrimary + color: Colors.textPrimary anchors.centerIn: parent } diff --git a/Modules/DemoPanel/DemoPanel.qml b/Modules/DemoPanel/DemoPanel.qml index 83a480e..9ecb833 100644 --- a/Modules/DemoPanel/DemoPanel.qml +++ b/Modules/DemoPanel/DemoPanel.qml @@ -17,9 +17,9 @@ NPanel { readonly property real scaling: Scaling.scale(screen) Rectangle { - color: Theme.backgroundPrimary + color: Colors.backgroundPrimary radius: Style.radiusMedium * scaling - border.color: Theme.backgroundTertiary + border.color: Colors.backgroundTertiary border.width: Math.max(1, 1.5 * scale) width: 500 * scaling height: 300 @@ -42,7 +42,7 @@ NPanel { spacing: 16 * scaling Text { text: "NIconButton" - color: Theme.textPrimary + color: Colors.textPrimary } NIconButton { @@ -64,7 +64,7 @@ NPanel { uniformCellSizes: true Text { text: "NToggle + NTooltip" - color: Theme.textPrimary + color: Colors.textPrimary } NToggle { @@ -88,7 +88,7 @@ NPanel { spacing: 16 * scaling Text { text: "NSlider" - color: Theme.textPrimary + color: Colors.textPrimary } NSlider {} diff --git a/Services/Theme.qml b/Services/Colors.qml similarity index 96% rename from Services/Theme.qml rename to Services/Colors.qml index bf1829f..d8ad5e6 100644 --- a/Services/Theme.qml +++ b/Services/Colors.qml @@ -43,9 +43,6 @@ Singleton { property color shadow: applyOpacity(themeData.shadow, "B3") property color overlay: applyOpacity(themeData.overlay, "66") - // Font Properties - property string fontFamily: "Roboto" // Family for all text - function applyOpacity(color, opacity) { return color.replace("#", "#" + opacity) } @@ -53,7 +50,7 @@ Singleton { // FileView to load theme data from JSON file FileView { id: themeFile - path: Settings.themeFile + path: Settings.colorsFile watchChanges: true onFileChanged: reload() onAdapterUpdated: writeAdapter() diff --git a/Services/Settings.qml b/Services/Settings.qml index 6ec70e0..e4935d1 100644 --- a/Services/Settings.qml +++ b/Services/Settings.qml @@ -14,8 +14,8 @@ Singleton { "HOME") + "/.config") + "/" + shellName + "/" property string settingsFile: Quickshell.env("NOCTALIA_SETTINGS_FILE") || (settingsDir + "Settings.json") - property string themeFile: Quickshell.env("NOCTALIA_THEME_FILE") - || (settingsDir + "Theme.json") + property string colorsFile: Quickshell.env("NOCTALIA_COLORS_FILE") + || (settingsDir + "Colors.json") property var settings: settingAdapter Item { @@ -91,7 +91,9 @@ Singleton { property var notificationMonitors: [] // Array of monitor names to show notifications on, "*" means all monitors property var monitorScaleOverrides: { - } // Map of monitor name -> scale override (e.g., 0.8..2.0). When set, Theme.scale() returns this value + } // Map of monitor name -> scale override (e.g., 0.8..2.0). When set, Colors.scale() returns this value + + property string fontFamily: "Roboto" // Family for all text } } diff --git a/Widgets/NCalendar.qml b/Widgets/NCalendar.qml index cb097e6..1c790d2 100644 --- a/Widgets/NCalendar.qml +++ b/Widgets/NCalendar.qml @@ -13,9 +13,9 @@ NPanel { readonly property real scaling: Scaling.scale(screen) Rectangle { - color: Theme.backgroundPrimary + color: Colors.backgroundPrimary radius: Style.radiusMedium * scaling - border.color: Theme.backgroundTertiary + border.color: Colors.backgroundTertiary border.width: Math.max(1, 1.5 * scale) width: 340 * scaling height: 380 @@ -52,10 +52,10 @@ NPanel { Layout.fillWidth: true horizontalAlignment: Text.AlignHCenter text: calendar.title - color: Theme.textPrimary + color: Colors.textPrimary opacity: 0.7 font.pointSize: Style.fontSmall * scaling - font.family: Theme.fontFamily + font.family: Settings.settings.fontFamily font.bold: true } @@ -77,10 +77,10 @@ NPanel { delegate: Text { text: shortName - color: Theme.textPrimary + color: Colors.textPrimary opacity: 0.8 font.pointSize: Style.fontSmall * scaling - font.family: Theme.fontFamily + font.family: Settings.settings.fontFamily font.bold: true horizontalAlignment: Text.AlignHCenter width: 32 @@ -136,10 +136,10 @@ NPanel { radius: 8 color: { if (model.today) - return Theme.accentPrimary + return Colors.accentPrimary if (mouseArea2.containsMouse) - return Theme.backgroundTertiary + return Colors.backgroundTertiary return "transparent" } @@ -150,7 +150,7 @@ NPanel { width: 4 height: 4 radius: 4 - color: Theme.accentTertiary + color: Colors.accentTertiary anchors.top: parent.top anchors.right: parent.right anchors.topMargin: 4 @@ -161,10 +161,10 @@ NPanel { Text { anchors.centerIn: parent text: model.day - color: model.today ? Theme.onAccent : Theme.textPrimary + color: model.today ? Colors.onAccent : Colors.textPrimary opacity: model.month === calendar.month ? (mouseArea2.containsMouse ? 1 : 0.7) : 0.3 font.pointSize: Style.fontSmall * scaling - font.family: Theme.fontFamily + font.family: Settings.settings.fontFamily font.bold: model.today ? true : false } diff --git a/Widgets/NIconButton.qml b/Widgets/NIconButton.qml index 041ecaf..e6d4d76 100644 --- a/Widgets/NIconButton.qml +++ b/Widgets/NIconButton.qml @@ -19,7 +19,7 @@ Rectangle { implicitHeight: size radius: width * 0.5 - color: root.hovering ? Theme.accentPrimary : "transparent" + color: root.hovering ? Colors.accentPrimary : "transparent" Text { id: iconText @@ -27,7 +27,7 @@ Rectangle { text: root.icon font.family: "Material Symbols Outlined" font.pointSize: Style.fontExtraLarge * scaling - color: root.hovering ? Theme.onAccent : Theme.textPrimary + color: root.hovering ? Colors.onAccent : Colors.textPrimary horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter opacity: root.enabled ? 1.0 : 0.5 diff --git a/Widgets/NPanel.qml b/Widgets/NPanel.qml index 7ced550..ac539ee 100644 --- a/Widgets/NPanel.qml +++ b/Widgets/NPanel.qml @@ -9,7 +9,7 @@ PanelWindow { readonly property real scaling: Scaling.scale(screen) property bool showOverlay: Settings.settings.dimPanels property int topMargin: Style.barHeight * scaling - property color overlayColor: showOverlay ? Theme.overlay : "transparent" + property color overlayColor: showOverlay ? Colors.overlay : "transparent" function hide() { visible = false diff --git a/Widgets/NSlider.qml b/Widgets/NSlider.qml index 80932ac..bde21b4 100644 --- a/Widgets/NSlider.qml +++ b/Widgets/NSlider.qml @@ -27,13 +27,13 @@ Slider { width: root.availableWidth height: implicitHeight radius: height / 2 - color: Theme.surfaceVariant + color: Colors.surfaceVariant Rectangle { id: activeTrack width: root.visualPosition * parent.width height: parent.height - color: Theme.accentPrimary + color: Colors.accentPrimary radius: parent.radius // Feels more responsive without animation @@ -51,7 +51,7 @@ Slider { width: knobDiameter + cutoutExtra height: knobDiameter + cutoutExtra radius: width / 2 - color: root.cutoutColor !== undefined ? root.cutoutColor : Theme.backgroundPrimary + color: root.cutoutColor !== undefined ? root.cutoutColor : Colors.backgroundPrimary x: Math.max( 0, Math.min( parent.width - width, @@ -71,7 +71,7 @@ Slider { anchors.fill: knob source: knob shadowEnabled: true - shadowColor: Theme.shadow + shadowColor: Colors.shadow shadowOpacity: 0.25 shadowHorizontalOffset: 0 shadowVerticalOffset: 1 @@ -83,8 +83,8 @@ Slider { implicitWidth: knobDiameter implicitHeight: knobDiameter radius: width * 0.5 - color: root.pressed ? Theme.surfaceVariant : Theme.surface - border.color: Theme.accentPrimary + color: root.pressed ? Colors.surfaceVariant : Colors.surface + border.color: Colors.accentPrimary border.width: Math.max(1, 2 * scaling) // Press feedback halo (using accent color, low opacity) Rectangle { @@ -92,7 +92,7 @@ Slider { width: parent.width + 8 * scaling height: parent.height + 8 * scaling radius: width / 2 - color: Theme.accentPrimary + color: Colors.accentPrimary opacity: root.pressed ? 0.16 : 0.0 } } diff --git a/Widgets/NToggle.qml b/Widgets/NToggle.qml index 12c692e..90c8a65 100644 --- a/Widgets/NToggle.qml +++ b/Widgets/NToggle.qml @@ -23,13 +23,13 @@ RowLayout { text: label font.pointSize: Style.fontMedium * scaling font.bold: true - color: Theme.textPrimary + color: Colors.textPrimary } Text { text: description font.pointSize: Style.fontSmall * scaling - color: Theme.textSecondary + color: Colors.textSecondary wrapMode: Text.WordWrap Layout.fillWidth: true } @@ -41,16 +41,16 @@ RowLayout { width: Style.baseWidgetHeight * 1.625 * scaling height: Style.baseWidgetHeight * scaling radius: height * 0.5 - color: value ? Theme.accentPrimary :Theme.surfaceVariant - border.color: value ? Theme.accentPrimary : Theme.outline + color: value ? Colors.accentPrimary :Colors.surfaceVariant + border.color: value ? Colors.accentPrimary : Colors.outline border.width: Math.max(1, 1.5 * scale) Rectangle { width: (Style.baseWidgetHeight- 4) * scaling height: (Style.baseWidgetHeight - 4) * scaling radius: height * 0.5 - color: Theme.surface - border.color: hovering ? Theme.textDisabled : Theme.outline + color: Colors.surface + border.color: hovering ? Colors.textDisabled : Colors.outline border.width: Math.max(1, 1.5 * scale) y: 2 * scaling x: value ? switcher.width - width - 2 * scale : 2 * scaling diff --git a/Widgets/NTooltip.qml b/Widgets/NTooltip.qml index 914298f..fbb7b4b 100644 --- a/Widgets/NTooltip.qml +++ b/Widgets/NTooltip.qml @@ -99,8 +99,8 @@ Window { Rectangle { anchors.fill: parent radius: Style.radiusMedium * scaling - color: Theme.backgroundTertiary - border.color: Theme.outline + color: Colors.backgroundTertiary + border.color: Colors.outline border.width: 1 * scaling opacity: 0.97 z: 1 @@ -110,8 +110,8 @@ Window { id: tooltipText anchors.centerIn: parent text: root.text - color: Theme.textPrimary - font.family: Theme.fontFamily + color: Colors.textPrimary + font.family: Settings.settings.fontFamily font.pointSize: Style.fontMedium * scaling horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter