mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2025-12-06 06:36:15 +00:00
Settings vs Colors
Moved the fontFamily in the settings Theme is now called Colors (as in ColorScheme)
This commit is contained in:
@@ -26,7 +26,7 @@ PanelWindow {
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
color: Theme.backgroundPrimary
|
||||
color: Colors.backgroundPrimary
|
||||
layer.enabled: true
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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 {}
|
||||
|
||||
@@ -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()
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user