forked from Shinonome/dots-hyprland
feat(modules/bar): add nightmode button (#1481)
This commit is contained in:
@@ -11,6 +11,7 @@ Item {
|
|||||||
id: root
|
id: root
|
||||||
property bool borderless: ConfigOptions.bar.borderless
|
property bool borderless: ConfigOptions.bar.borderless
|
||||||
implicitWidth: rowLayout.implicitWidth + rowLayout.spacing * 2
|
implicitWidth: rowLayout.implicitWidth + rowLayout.spacing * 2
|
||||||
|
implicitHeight: rowLayout.implicitHeight
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
id: rowLayout
|
id: rowLayout
|
||||||
@@ -34,21 +35,21 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Loader {
|
Loader {
|
||||||
active: ConfigOptions.bar.utilButtons.showColorPicker
|
active: ConfigOptions.bar.utilButtons.showColorPicker
|
||||||
visible: ConfigOptions.bar.utilButtons.showColorPicker
|
visible: ConfigOptions.bar.utilButtons.showColorPicker
|
||||||
sourceComponent: CircleUtilButton {
|
sourceComponent: CircleUtilButton {
|
||||||
Layout.alignment: Qt.AlignVCenter
|
Layout.alignment: Qt.AlignVCenter
|
||||||
onClicked: Hyprland.dispatch("exec hyprpicker -a")
|
onClicked: Hyprland.dispatch("exec hyprpicker -a")
|
||||||
MaterialSymbol {
|
MaterialSymbol {
|
||||||
horizontalAlignment: Qt.AlignHCenter
|
horizontalAlignment: Qt.AlignHCenter
|
||||||
fill: 1
|
fill: 1
|
||||||
text: "colorize"
|
text: "colorize"
|
||||||
iconSize: Appearance.font.pixelSize.large
|
iconSize: Appearance.font.pixelSize.large
|
||||||
color: Appearance.colors.colOnLayer2
|
color: Appearance.colors.colOnLayer2
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Loader {
|
Loader {
|
||||||
active: ConfigOptions.bar.utilButtons.showKeyboardToggle
|
active: ConfigOptions.bar.utilButtons.showKeyboardToggle
|
||||||
@@ -82,4 +83,26 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loader {
|
||||||
|
active: ConfigOptions.bar.utilButtons.showDarkModeToggle
|
||||||
|
visible: ConfigOptions.bar.utilButtons.showDarkModeToggle
|
||||||
|
sourceComponent: CircleUtilButton {
|
||||||
|
Layout.alignment: Qt.AlignVCenter
|
||||||
|
onClicked: event => {
|
||||||
|
if (Appearance.m3colors.darkmode) {
|
||||||
|
Hyprland.dispatch(`exec ${Directories.wallpaperSwitchScriptPath} --mode light --noswitch`);
|
||||||
|
} else {
|
||||||
|
Hyprland.dispatch(`exec ${Directories.wallpaperSwitchScriptPath} --mode dark --noswitch`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
MaterialSymbol {
|
||||||
|
horizontalAlignment: Qt.AlignHCenter
|
||||||
|
fill: 0
|
||||||
|
text: Appearance.m3colors.darkmode ? "light_mode" : "dark_mode"
|
||||||
|
iconSize: Appearance.font.pixelSize.large
|
||||||
|
color: Appearance.colors.colOnLayer2
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import QtQuick
|
|
||||||
import Quickshell
|
|
||||||
pragma Singleton
|
pragma Singleton
|
||||||
pragma ComponentBehavior: Bound
|
pragma ComponentBehavior: Bound
|
||||||
|
import QtQuick
|
||||||
|
import Quickshell
|
||||||
|
|
||||||
Singleton {
|
Singleton {
|
||||||
property QtObject policies: QtObject {
|
property QtObject policies: QtObject {
|
||||||
@@ -21,8 +21,10 @@ Singleton {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
property QtObject audio: QtObject { // Values in %
|
property QtObject audio: QtObject {
|
||||||
property QtObject protection: QtObject { // Prevent sudden bangs
|
// Values in %
|
||||||
|
property QtObject protection: QtObject {
|
||||||
|
// Prevent sudden bangs
|
||||||
property bool enable: true
|
property bool enable: true
|
||||||
property real maxAllowedIncrease: 10
|
property real maxAllowedIncrease: 10
|
||||||
property real maxAllowed: 90 // Realistically should already provide some protection when it's 99...
|
property real maxAllowed: 90 // Realistically should already provide some protection when it's 99...
|
||||||
@@ -59,6 +61,7 @@ Singleton {
|
|||||||
property bool showColorPicker: false
|
property bool showColorPicker: false
|
||||||
property bool showMicToggle: false
|
property bool showMicToggle: false
|
||||||
property bool showKeyboardToggle: true
|
property bool showKeyboardToggle: true
|
||||||
|
property bool showDarkModeToggle: true
|
||||||
}
|
}
|
||||||
property QtObject tray: QtObject {
|
property QtObject tray: QtObject {
|
||||||
property bool monochromeIcons: true
|
property bool monochromeIcons: true
|
||||||
@@ -83,9 +86,7 @@ Singleton {
|
|||||||
property bool pinnedOnStartup: false
|
property bool pinnedOnStartup: false
|
||||||
property bool hoverToReveal: false // When false, only reveals on empty workspace
|
property bool hoverToReveal: false // When false, only reveals on empty workspace
|
||||||
property list<string> pinnedApps: [ // IDs of pinned entries
|
property list<string> pinnedApps: [ // IDs of pinned entries
|
||||||
"org.kde.dolphin",
|
"org.kde.dolphin", "kitty",]
|
||||||
"kitty",
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
|
||||||
property QtObject language: QtObject {
|
property QtObject language: QtObject {
|
||||||
@@ -123,7 +124,7 @@ Singleton {
|
|||||||
property QtObject search: QtObject {
|
property QtObject search: QtObject {
|
||||||
property int nonAppResultDelay: 30 // This prevents lagging when typing
|
property int nonAppResultDelay: 30 // This prevents lagging when typing
|
||||||
property string engineBaseUrl: "https://www.google.com/search?q="
|
property string engineBaseUrl: "https://www.google.com/search?q="
|
||||||
property list<string> excludedSites: [ "quora.com" ]
|
property list<string> excludedSites: ["quora.com"]
|
||||||
property bool sloppy: false // Uses levenshtein distance based scoring instead of fuzzy sort. Very weird.
|
property bool sloppy: false // Uses levenshtein distance based scoring instead of fuzzy sort. Very weird.
|
||||||
property QtObject prefix: QtObject {
|
property QtObject prefix: QtObject {
|
||||||
property string action: "/"
|
property string action: "/"
|
||||||
@@ -160,5 +161,4 @@ Singleton {
|
|||||||
property QtObject hacks: QtObject {
|
property QtObject hacks: QtObject {
|
||||||
property int arbitraryRaceConditionDelay: 20 // milliseconds
|
property int arbitraryRaceConditionDelay: 20 // milliseconds
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user