forked from Shinonome/dots-hyprland
cleaner import; sidebar quick toggles
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
import "../common"
|
import "root:/modules/common"
|
||||||
import "../common/widgets"
|
import "root:/modules/common/widgets"
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import Quickshell.Wayland
|
import Quickshell.Wayland
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import "../common"
|
import "root:/modules/common"
|
||||||
import "../common/widgets"
|
import "root:/modules/common/widgets"
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import "../common"
|
import "root:/modules/common"
|
||||||
import "../common/widgets"
|
import "root:/modules/common/widgets"
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import Quickshell
|
import Quickshell
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import "../common"
|
import "root:/modules/common"
|
||||||
import "../common/widgets"
|
import "root:/modules/common/widgets"
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import "../common"
|
import "root:/modules/common"
|
||||||
import "../common/widgets"
|
import "root:/modules/common/widgets"
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import Quickshell
|
import Quickshell
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import "../common"
|
import "root:/modules/common"
|
||||||
import "../common/widgets"
|
import "root:/modules/common/widgets"
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import Quickshell
|
import Quickshell
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import "../common"
|
import "root:/modules/common"
|
||||||
import "../common/widgets"
|
import "root:/modules/common/widgets"
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import Quickshell
|
import Quickshell
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import "../common"
|
import "root:/modules/common"
|
||||||
import "../common/widgets"
|
import "root:/modules/common/widgets"
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import Quickshell.Hyprland
|
import Quickshell.Hyprland
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import "../common"
|
import "root:/modules/common"
|
||||||
import "../common/widgets"
|
import "root:/modules/common/widgets"
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import Quickshell
|
import Quickshell
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import "../common"
|
import "root:/modules/common"
|
||||||
import "../common/widgets"
|
import "root:/modules/common/widgets"
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
|
|||||||
@@ -122,6 +122,8 @@ Singleton {
|
|||||||
property color colLayer3Active: mix(colLayer3, colOnLayer3, 0.80);
|
property color colLayer3Active: mix(colLayer3, colOnLayer3, 0.80);
|
||||||
property color colPrimaryHover: mix(m3colors.m3primary, colLayer1Hover, 0.7)
|
property color colPrimaryHover: mix(m3colors.m3primary, colLayer1Hover, 0.7)
|
||||||
property color colPrimaryActive: mix(m3colors.m3primary, colLayer1Active, 0.4)
|
property color colPrimaryActive: mix(m3colors.m3primary, colLayer1Active, 0.4)
|
||||||
|
property color colTooltip: m3colors.m3inverseSurface
|
||||||
|
property color colOnTooltip: m3colors.m3inverseOnSurface
|
||||||
}
|
}
|
||||||
|
|
||||||
rounding: QtObject {
|
rounding: QtObject {
|
||||||
@@ -148,7 +150,8 @@ Singleton {
|
|||||||
property int small: 11
|
property int small: 11
|
||||||
property int normal: 12
|
property int normal: 12
|
||||||
property int large: 13
|
property int large: 13
|
||||||
property int larger: 16
|
property int larger: 14
|
||||||
|
property int huge: 16
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import QtQuick
|
|||||||
import Quickshell
|
import Quickshell
|
||||||
import Quickshell.Io
|
import Quickshell.Io
|
||||||
import Quickshell.Services.Mpris
|
import Quickshell.Services.Mpris
|
||||||
import "../.."
|
|
||||||
|
|
||||||
Singleton {
|
Singleton {
|
||||||
id: root;
|
id: root;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import "../"
|
import "root:/modules/common"
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import "../"
|
import "root:/modules/common"
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import "../"
|
import "root:/modules/common"
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
import "root:/modules/common"
|
||||||
|
import "root:/modules/common/widgets"
|
||||||
|
import QtQuick
|
||||||
|
import QtQuick.Controls
|
||||||
|
import QtQuick.Layouts
|
||||||
|
|
||||||
|
ToolTip {
|
||||||
|
property string content
|
||||||
|
parent: parent
|
||||||
|
visible: parent.hovered
|
||||||
|
padding: 7
|
||||||
|
background: Rectangle {
|
||||||
|
color: Appearance.colors.colTooltip
|
||||||
|
radius: Appearance.rounding.small
|
||||||
|
}
|
||||||
|
StyledText {
|
||||||
|
text: content
|
||||||
|
id: tooltipText
|
||||||
|
color: Appearance.colors.colOnTooltip
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
import "../common"
|
import "root:/modules/common"
|
||||||
import "../common/widgets"
|
import "root:/modules/common/widgets"
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
|
|||||||
@@ -1,19 +1,17 @@
|
|||||||
import "../common"
|
import "root:/modules/common"
|
||||||
import "../common/widgets"
|
import "root:/modules/common/widgets"
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
|
import Quickshell.Io
|
||||||
|
|
||||||
Button {
|
Button {
|
||||||
id: button
|
id: button
|
||||||
|
|
||||||
property bool toggled
|
property bool toggled
|
||||||
|
property string buttonIcon
|
||||||
signal clicked()
|
|
||||||
|
|
||||||
implicitWidth: 40
|
implicitWidth: 40
|
||||||
implicitHeight: 40
|
implicitHeight: 40
|
||||||
onClicked: {
|
|
||||||
}
|
|
||||||
|
|
||||||
background: Rectangle {
|
background: Rectangle {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
@@ -22,10 +20,26 @@ Button {
|
|||||||
(button.down ? Appearance.colors.colPrimaryActive : button.hovered ? Appearance.colors.colPrimaryHover : Appearance.m3colors.m3primary) :
|
(button.down ? Appearance.colors.colPrimaryActive : button.hovered ? Appearance.colors.colPrimaryHover : Appearance.m3colors.m3primary) :
|
||||||
(button.down ? Appearance.colors.colLayer1Active : button.hovered ? Appearance.colors.colLayer1Hover : Appearance.transparentize(Appearance.colors.colLayer1Hover, 1))
|
(button.down ? Appearance.colors.colLayer1Active : button.hovered ? Appearance.colors.colLayer1Hover : Appearance.transparentize(Appearance.colors.colLayer1Hover, 1))
|
||||||
|
|
||||||
|
Behavior on color {
|
||||||
|
ColorAnimation {
|
||||||
|
duration: Appearance.animation.elementDecel.duration
|
||||||
|
easing.type: Appearance.animation.elementDecel.type
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
MaterialSymbol {
|
MaterialSymbol {
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
text: "coffee"
|
font.pointSize: Appearance.font.pointSize.larger
|
||||||
|
text: buttonIcon
|
||||||
color: toggled ? Appearance.m3colors.m3onPrimary : Appearance.colors.colOnLayer1
|
color: toggled ? Appearance.m3colors.m3onPrimary : Appearance.colors.colOnLayer1
|
||||||
|
|
||||||
|
Behavior on color {
|
||||||
|
ColorAnimation {
|
||||||
|
duration: Appearance.animation.elementDecel.duration
|
||||||
|
easing.type: Appearance.animation.elementDecel.type
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import "../common"
|
import "root:/modules/common"
|
||||||
import "../common/widgets"
|
import "root:/modules/common/widgets"
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
@@ -92,7 +92,7 @@ Scope {
|
|||||||
Layout.fillHeight: false
|
Layout.fillHeight: false
|
||||||
spacing: 10
|
spacing: 10
|
||||||
Layout.margins: 10
|
Layout.margins: 10
|
||||||
Layout.topMargin: 10
|
Layout.bottomMargin: 5
|
||||||
|
|
||||||
CustomIcon {
|
CustomIcon {
|
||||||
width: 25
|
width: 25
|
||||||
@@ -127,15 +127,45 @@ Scope {
|
|||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.margins: 5
|
anchors.margins: 5
|
||||||
spacing: 5
|
spacing: 5
|
||||||
Rectangle {
|
|
||||||
width: 40
|
QuickToggleButton {
|
||||||
height: 40
|
property bool enabled: false
|
||||||
color: "#77000000"
|
buttonIcon: "gamepad"
|
||||||
radius: Appearance.rounding.full
|
toggled: enabled
|
||||||
|
onClicked: {
|
||||||
|
enabled = !enabled
|
||||||
|
if (enabled) {
|
||||||
|
gameModeOn.running = true
|
||||||
|
} else {
|
||||||
|
gameModeOff.running = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Process {
|
||||||
|
id: gameModeOn
|
||||||
|
command: ['bash', '-c', `hyprctl --batch "keyword animations:enabled 0; keyword decoration:shadow:enabled 0; keyword decoration:blur:enabled 0; keyword general:gaps_in 0; keyword general:gaps_out 0; keyword general:border_size 1; keyword decoration:rounding 0; keyword general:allow_tearing 1"`]
|
||||||
|
}
|
||||||
|
Process {
|
||||||
|
id: gameModeOff
|
||||||
|
command: ['bash', '-c', `hyprctl reload`]
|
||||||
|
}
|
||||||
|
StyledToolTip {
|
||||||
|
content: "Game mode"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QuickToggleButton {
|
QuickToggleButton {
|
||||||
toggled: false
|
toggled: idleInhibitor.running
|
||||||
|
buttonIcon: "coffee"
|
||||||
|
onClicked: {
|
||||||
|
idleInhibitor.running = !idleInhibitor.running
|
||||||
|
}
|
||||||
|
Process {
|
||||||
|
id: idleInhibitor
|
||||||
|
command: ["bash", "-c", "${XDG_CONFIG_HOME:-$HOME/.config}/quickshell/scripts/wayland-idle-inhibitor.py"]
|
||||||
|
}
|
||||||
|
StyledToolTip {
|
||||||
|
content: "Keep system awake"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user