mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-10-21 18:54:01 -04:00
feat(bar): add support for fractional sizes, fit to contents
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
import qs.Common
|
||||
import qs.Services
|
||||
import qs.Widgets
|
||||
@@ -17,13 +16,13 @@ PluginComponent {
|
||||
ccWidgetIsActive: isEnabled
|
||||
|
||||
onCcWidgetToggled: {
|
||||
isEnabled = !isEnabled
|
||||
clickCount += 1
|
||||
isEnabled = !isEnabled;
|
||||
clickCount += 1;
|
||||
if (pluginService) {
|
||||
pluginService.savePluginData("controlCenterExample", "isEnabled", isEnabled)
|
||||
pluginService.savePluginData("controlCenterExample", "clickCount", clickCount)
|
||||
pluginService.savePluginData("controlCenterExample", "isEnabled", isEnabled);
|
||||
pluginService.savePluginData("controlCenterExample", "clickCount", clickCount);
|
||||
}
|
||||
ToastService.showInfo("Example Toggle", isEnabled ? "Activated!" : "Deactivated!")
|
||||
ToastService.showInfo("Example Toggle", isEnabled ? "Activated!" : "Deactivated!");
|
||||
}
|
||||
|
||||
horizontalBarPill: Component {
|
||||
@@ -33,14 +32,14 @@ PluginComponent {
|
||||
DankIcon {
|
||||
name: root.isEnabled ? "toggle_on" : "toggle_off"
|
||||
color: root.isEnabled ? Theme.primary : Theme.surfaceVariantText
|
||||
font.pixelSize: Theme.iconSize - 4
|
||||
size: root.iconSize
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
StyledText {
|
||||
text: `${root.clickCount}`
|
||||
color: root.isEnabled ? Theme.primary : Theme.surfaceVariantText
|
||||
font.pixelSize: Theme.fontSizeMedium
|
||||
font.pixelSize: root.textSize
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
}
|
||||
@@ -53,14 +52,14 @@ PluginComponent {
|
||||
DankIcon {
|
||||
name: root.isEnabled ? "toggle_on" : "toggle_off"
|
||||
color: root.isEnabled ? Theme.primary : Theme.surfaceVariantText
|
||||
font.pixelSize: Theme.iconSize - 4
|
||||
size: root.iconSize
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
}
|
||||
|
||||
StyledText {
|
||||
text: `${root.clickCount}`
|
||||
color: root.isEnabled ? Theme.primary : Theme.surfaceVariantText
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
font.pixelSize: root.textSize
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user