mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-27 06:52:50 -05:00
window: add support for startSystemMove, resize, maximize to floating
windows
This commit is contained in:
@@ -202,7 +202,7 @@ Item {
|
||||
color: "transparent"
|
||||
|
||||
WlrLayershell.namespace: "quickshell:desktop-widget:" + root.pluginId + (root.instanceId ? ":" + root.instanceId : "")
|
||||
WlrLayershell.layer: WlrLayer.Bottom
|
||||
WlrLayershell.layer: root.isInteracting && !CompositorService.useHyprlandFocusGrab ? WlrLayer.Overlay : WlrLayer.Bottom
|
||||
WlrLayershell.exclusionMode: ExclusionMode.Ignore
|
||||
WlrLayershell.keyboardFocus: {
|
||||
if (!root.isInteracting)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
pragma ComponentBehavior: Bound
|
||||
pragma ComponentBehavior
|
||||
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
@@ -189,6 +189,12 @@ FloatingWindow {
|
||||
width: parent.width
|
||||
height: 48
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onPressed: windowControls.tryStartMove()
|
||||
onDoubleClicked: windowControls.tryToggleMaximize()
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
color: Theme.withAlpha(Theme.surfaceContainer, 0.5)
|
||||
@@ -216,15 +222,28 @@ FloatingWindow {
|
||||
}
|
||||
}
|
||||
|
||||
DankActionButton {
|
||||
circular: false
|
||||
iconName: "close"
|
||||
iconSize: Theme.iconSize - 4
|
||||
iconColor: Theme.surfaceText
|
||||
Row {
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: Theme.spacingM
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
onClicked: root.hide()
|
||||
spacing: Theme.spacingXS
|
||||
|
||||
DankActionButton {
|
||||
visible: windowControls.supported
|
||||
circular: false
|
||||
iconName: root.maximized ? "fullscreen_exit" : "fullscreen"
|
||||
iconSize: Theme.iconSize - 4
|
||||
iconColor: Theme.surfaceText
|
||||
onClicked: windowControls.tryToggleMaximize()
|
||||
}
|
||||
|
||||
DankActionButton {
|
||||
circular: false
|
||||
iconName: "close"
|
||||
iconSize: Theme.iconSize - 4
|
||||
iconColor: Theme.surfaceText
|
||||
onClicked: root.hide()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -414,4 +433,9 @@ FloatingWindow {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
FloatingWindowControls {
|
||||
id: windowControls
|
||||
targetWindow: root
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,6 @@ FloatingWindow {
|
||||
|
||||
if (!SessionData.showThirdPartyPlugins && !isFirstParty)
|
||||
continue;
|
||||
|
||||
if (typeFilter !== "") {
|
||||
var hasCapability = plugin.capabilities && plugin.capabilities.includes(typeFilter);
|
||||
if (!hasCapability)
|
||||
@@ -108,12 +107,12 @@ FloatingWindow {
|
||||
var pluginId = PopoutService.pendingPluginInstall;
|
||||
PopoutService.pendingPluginInstall = "";
|
||||
urlInstallConfirm.showWithOptions({
|
||||
title: I18n.tr("Install Plugin", "plugin installation dialog title"),
|
||||
message: I18n.tr("Install plugin '%1' from the DMS registry?", "plugin installation confirmation").arg(pluginId),
|
||||
confirmText: I18n.tr("Install", "install action button"),
|
||||
cancelText: I18n.tr("Cancel"),
|
||||
onConfirm: () => installPlugin(pluginId, true),
|
||||
onCancel: () => hide()
|
||||
"title": I18n.tr("Install Plugin", "plugin installation dialog title"),
|
||||
"message": I18n.tr("Install plugin '%1' from the DMS registry?", "plugin installation confirmation").arg(pluginId),
|
||||
"confirmText": I18n.tr("Install", "install action button"),
|
||||
"cancelText": I18n.tr("Cancel"),
|
||||
"onConfirm": () => installPlugin(pluginId, true),
|
||||
"onCancel": () => hide()
|
||||
});
|
||||
}
|
||||
|
||||
@@ -181,7 +180,9 @@ FloatingWindow {
|
||||
}
|
||||
var updated = root.allPlugins.map(p => {
|
||||
var isInstalled = pluginMap[p.name] || pluginMap[p.id] || false;
|
||||
return Object.assign({}, p, { installed: isInstalled });
|
||||
return Object.assign({}, p, {
|
||||
"installed": isInstalled
|
||||
});
|
||||
});
|
||||
root.allPlugins = updated;
|
||||
root.updateFilteredPlugins();
|
||||
@@ -227,6 +228,12 @@ FloatingWindow {
|
||||
anchors.top: parent.top
|
||||
height: Math.max(headerIcon.height, headerText.height, refreshButton.height, closeButton.height)
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onPressed: windowControls.tryStartMove()
|
||||
onDoubleClicked: windowControls.tryToggleMaximize()
|
||||
}
|
||||
|
||||
DankIcon {
|
||||
id: headerIcon
|
||||
name: "store"
|
||||
@@ -276,6 +283,14 @@ FloatingWindow {
|
||||
onClicked: root.refreshPlugins()
|
||||
}
|
||||
|
||||
DankActionButton {
|
||||
visible: windowControls.supported
|
||||
iconName: root.maximized ? "fullscreen_exit" : "fullscreen"
|
||||
iconSize: Theme.iconSize - 2
|
||||
iconColor: Theme.outline
|
||||
onClicked: windowControls.tryToggleMaximize()
|
||||
}
|
||||
|
||||
DankActionButton {
|
||||
id: closeButton
|
||||
iconName: "close"
|
||||
@@ -718,4 +733,9 @@ FloatingWindow {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
FloatingWindowControls {
|
||||
id: windowControls
|
||||
targetWindow: root
|
||||
}
|
||||
}
|
||||
|
||||
@@ -114,12 +114,12 @@ FloatingWindow {
|
||||
var themeId = PopoutService.pendingThemeInstall;
|
||||
PopoutService.pendingThemeInstall = "";
|
||||
urlInstallConfirm.showWithOptions({
|
||||
title: I18n.tr("Install Theme", "theme installation dialog title"),
|
||||
message: I18n.tr("Install theme '%1' from the DMS registry?", "theme installation confirmation").arg(themeId),
|
||||
confirmText: I18n.tr("Install", "install action button"),
|
||||
cancelText: I18n.tr("Cancel"),
|
||||
onConfirm: () => installTheme(themeId, themeId, true),
|
||||
onCancel: () => hide()
|
||||
"title": I18n.tr("Install Theme", "theme installation dialog title"),
|
||||
"message": I18n.tr("Install theme '%1' from the DMS registry?", "theme installation confirmation").arg(themeId),
|
||||
"confirmText": I18n.tr("Install", "install action button"),
|
||||
"cancelText": I18n.tr("Cancel"),
|
||||
"onConfirm": () => installTheme(themeId, themeId, true),
|
||||
"onCancel": () => hide()
|
||||
});
|
||||
}
|
||||
|
||||
@@ -222,6 +222,12 @@ FloatingWindow {
|
||||
anchors.top: parent.top
|
||||
height: Math.max(headerIcon.height, headerText.height, refreshButton.height, closeButton.height)
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onPressed: windowControls.tryStartMove()
|
||||
onDoubleClicked: windowControls.tryToggleMaximize()
|
||||
}
|
||||
|
||||
DankIcon {
|
||||
id: headerIcon
|
||||
name: "palette"
|
||||
@@ -256,6 +262,14 @@ FloatingWindow {
|
||||
onClicked: root.refreshThemes()
|
||||
}
|
||||
|
||||
DankActionButton {
|
||||
visible: windowControls.supported
|
||||
iconName: root.maximized ? "fullscreen_exit" : "fullscreen"
|
||||
iconSize: Theme.iconSize - 2
|
||||
iconColor: Theme.outline
|
||||
onClicked: windowControls.tryToggleMaximize()
|
||||
}
|
||||
|
||||
DankActionButton {
|
||||
id: closeButton
|
||||
iconName: "close"
|
||||
@@ -569,4 +583,9 @@ FloatingWindow {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
FloatingWindowControls {
|
||||
id: windowControls
|
||||
targetWindow: root
|
||||
}
|
||||
}
|
||||
|
||||
@@ -175,6 +175,12 @@ FloatingWindow {
|
||||
width: parent.width
|
||||
height: 48
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onPressed: windowControls.tryStartMove()
|
||||
onDoubleClicked: windowControls.tryToggleMaximize()
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
color: Theme.surfaceContainer
|
||||
@@ -203,15 +209,28 @@ FloatingWindow {
|
||||
}
|
||||
}
|
||||
|
||||
DankActionButton {
|
||||
circular: false
|
||||
iconName: "close"
|
||||
iconSize: Theme.iconSize - 4
|
||||
iconColor: Theme.surfaceText
|
||||
Row {
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: Theme.spacingM
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
onClicked: root.hide()
|
||||
spacing: Theme.spacingXS
|
||||
|
||||
DankActionButton {
|
||||
visible: windowControls.supported
|
||||
circular: false
|
||||
iconName: root.maximized ? "fullscreen_exit" : "fullscreen"
|
||||
iconSize: Theme.iconSize - 4
|
||||
iconColor: Theme.surfaceText
|
||||
onClicked: windowControls.tryToggleMaximize()
|
||||
}
|
||||
|
||||
DankActionButton {
|
||||
circular: false
|
||||
iconName: "close"
|
||||
iconSize: Theme.iconSize - 4
|
||||
iconColor: Theme.surfaceText
|
||||
onClicked: root.hide()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -354,4 +373,9 @@ FloatingWindow {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
FloatingWindowControls {
|
||||
id: windowControls
|
||||
targetWindow: root
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user