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,
|
"vpn": vpnComponent,
|
||||||
"notepadButton": notepadButtonComponent,
|
"notepadButton": notepadButtonComponent,
|
||||||
"colorPicker": colorPickerComponent,
|
"colorPicker": colorPickerComponent,
|
||||||
"systemUpdate": systemUpdateComponent
|
"systemUpdate": systemUpdateComponent,
|
||||||
|
"powerMenuButton": powerMenuButtonComponent
|
||||||
};
|
};
|
||||||
|
|
||||||
let pluginMap = PluginService.getWidgetComponents();
|
let pluginMap = PluginService.getWidgetComponents();
|
||||||
@@ -342,7 +343,8 @@ Item {
|
|||||||
"vpnComponent": vpnComponent,
|
"vpnComponent": vpnComponent,
|
||||||
"notepadButtonComponent": notepadButtonComponent,
|
"notepadButtonComponent": notepadButtonComponent,
|
||||||
"colorPickerComponent": colorPickerComponent,
|
"colorPickerComponent": colorPickerComponent,
|
||||||
"systemUpdateComponent": systemUpdateComponent
|
"systemUpdateComponent": systemUpdateComponent,
|
||||||
|
"powerMenuButtonComponent": powerMenuButtonComponent
|
||||||
})
|
})
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
@@ -532,7 +534,27 @@ Item {
|
|||||||
section: topBarContent.getWidgetSection(parent)
|
section: topBarContent.getWidgetSection(parent)
|
||||||
parentScreen: barWindow.screen
|
parentScreen: barWindow.screen
|
||||||
onClicked: {
|
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,
|
"notepadButton": components.notepadButtonComponent,
|
||||||
"colorPicker": components.colorPickerComponent,
|
"colorPicker": components.colorPickerComponent,
|
||||||
"systemUpdate": components.systemUpdateComponent,
|
"systemUpdate": components.systemUpdateComponent,
|
||||||
"layout": components.layoutComponent
|
"layout": components.layoutComponent,
|
||||||
|
"powerMenuButton": components.powerMenuButtonComponent
|
||||||
};
|
};
|
||||||
|
|
||||||
if (componentMap[widgetId]) {
|
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"),
|
"description": I18n.tr("Check for system updates"),
|
||||||
"icon": "update",
|
"icon": "update",
|
||||||
"enabled": SystemUpdateService.distributionSupported
|
"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();
|
var allPluginVariants = PluginService.getAllPluginVariants();
|
||||||
|
|||||||
Reference in New Issue
Block a user