forked from Shinonome/dots-hyprland
action center: toggles barely working
This commit is contained in:
@@ -6,6 +6,7 @@ import qs.modules.waffle.looks
|
||||
Kirigami.Icon {
|
||||
id: root
|
||||
required property string icon
|
||||
property bool filled: false
|
||||
property alias monochrome: root.isMask
|
||||
// Should be 16, but it appears the icons have some padding,
|
||||
// Unlike the Windows-only Segoe UI icons, the open source FluentUI ones are hella small
|
||||
@@ -13,7 +14,7 @@ Kirigami.Icon {
|
||||
implicitWidth: implicitSize
|
||||
implicitHeight: implicitSize
|
||||
|
||||
source: `${Looks.iconsPath}/${root.icon}.svg`
|
||||
source: `${Looks.iconsPath}/${root.icon}${filled ? "-filled" : ""}.svg`
|
||||
fallback: root.icon
|
||||
roundToIconSize: false
|
||||
color: Looks.colors.fg
|
||||
|
||||
@@ -17,6 +17,12 @@ Singleton {
|
||||
|
||||
property real backgroundTransparency: 0.17
|
||||
property real contentTransparency: 0.25
|
||||
function applyBackgroundTransparency(col) {
|
||||
return ColorUtils.applyAlpha(col, 1 - root.backgroundTransparency)
|
||||
}
|
||||
function applyContentTransparency(col) {
|
||||
return ColorUtils.applyAlpha(col, 1 - root.contentTransparency)
|
||||
}
|
||||
colors: QtObject {
|
||||
id: colors
|
||||
property color ambientShadow: ColorUtils.transparentize("#000000", 0.75)
|
||||
@@ -41,8 +47,11 @@ Singleton {
|
||||
property color dangerActive: "#B62D1F"
|
||||
property color warning: "#FF9900"
|
||||
// property color accent: root.dark ? "#A5C6D8" : "#5377A3"
|
||||
property color accent: Appearance.m3colors.m3primary
|
||||
property color accent: Appearance.colors.colPrimary
|
||||
property color accentHover: Appearance.colors.colPrimaryHover
|
||||
property color accentActive: Appearance.colors.colPrimaryActive
|
||||
property color accentUnfocused: root.dark ? "#989898" : "#848484"
|
||||
property color accentFg: ColorUtils.isDark(accent) ? "#FFFFFF" : "#000000"
|
||||
}
|
||||
|
||||
radius: QtObject {
|
||||
|
||||
@@ -9,9 +9,13 @@ import qs.modules.waffle.looks
|
||||
Button {
|
||||
id: root
|
||||
|
||||
property color colBackground: ColorUtils.transparentize(Looks.colors.bg1)
|
||||
property color colBackgroundHover: Looks.colors.bg2Hover
|
||||
property color colBackgroundActive: Looks.colors.bg2Active
|
||||
property color colBackground: ColorUtils.transparentize(Looks.colors.bg1)
|
||||
property color colBackgroundToggled: Looks.colors.accent
|
||||
property color colBackgroundToggledHover: Looks.colors.accentHover
|
||||
property color colBackgroundToggledActive: Looks.colors.accentActive
|
||||
property alias backgroundOpacity: backgroundRect.opacity
|
||||
|
||||
property alias monochromeIcon: buttonIcon.monochrome
|
||||
property bool forceShowIcon: false
|
||||
@@ -24,17 +28,33 @@ Button {
|
||||
bottomInset: inset
|
||||
leftInset: inset
|
||||
rightInset: inset
|
||||
property alias radius: backgroundRect.radius
|
||||
property alias topLeftRadius: backgroundRect.topLeftRadius
|
||||
property alias topRightRadius: backgroundRect.topRightRadius
|
||||
property alias bottomLeftRadius: backgroundRect.bottomLeftRadius
|
||||
property alias bottomRightRadius: backgroundRect.bottomRightRadius
|
||||
property alias border: backgroundRect.border
|
||||
horizontalPadding: 10
|
||||
verticalPadding: 6
|
||||
implicitHeight: contentItem.implicitHeight + verticalPadding * 2
|
||||
implicitWidth: contentItem.implicitWidth + horizontalPadding * 2
|
||||
|
||||
background: Rectangle {
|
||||
id: backgroundRect
|
||||
radius: Looks.radius.medium
|
||||
color: {
|
||||
if (root.checked) {
|
||||
if (root.down) {
|
||||
return root.colBackgroundToggledActive;
|
||||
} else if (root.hovered && !root.down) {
|
||||
return root.colBackgroundToggledHover;
|
||||
} else {
|
||||
return root.colBackgroundToggled;
|
||||
}
|
||||
}
|
||||
if (root.down) {
|
||||
return root.colBackgroundActive;
|
||||
} else if ((root.hovered && !root.down) || root.checked) {
|
||||
} else if (root.hovered && !root.down) {
|
||||
return root.colBackgroundHover;
|
||||
} else {
|
||||
return root.colBackground;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
pragma Singleton
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
import Quickshell.Services.UPower
|
||||
import qs.services
|
||||
|
||||
Singleton {
|
||||
@@ -38,5 +39,24 @@ Singleton {
|
||||
if (volume < 0.5)
|
||||
return "speaker-1";
|
||||
return "speaker";
|
||||
}
|
||||
}
|
||||
|
||||
property string micIcon: {
|
||||
const muted = Audio.source?.audio.muted ?? false;
|
||||
return muted ? "mic-off" : "mic";
|
||||
}
|
||||
|
||||
property string bluetoothIcon: BluetoothStatus.connected ? "bluetooth-connected" : BluetoothStatus.enabled ? "bluetooth" : "bluetooth-disabled"
|
||||
|
||||
property string nightLightIcon: Hyprsunset.active ? "weather-moon" : "weather-moon-off"
|
||||
|
||||
property string notificationsIcon: Notifications.silent ? "alert-snooze" : "alert"
|
||||
|
||||
property string powerProfileIcon: {
|
||||
switch(PowerProfiles.profile) {
|
||||
case PowerProfile.PowerSaver: return "leaf-two";
|
||||
case PowerProfile.Balanced: return "settings-cog-multiple";
|
||||
case PowerProfile.Performance: return "fire";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user