better structure
This commit is contained in:
26
config/quickshell/Constants/Color.qml
Normal file
26
config/quickshell/Constants/Color.qml
Normal file
@@ -0,0 +1,26 @@
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
import Quickshell.Io
|
||||
import qs.Constants
|
||||
pragma Singleton
|
||||
|
||||
Singleton {
|
||||
id: root
|
||||
|
||||
// Compatibility colors for noctalia modules
|
||||
property color mPrimary: Colors.primary
|
||||
property color mOnPrimary: Colors.base
|
||||
property color mSecondary: Colors.primary
|
||||
property color mOnSecondary: Colors.base
|
||||
property color mTertiary: Colors.primary
|
||||
property color mOnTertiary: Colors.base
|
||||
property color mError: Colors.red
|
||||
property color mOnError: Colors.base
|
||||
property color mSurface: Colors.base
|
||||
property color mOnSurface: Colors.text
|
||||
property color mSurfaceVariant: Colors.surface
|
||||
property color mOnSurfaceVariant: Colors.overlay1
|
||||
property color mOutline: Colors.primary
|
||||
property color mShadow: Colors.crust
|
||||
property color transparent: "transparent"
|
||||
}
|
||||
40
config/quickshell/Constants/Colors.qml
Normal file
40
config/quickshell/Constants/Colors.qml
Normal file
@@ -0,0 +1,40 @@
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
import qs.Services
|
||||
pragma Singleton
|
||||
|
||||
Singleton {
|
||||
id: root
|
||||
|
||||
readonly property color transparent: "transparent"
|
||||
readonly property color rosewater: "#f5e0dc"
|
||||
readonly property color flamingo: "#f2cdcd"
|
||||
readonly property color pink: "#f5c2e7"
|
||||
readonly property color mauve: "#cba6f7"
|
||||
readonly property color red: "#f38ba8"
|
||||
readonly property color maroon: "#eba0ac"
|
||||
readonly property color peach: "#fab387"
|
||||
readonly property color yellow: "#f9e2af"
|
||||
readonly property color green: "#a6e3a1"
|
||||
readonly property color teal: "#94e2d5"
|
||||
readonly property color sky: "#89dceb"
|
||||
readonly property color sapphire: "#74c7ec"
|
||||
readonly property color blue: "#89b4fa"
|
||||
readonly property color lavender: "#b4befe"
|
||||
readonly property color text: "#cdd6f4"
|
||||
readonly property color subtext1: "#bac2de"
|
||||
readonly property color subtext0: "#a6adc8"
|
||||
readonly property color overlay2: "#9399b2"
|
||||
readonly property color overlay1: "#7f849c"
|
||||
readonly property color overlay0: "#6c7086"
|
||||
readonly property color surface2: "#585b70"
|
||||
readonly property color surface1: "#45475a"
|
||||
readonly property color surface0: "#313244"
|
||||
readonly property color surface: "#292a3c"
|
||||
readonly property color base: "#1e1e2e"
|
||||
readonly property color mantle: "#181825"
|
||||
readonly property color crust: "#11111b"
|
||||
property color primary: SettingsService.primaryColor
|
||||
readonly property color distroColor: "#74c7ec"
|
||||
readonly property var cavaList: ["#b4befe", "#89b4fa", "#74c7ec", "#89dceb", "#94e2d5", "#a6e3a1", "#f9e2af", "#fab387"]
|
||||
}
|
||||
16
config/quickshell/Constants/Fonts.qml
Normal file
16
config/quickshell/Constants/Fonts.qml
Normal file
@@ -0,0 +1,16 @@
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
import qs.Constants
|
||||
pragma Singleton
|
||||
|
||||
Singleton {
|
||||
id: root
|
||||
|
||||
readonly property string primary: "Sour Gummy Light"
|
||||
readonly property string nerd: "Meslo LGM Nerd Font Mono"
|
||||
readonly property string sans: "Noto Sans"
|
||||
readonly property int small: Style.fontSizeS
|
||||
readonly property int medium: Style.fontSizeM
|
||||
readonly property int large: Style.fontSizeL
|
||||
readonly property int icon: 14 // for nerd font
|
||||
}
|
||||
105
config/quickshell/Constants/Icons.qml
Normal file
105
config/quickshell/Constants/Icons.qml
Normal file
@@ -0,0 +1,105 @@
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
import qs.Utils
|
||||
pragma Singleton
|
||||
|
||||
Singleton {
|
||||
id: root
|
||||
|
||||
// Nerd fonts icons
|
||||
readonly property string distro: ""
|
||||
readonly property string tray: ""
|
||||
readonly property string idleInhibitorActivated: ""
|
||||
readonly property string idleInhibitorDeactivated: ""
|
||||
readonly property string powerMenu: ""
|
||||
readonly property string volumeHigh: ""
|
||||
readonly property string volumeMedium: ""
|
||||
readonly property string volumeLow: ""
|
||||
readonly property string volumeMuted: ""
|
||||
readonly property string brightness: ""
|
||||
readonly property string charging: ""
|
||||
readonly property string battery100: ""
|
||||
readonly property string battery75: ""
|
||||
readonly property string battery50: ""
|
||||
readonly property string battery25: ""
|
||||
readonly property string battery00: ""
|
||||
readonly property string cpu: ""
|
||||
readonly property string memory: ""
|
||||
readonly property string tempHigh: ""
|
||||
readonly property string tempMedium: ""
|
||||
readonly property string tempLow: ""
|
||||
readonly property string global: ""
|
||||
readonly property string upload: ""
|
||||
readonly property string download: ""
|
||||
readonly property string speedSlower: ""
|
||||
readonly property string speedFaster: ""
|
||||
readonly property string speedReset: ""
|
||||
readonly property string reset: ""
|
||||
readonly property string lines: ""
|
||||
readonly property string record: ""
|
||||
// Tabler icons
|
||||
// Expose the font family name for easy access
|
||||
readonly property string fontFamily: currentFontLoader ? currentFontLoader.name : ""
|
||||
readonly property string defaultIcon: TablerIcons.defaultIcon
|
||||
readonly property var icons: TablerIcons.icons
|
||||
readonly property var aliases: TablerIcons.aliases
|
||||
readonly property string fontPath: "/Assets/Fonts/tabler/tabler-icons.ttf"
|
||||
// Current active font loader
|
||||
property FontLoader currentFontLoader: null
|
||||
property int fontVersion: 0
|
||||
// Create a unique cache-busting path
|
||||
readonly property string cacheBustingPath: Quickshell.shellDir + fontPath + "?v=" + fontVersion + "&t=" + Date.now()
|
||||
|
||||
// Signal emitted when font is reloaded
|
||||
signal fontReloaded()
|
||||
|
||||
// ---------------------------------------
|
||||
function get(iconName) {
|
||||
// Check in aliases first
|
||||
if (aliases[iconName] !== undefined)
|
||||
iconName = aliases[iconName];
|
||||
|
||||
// Find the appropriate codepoint
|
||||
return icons[iconName];
|
||||
}
|
||||
|
||||
function loadFontWithCacheBusting() {
|
||||
// Destroy old loader first
|
||||
if (currentFontLoader) {
|
||||
currentFontLoader.destroy();
|
||||
currentFontLoader = null;
|
||||
}
|
||||
// Create new loader with cache-busting URL
|
||||
currentFontLoader = Qt.createQmlObject(`
|
||||
import QtQuick
|
||||
FontLoader {
|
||||
source: "${cacheBustingPath}"
|
||||
}
|
||||
`, root, "dynamicFontLoader_" + fontVersion);
|
||||
// Connect to the new loader's status changes
|
||||
currentFontLoader.statusChanged.connect(function() {
|
||||
if (currentFontLoader.status === FontLoader.Ready)
|
||||
fontReloaded();
|
||||
else if (currentFontLoader.status === FontLoader.Error)
|
||||
Logger.error("Icons", "Font failed to load (version " + fontVersion + ")");
|
||||
});
|
||||
}
|
||||
|
||||
function reloadFont() {
|
||||
fontVersion++;
|
||||
loadFontWithCacheBusting();
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
loadFontWithCacheBusting();
|
||||
}
|
||||
|
||||
Connections {
|
||||
function onReloadCompleted() {
|
||||
reloadFont();
|
||||
}
|
||||
|
||||
target: Quickshell
|
||||
}
|
||||
|
||||
}
|
||||
68
config/quickshell/Constants/Style.qml
Normal file
68
config/quickshell/Constants/Style.qml
Normal file
@@ -0,0 +1,68 @@
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
import Quickshell.Io
|
||||
pragma Singleton
|
||||
|
||||
Singleton {
|
||||
/*
|
||||
Preset sizes for font, radii, ?
|
||||
*/
|
||||
|
||||
id: root
|
||||
|
||||
// Font size
|
||||
property real fontSizeXXS: 8
|
||||
property real fontSizeXS: 9
|
||||
property real fontSizeS: 10
|
||||
property real fontSizeM: 11
|
||||
property real fontSizeL: 13
|
||||
property real fontSizeXL: 16
|
||||
property real fontSizeXXL: 18
|
||||
property real fontSizeXXXL: 24
|
||||
// Font weight
|
||||
property int fontWeightRegular: 400
|
||||
property int fontWeightMedium: 500
|
||||
property int fontWeightSemiBold: 600
|
||||
property int fontWeightBold: 700
|
||||
// Radii
|
||||
property int radiusXXS: 4
|
||||
property int radiusXS: 8
|
||||
property int radiusS: 12
|
||||
property int radiusM: 16
|
||||
property int radiusL: 20
|
||||
//screen Radii
|
||||
property int screenRadius: 20
|
||||
// Border
|
||||
property int borderS: 2
|
||||
property int borderM: 3
|
||||
property int borderL: 4
|
||||
// Margins (for margins and spacing)
|
||||
property int marginXXS: 2
|
||||
property int marginXS: 4
|
||||
property int marginS: 8
|
||||
property int marginM: 12
|
||||
property int marginL: 16
|
||||
property int marginXL: 24
|
||||
// Opacity
|
||||
property real opacityNone: 0
|
||||
property real opacityLight: 0.25
|
||||
property real opacityMedium: 0.5
|
||||
property real opacityHeavy: 0.75
|
||||
property real opacityAlmost: 0.95
|
||||
property real opacityFull: 1
|
||||
// Animation duration (ms)
|
||||
property int animationFast: 150
|
||||
property int animationNormal: 300
|
||||
property int animationSlow: 450
|
||||
property int animationSlowest: 1000
|
||||
// Delays
|
||||
property int tooltipDelay: 300
|
||||
property int tooltipDelayLong: 1200
|
||||
property int pillDelay: 500
|
||||
// Settings widgets base size
|
||||
property real baseWidgetSize: 33
|
||||
property real sliderWidth: 200
|
||||
// Bar Dimensions
|
||||
property real barHeight: 45
|
||||
property real capsuleHeight: 35
|
||||
}
|
||||
6169
config/quickshell/Constants/TablerIcons.qml
Normal file
6169
config/quickshell/Constants/TablerIcons.qml
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user