mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2025-12-05 21:15:38 -05:00
Feature/control center widget fix (#912)
* Add a widget to display the power menu * Update power button widget * Upate based on new settings * Rollback to DisplaysTab.qml
This commit is contained in:
@@ -302,7 +302,8 @@ Item {
|
||||
"vpn": vpnComponent,
|
||||
"notepadButton": notepadButtonComponent,
|
||||
"colorPicker": colorPickerComponent,
|
||||
"systemUpdate": systemUpdateComponent
|
||||
"systemUpdate": systemUpdateComponent,
|
||||
"powerMenuButton": powerMenuButtonComponent
|
||||
};
|
||||
|
||||
let pluginMap = PluginService.getWidgetComponents();
|
||||
@@ -342,7 +343,8 @@ Item {
|
||||
"vpnComponent": vpnComponent,
|
||||
"notepadButtonComponent": notepadButtonComponent,
|
||||
"colorPickerComponent": colorPickerComponent,
|
||||
"systemUpdateComponent": systemUpdateComponent
|
||||
"systemUpdateComponent": systemUpdateComponent,
|
||||
"powerMenuButtonComponent": powerMenuButtonComponent
|
||||
})
|
||||
|
||||
Item {
|
||||
@@ -532,7 +534,27 @@ Item {
|
||||
section: topBarContent.getWidgetSection(parent)
|
||||
parentScreen: barWindow.screen
|
||||
onClicked: {
|
||||
clipboardHistoryModalPopup.toggle();
|
||||
clipboardHistoryModalPopup.toggle()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Component {
|
||||
id: powerMenuButtonComponent
|
||||
|
||||
PowerMenuButton {
|
||||
widgetThickness: barWindow.widgetThickness
|
||||
barThickness: barWindow.effectiveBarThickness
|
||||
axis: barWindow.axis
|
||||
section: topBarContent.getWidgetSection(parent)
|
||||
parentScreen: barWindow.screen
|
||||
onClicked: {
|
||||
if (powerMenuModalLoader) {
|
||||
powerMenuModalLoader.active = true
|
||||
if (powerMenuModalLoader.item) {
|
||||
powerMenuModalLoader.item.openCentered()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -237,7 +237,8 @@ Loader {
|
||||
"notepadButton": components.notepadButtonComponent,
|
||||
"colorPicker": components.colorPickerComponent,
|
||||
"systemUpdate": components.systemUpdateComponent,
|
||||
"layout": components.layoutComponent
|
||||
"layout": components.layoutComponent,
|
||||
"powerMenuButton": components.powerMenuButtonComponent
|
||||
};
|
||||
|
||||
if (componentMap[widgetId]) {
|
||||
|
||||
24
quickshell/Modules/DankBar/Widgets/PowerMenuButton.qml
Normal file
24
quickshell/Modules/DankBar/Widgets/PowerMenuButton.qml
Normal file
@@ -0,0 +1,24 @@
|
||||
import QtQuick
|
||||
import qs.Common
|
||||
import qs.Modules.Plugins
|
||||
import qs.Widgets
|
||||
|
||||
BasePill {
|
||||
id: root
|
||||
|
||||
property bool isActive: false
|
||||
|
||||
content: Component {
|
||||
Item {
|
||||
implicitWidth: root.widgetThickness - root.horizontalPadding * 2
|
||||
implicitHeight: root.widgetThickness - root.horizontalPadding * 2
|
||||
|
||||
DankIcon {
|
||||
anchors.centerIn: parent
|
||||
name: "power_settings_new"
|
||||
size: Theme.barIconSize(root.barThickness)
|
||||
color: Theme.widgetIconColor
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -239,7 +239,14 @@ Item {
|
||||
"description": I18n.tr("Check for system updates"),
|
||||
"icon": "update",
|
||||
"enabled": SystemUpdateService.distributionSupported
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "powerMenuButton",
|
||||
"text": I18n.tr("Power"),
|
||||
"description": I18n.tr("Display the power system menu"),
|
||||
"icon": "power_settings_new",
|
||||
"enabled": true
|
||||
},
|
||||
];
|
||||
|
||||
var allPluginVariants = PluginService.getAllPluginVariants();
|
||||
|
||||
Reference in New Issue
Block a user