mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-04-15 10:12:07 -04:00
window: add support for startSystemMove, resize, maximize to floating
windows
This commit is contained in:
@@ -47,6 +47,7 @@ FocusScope {
|
|||||||
property int actualGridColumns: 5
|
property int actualGridColumns: 5
|
||||||
property bool _initialized: false
|
property bool _initialized: false
|
||||||
property bool closeOnEscape: true
|
property bool closeOnEscape: true
|
||||||
|
property var windowControls: null
|
||||||
|
|
||||||
signal fileSelected(string path)
|
signal fileSelected(string path)
|
||||||
signal closeRequested
|
signal closeRequested
|
||||||
@@ -155,7 +156,6 @@ FocusScope {
|
|||||||
const lastSlash = path.lastIndexOf('/');
|
const lastSlash = path.lastIndexOf('/');
|
||||||
if (lastSlash <= 0)
|
if (lastSlash <= 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const newPath = path.substring(0, lastSlash);
|
const newPath = path.substring(0, lastSlash);
|
||||||
if (newPath.length < homeDir.length) {
|
if (newPath.length < homeDir.length) {
|
||||||
currentPath = homeDir;
|
currentPath = homeDir;
|
||||||
@@ -534,6 +534,14 @@ FocusScope {
|
|||||||
width: parent.width
|
width: parent.width
|
||||||
height: 48
|
height: 48
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
anchors.fill: parent
|
||||||
|
onPressed: if (windowControls)
|
||||||
|
windowControls.tryStartMove()
|
||||||
|
onDoubleClicked: if (windowControls)
|
||||||
|
windowControls.tryToggleMaximize()
|
||||||
|
}
|
||||||
|
|
||||||
Row {
|
Row {
|
||||||
spacing: Theme.spacingM
|
spacing: Theme.spacingM
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
@@ -595,6 +603,16 @@ FocusScope {
|
|||||||
onClicked: root.showKeyboardHints = !root.showKeyboardHints
|
onClicked: root.showKeyboardHints = !root.showKeyboardHints
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DankActionButton {
|
||||||
|
visible: windowControls?.supported ?? false
|
||||||
|
circular: false
|
||||||
|
iconName: windowControls?.targetWindow?.maximized ? "fullscreen_exit" : "fullscreen"
|
||||||
|
iconSize: Theme.iconSize - 4
|
||||||
|
iconColor: Theme.surfaceText
|
||||||
|
onClicked: if (windowControls)
|
||||||
|
windowControls.tryToggleMaximize()
|
||||||
|
}
|
||||||
|
|
||||||
DankActionButton {
|
DankActionButton {
|
||||||
circular: false
|
circular: false
|
||||||
iconName: "close"
|
iconName: "close"
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
import Quickshell
|
import Quickshell
|
||||||
import qs.Common
|
import qs.Common
|
||||||
|
import qs.Widgets
|
||||||
|
|
||||||
FloatingWindow {
|
FloatingWindow {
|
||||||
id: fileBrowserModal
|
id: fileBrowserModal
|
||||||
@@ -60,6 +61,7 @@ FloatingWindow {
|
|||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
focus: true
|
focus: true
|
||||||
closeOnEscape: false
|
closeOnEscape: false
|
||||||
|
windowControls: windowControls
|
||||||
|
|
||||||
browserTitle: fileBrowserModal.browserTitle
|
browserTitle: fileBrowserModal.browserTitle
|
||||||
browserIcon: fileBrowserModal.browserIcon
|
browserIcon: fileBrowserModal.browserIcon
|
||||||
@@ -74,4 +76,9 @@ FloatingWindow {
|
|||||||
onFileSelected: path => fileBrowserModal.fileSelected(path)
|
onFileSelected: path => fileBrowserModal.fileSelected(path)
|
||||||
onCloseRequested: fileBrowserModal.close()
|
onCloseRequested: fileBrowserModal.close()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FloatingWindowControls {
|
||||||
|
id: windowControls
|
||||||
|
targetWindow: fileBrowserModal
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -107,6 +107,15 @@ FloatingWindow {
|
|||||||
event.accepted = true;
|
event.accepted = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.right: parent.right
|
||||||
|
anchors.top: parent.top
|
||||||
|
height: headerRow.height + Theme.spacingM
|
||||||
|
onPressed: windowControls.tryStartMove()
|
||||||
|
onDoubleClicked: windowControls.tryToggleMaximize()
|
||||||
|
}
|
||||||
|
|
||||||
Row {
|
Row {
|
||||||
id: headerRow
|
id: headerRow
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
@@ -117,7 +126,7 @@ FloatingWindow {
|
|||||||
anchors.topMargin: Theme.spacingM
|
anchors.topMargin: Theme.spacingM
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
width: parent.width - 40
|
width: parent.width - 60
|
||||||
spacing: Theme.spacingXS
|
spacing: Theme.spacingXS
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
@@ -151,6 +160,17 @@ FloatingWindow {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Row {
|
||||||
|
spacing: Theme.spacingXS
|
||||||
|
|
||||||
|
DankActionButton {
|
||||||
|
visible: windowControls.supported
|
||||||
|
iconName: root.maximized ? "fullscreen_exit" : "fullscreen"
|
||||||
|
iconSize: Theme.iconSize - 4
|
||||||
|
iconColor: Theme.surfaceText
|
||||||
|
onClicked: windowControls.tryToggleMaximize()
|
||||||
|
}
|
||||||
|
|
||||||
DankActionButton {
|
DankActionButton {
|
||||||
iconName: "close"
|
iconName: "close"
|
||||||
iconSize: Theme.iconSize - 4
|
iconSize: Theme.iconSize - 4
|
||||||
@@ -160,6 +180,7 @@ FloatingWindow {
|
|||||||
onClicked: cancelAuth()
|
onClicked: cancelAuth()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
id: mainColumn
|
id: mainColumn
|
||||||
@@ -314,4 +335,9 @@ FloatingWindow {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FloatingWindowControls {
|
||||||
|
id: windowControls
|
||||||
|
targetWindow: root
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -171,26 +171,56 @@ FloatingWindow {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ColumnLayout {
|
Column {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.margins: Theme.spacingL
|
spacing: 0
|
||||||
spacing: Theme.spacingL
|
|
||||||
visible: DgopService.dgopAvailable
|
visible: DgopService.dgopAvailable
|
||||||
|
|
||||||
RowLayout {
|
Item {
|
||||||
Layout.fillWidth: true
|
width: parent.width
|
||||||
height: 40
|
height: 48
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
anchors.fill: parent
|
||||||
|
onPressed: windowControls.tryStartMove()
|
||||||
|
onDoubleClicked: windowControls.tryToggleMaximize()
|
||||||
|
}
|
||||||
|
|
||||||
|
Row {
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.leftMargin: Theme.spacingL
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
spacing: Theme.spacingM
|
||||||
|
|
||||||
|
DankIcon {
|
||||||
|
name: "analytics"
|
||||||
|
size: Theme.iconSize
|
||||||
|
color: Theme.primary
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
}
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: I18n.tr("System Monitor")
|
text: I18n.tr("System Monitor")
|
||||||
font.pixelSize: Theme.fontSizeLarge + 4
|
font.pixelSize: Theme.fontSizeXLarge
|
||||||
font.weight: Font.Bold
|
font.weight: Font.Medium
|
||||||
color: Theme.surfaceText
|
color: Theme.surfaceText
|
||||||
Layout.alignment: Qt.AlignVCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Item {
|
Row {
|
||||||
Layout.fillWidth: true
|
anchors.right: parent.right
|
||||||
|
anchors.rightMargin: Theme.spacingM
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
spacing: Theme.spacingXS
|
||||||
|
|
||||||
|
DankActionButton {
|
||||||
|
visible: windowControls.supported
|
||||||
|
circular: false
|
||||||
|
iconName: processListModal.maximized ? "fullscreen_exit" : "fullscreen"
|
||||||
|
iconSize: Theme.iconSize - 4
|
||||||
|
iconColor: Theme.surfaceText
|
||||||
|
onClicked: windowControls.tryToggleMaximize()
|
||||||
}
|
}
|
||||||
|
|
||||||
DankActionButton {
|
DankActionButton {
|
||||||
@@ -198,12 +228,22 @@ FloatingWindow {
|
|||||||
iconName: "close"
|
iconName: "close"
|
||||||
iconSize: Theme.iconSize - 4
|
iconSize: Theme.iconSize - 4
|
||||||
iconColor: Theme.surfaceText
|
iconColor: Theme.surfaceText
|
||||||
onClicked: () => {
|
onClicked: processListModal.hide()
|
||||||
processListModal.hide();
|
|
||||||
}
|
|
||||||
Layout.alignment: Qt.AlignVCenter
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Item {
|
||||||
|
width: parent.width
|
||||||
|
height: parent.height - 48
|
||||||
|
|
||||||
|
ColumnLayout {
|
||||||
|
anchors.fill: parent
|
||||||
|
anchors.leftMargin: Theme.spacingL
|
||||||
|
anchors.rightMargin: Theme.spacingL
|
||||||
|
anchors.bottomMargin: Theme.spacingL
|
||||||
|
anchors.topMargin: 0
|
||||||
|
spacing: Theme.spacingL
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
@@ -357,4 +397,11 @@ FloatingWindow {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FloatingWindowControls {
|
||||||
|
id: windowControls
|
||||||
|
targetWindow: processListModal
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -163,6 +163,12 @@ FloatingWindow {
|
|||||||
height: 48
|
height: 48
|
||||||
z: 10
|
z: 10
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
anchors.fill: parent
|
||||||
|
onPressed: windowControls.tryStartMove()
|
||||||
|
onDoubleClicked: windowControls.tryToggleMaximize()
|
||||||
|
}
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
color: Theme.surfaceContainer
|
color: Theme.surfaceContainer
|
||||||
@@ -203,17 +209,28 @@ FloatingWindow {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DankActionButton {
|
Row {
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.rightMargin: Theme.spacingM
|
anchors.rightMargin: Theme.spacingM
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.topMargin: Theme.spacingM
|
anchors.topMargin: Theme.spacingM
|
||||||
|
spacing: Theme.spacingXS
|
||||||
|
|
||||||
|
DankActionButton {
|
||||||
|
visible: windowControls.supported
|
||||||
|
circular: false
|
||||||
|
iconName: settingsModal.maximized ? "fullscreen_exit" : "fullscreen"
|
||||||
|
iconSize: Theme.iconSize - 4
|
||||||
|
iconColor: Theme.surfaceText
|
||||||
|
onClicked: windowControls.tryToggleMaximize()
|
||||||
|
}
|
||||||
|
|
||||||
|
DankActionButton {
|
||||||
circular: false
|
circular: false
|
||||||
iconName: "close"
|
iconName: "close"
|
||||||
iconSize: Theme.iconSize - 4
|
iconSize: Theme.iconSize - 4
|
||||||
iconColor: Theme.surfaceText
|
iconColor: Theme.surfaceText
|
||||||
onClicked: () => {
|
onClicked: settingsModal.hide()
|
||||||
settingsModal.hide();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -257,4 +274,9 @@ FloatingWindow {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FloatingWindowControls {
|
||||||
|
id: windowControls
|
||||||
|
targetWindow: settingsModal
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -208,7 +208,7 @@ FloatingWindow {
|
|||||||
usernameInput.text = "";
|
usernameInput.text = "";
|
||||||
anonInput.text = "";
|
anonInput.text = "";
|
||||||
domainMatchInput.text = "";
|
domainMatchInput.text = "";
|
||||||
for (let i = 0; i < dynamicFieldsRepeater.count; i++) {
|
for (var i = 0; i < dynamicFieldsRepeater.count; i++) {
|
||||||
const item = dynamicFieldsRepeater.itemAt(i);
|
const item = dynamicFieldsRepeater.itemAt(i);
|
||||||
if (item?.children[0])
|
if (item?.children[0])
|
||||||
item.children[0].text = "";
|
item.children[0].text = "";
|
||||||
@@ -248,8 +248,15 @@ FloatingWindow {
|
|||||||
Row {
|
Row {
|
||||||
width: contentCol.width
|
width: contentCol.width
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
width: parent.width - 60
|
||||||
|
height: headerCol.height
|
||||||
|
onPressed: windowControls.tryStartMove()
|
||||||
|
onDoubleClicked: windowControls.tryToggleMaximize()
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
width: parent.width - 40
|
id: headerCol
|
||||||
|
width: parent.width
|
||||||
spacing: Theme.spacingXS
|
spacing: Theme.spacingXS
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
@@ -287,6 +294,18 @@ FloatingWindow {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Row {
|
||||||
|
spacing: Theme.spacingXS
|
||||||
|
|
||||||
|
DankActionButton {
|
||||||
|
visible: windowControls.supported
|
||||||
|
iconName: root.maximized ? "fullscreen_exit" : "fullscreen"
|
||||||
|
iconSize: Theme.iconSize - 4
|
||||||
|
iconColor: Theme.surfaceText
|
||||||
|
onClicked: windowControls.tryToggleMaximize()
|
||||||
|
}
|
||||||
|
|
||||||
DankActionButton {
|
DankActionButton {
|
||||||
iconName: "close"
|
iconName: "close"
|
||||||
@@ -295,6 +314,7 @@ FloatingWindow {
|
|||||||
onClicked: clearAndClose()
|
onClicked: clearAndClose()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Repeater {
|
Repeater {
|
||||||
id: dynamicFieldsRepeater
|
id: dynamicFieldsRepeater
|
||||||
@@ -624,7 +644,7 @@ FloatingWindow {
|
|||||||
color: connectArea.containsMouse ? Qt.darker(Theme.primary, 1.1) : Theme.primary
|
color: connectArea.containsMouse ? Qt.darker(Theme.primary, 1.1) : Theme.primary
|
||||||
enabled: {
|
enabled: {
|
||||||
if (fieldsInfo.length > 0) {
|
if (fieldsInfo.length > 0) {
|
||||||
for (let i = 0; i < fieldsInfo.length; i++) {
|
for (var i = 0; i < fieldsInfo.length; i++) {
|
||||||
if (!fieldsInfo[i].isSecret)
|
if (!fieldsInfo[i].isSecret)
|
||||||
continue;
|
continue;
|
||||||
const fieldName = fieldsInfo[i].name;
|
const fieldName = fieldsInfo[i].name;
|
||||||
@@ -668,4 +688,9 @@ FloatingWindow {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FloatingWindowControls {
|
||||||
|
id: windowControls
|
||||||
|
targetWindow: root
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -202,7 +202,7 @@ Item {
|
|||||||
color: "transparent"
|
color: "transparent"
|
||||||
|
|
||||||
WlrLayershell.namespace: "quickshell:desktop-widget:" + root.pluginId + (root.instanceId ? ":" + root.instanceId : "")
|
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.exclusionMode: ExclusionMode.Ignore
|
||||||
WlrLayershell.keyboardFocus: {
|
WlrLayershell.keyboardFocus: {
|
||||||
if (!root.isInteracting)
|
if (!root.isInteracting)
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
pragma ComponentBehavior: Bound
|
pragma ComponentBehavior
|
||||||
|
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import Quickshell
|
import Quickshell
|
||||||
@@ -189,6 +189,12 @@ FloatingWindow {
|
|||||||
width: parent.width
|
width: parent.width
|
||||||
height: 48
|
height: 48
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
anchors.fill: parent
|
||||||
|
onPressed: windowControls.tryStartMove()
|
||||||
|
onDoubleClicked: windowControls.tryToggleMaximize()
|
||||||
|
}
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
color: Theme.withAlpha(Theme.surfaceContainer, 0.5)
|
color: Theme.withAlpha(Theme.surfaceContainer, 0.5)
|
||||||
@@ -216,17 +222,30 @@ FloatingWindow {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Row {
|
||||||
|
anchors.right: parent.right
|
||||||
|
anchors.rightMargin: Theme.spacingM
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
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 {
|
DankActionButton {
|
||||||
circular: false
|
circular: false
|
||||||
iconName: "close"
|
iconName: "close"
|
||||||
iconSize: Theme.iconSize - 4
|
iconSize: Theme.iconSize - 4
|
||||||
iconColor: Theme.surfaceText
|
iconColor: Theme.surfaceText
|
||||||
anchors.right: parent.right
|
|
||||||
anchors.rightMargin: Theme.spacingM
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
onClicked: root.hide()
|
onClicked: root.hide()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
width: parent.width
|
width: parent.width
|
||||||
@@ -414,4 +433,9 @@ FloatingWindow {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FloatingWindowControls {
|
||||||
|
id: windowControls
|
||||||
|
targetWindow: root
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,7 +29,6 @@ FloatingWindow {
|
|||||||
|
|
||||||
if (!SessionData.showThirdPartyPlugins && !isFirstParty)
|
if (!SessionData.showThirdPartyPlugins && !isFirstParty)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (typeFilter !== "") {
|
if (typeFilter !== "") {
|
||||||
var hasCapability = plugin.capabilities && plugin.capabilities.includes(typeFilter);
|
var hasCapability = plugin.capabilities && plugin.capabilities.includes(typeFilter);
|
||||||
if (!hasCapability)
|
if (!hasCapability)
|
||||||
@@ -108,12 +107,12 @@ FloatingWindow {
|
|||||||
var pluginId = PopoutService.pendingPluginInstall;
|
var pluginId = PopoutService.pendingPluginInstall;
|
||||||
PopoutService.pendingPluginInstall = "";
|
PopoutService.pendingPluginInstall = "";
|
||||||
urlInstallConfirm.showWithOptions({
|
urlInstallConfirm.showWithOptions({
|
||||||
title: I18n.tr("Install Plugin", "plugin installation dialog title"),
|
"title": I18n.tr("Install Plugin", "plugin installation dialog title"),
|
||||||
message: I18n.tr("Install plugin '%1' from the DMS registry?", "plugin installation confirmation").arg(pluginId),
|
"message": I18n.tr("Install plugin '%1' from the DMS registry?", "plugin installation confirmation").arg(pluginId),
|
||||||
confirmText: I18n.tr("Install", "install action button"),
|
"confirmText": I18n.tr("Install", "install action button"),
|
||||||
cancelText: I18n.tr("Cancel"),
|
"cancelText": I18n.tr("Cancel"),
|
||||||
onConfirm: () => installPlugin(pluginId, true),
|
"onConfirm": () => installPlugin(pluginId, true),
|
||||||
onCancel: () => hide()
|
"onCancel": () => hide()
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -181,7 +180,9 @@ FloatingWindow {
|
|||||||
}
|
}
|
||||||
var updated = root.allPlugins.map(p => {
|
var updated = root.allPlugins.map(p => {
|
||||||
var isInstalled = pluginMap[p.name] || pluginMap[p.id] || false;
|
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.allPlugins = updated;
|
||||||
root.updateFilteredPlugins();
|
root.updateFilteredPlugins();
|
||||||
@@ -227,6 +228,12 @@ FloatingWindow {
|
|||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
height: Math.max(headerIcon.height, headerText.height, refreshButton.height, closeButton.height)
|
height: Math.max(headerIcon.height, headerText.height, refreshButton.height, closeButton.height)
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
anchors.fill: parent
|
||||||
|
onPressed: windowControls.tryStartMove()
|
||||||
|
onDoubleClicked: windowControls.tryToggleMaximize()
|
||||||
|
}
|
||||||
|
|
||||||
DankIcon {
|
DankIcon {
|
||||||
id: headerIcon
|
id: headerIcon
|
||||||
name: "store"
|
name: "store"
|
||||||
@@ -276,6 +283,14 @@ FloatingWindow {
|
|||||||
onClicked: root.refreshPlugins()
|
onClicked: root.refreshPlugins()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DankActionButton {
|
||||||
|
visible: windowControls.supported
|
||||||
|
iconName: root.maximized ? "fullscreen_exit" : "fullscreen"
|
||||||
|
iconSize: Theme.iconSize - 2
|
||||||
|
iconColor: Theme.outline
|
||||||
|
onClicked: windowControls.tryToggleMaximize()
|
||||||
|
}
|
||||||
|
|
||||||
DankActionButton {
|
DankActionButton {
|
||||||
id: closeButton
|
id: closeButton
|
||||||
iconName: "close"
|
iconName: "close"
|
||||||
@@ -718,4 +733,9 @@ FloatingWindow {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FloatingWindowControls {
|
||||||
|
id: windowControls
|
||||||
|
targetWindow: root
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -114,12 +114,12 @@ FloatingWindow {
|
|||||||
var themeId = PopoutService.pendingThemeInstall;
|
var themeId = PopoutService.pendingThemeInstall;
|
||||||
PopoutService.pendingThemeInstall = "";
|
PopoutService.pendingThemeInstall = "";
|
||||||
urlInstallConfirm.showWithOptions({
|
urlInstallConfirm.showWithOptions({
|
||||||
title: I18n.tr("Install Theme", "theme installation dialog title"),
|
"title": I18n.tr("Install Theme", "theme installation dialog title"),
|
||||||
message: I18n.tr("Install theme '%1' from the DMS registry?", "theme installation confirmation").arg(themeId),
|
"message": I18n.tr("Install theme '%1' from the DMS registry?", "theme installation confirmation").arg(themeId),
|
||||||
confirmText: I18n.tr("Install", "install action button"),
|
"confirmText": I18n.tr("Install", "install action button"),
|
||||||
cancelText: I18n.tr("Cancel"),
|
"cancelText": I18n.tr("Cancel"),
|
||||||
onConfirm: () => installTheme(themeId, themeId, true),
|
"onConfirm": () => installTheme(themeId, themeId, true),
|
||||||
onCancel: () => hide()
|
"onCancel": () => hide()
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -222,6 +222,12 @@ FloatingWindow {
|
|||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
height: Math.max(headerIcon.height, headerText.height, refreshButton.height, closeButton.height)
|
height: Math.max(headerIcon.height, headerText.height, refreshButton.height, closeButton.height)
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
anchors.fill: parent
|
||||||
|
onPressed: windowControls.tryStartMove()
|
||||||
|
onDoubleClicked: windowControls.tryToggleMaximize()
|
||||||
|
}
|
||||||
|
|
||||||
DankIcon {
|
DankIcon {
|
||||||
id: headerIcon
|
id: headerIcon
|
||||||
name: "palette"
|
name: "palette"
|
||||||
@@ -256,6 +262,14 @@ FloatingWindow {
|
|||||||
onClicked: root.refreshThemes()
|
onClicked: root.refreshThemes()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DankActionButton {
|
||||||
|
visible: windowControls.supported
|
||||||
|
iconName: root.maximized ? "fullscreen_exit" : "fullscreen"
|
||||||
|
iconSize: Theme.iconSize - 2
|
||||||
|
iconColor: Theme.outline
|
||||||
|
onClicked: windowControls.tryToggleMaximize()
|
||||||
|
}
|
||||||
|
|
||||||
DankActionButton {
|
DankActionButton {
|
||||||
id: closeButton
|
id: closeButton
|
||||||
iconName: "close"
|
iconName: "close"
|
||||||
@@ -569,4 +583,9 @@ FloatingWindow {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FloatingWindowControls {
|
||||||
|
id: windowControls
|
||||||
|
targetWindow: root
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -175,6 +175,12 @@ FloatingWindow {
|
|||||||
width: parent.width
|
width: parent.width
|
||||||
height: 48
|
height: 48
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
anchors.fill: parent
|
||||||
|
onPressed: windowControls.tryStartMove()
|
||||||
|
onDoubleClicked: windowControls.tryToggleMaximize()
|
||||||
|
}
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
color: Theme.surfaceContainer
|
color: Theme.surfaceContainer
|
||||||
@@ -203,17 +209,30 @@ FloatingWindow {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Row {
|
||||||
|
anchors.right: parent.right
|
||||||
|
anchors.rightMargin: Theme.spacingM
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
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 {
|
DankActionButton {
|
||||||
circular: false
|
circular: false
|
||||||
iconName: "close"
|
iconName: "close"
|
||||||
iconSize: Theme.iconSize - 4
|
iconSize: Theme.iconSize - 4
|
||||||
iconColor: Theme.surfaceText
|
iconColor: Theme.surfaceText
|
||||||
anchors.right: parent.right
|
|
||||||
anchors.rightMargin: Theme.spacingM
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
onClicked: root.hide()
|
onClicked: root.hide()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
width: parent.width
|
width: parent.width
|
||||||
@@ -354,4 +373,9 @@ FloatingWindow {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FloatingWindowControls {
|
||||||
|
id: windowControls
|
||||||
|
targetWindow: root
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
116
quickshell/Widgets/FloatingWindowControls.qml
Normal file
116
quickshell/Widgets/FloatingWindowControls.qml
Normal file
@@ -0,0 +1,116 @@
|
|||||||
|
import QtQuick
|
||||||
|
|
||||||
|
Item {
|
||||||
|
id: root
|
||||||
|
|
||||||
|
required property var targetWindow
|
||||||
|
property bool supported: typeof targetWindow.startSystemMove === "function"
|
||||||
|
|
||||||
|
anchors.fill: parent
|
||||||
|
|
||||||
|
function tryStartMove() {
|
||||||
|
if (!supported)
|
||||||
|
return;
|
||||||
|
targetWindow.startSystemMove();
|
||||||
|
}
|
||||||
|
|
||||||
|
function tryStartResize(edges) {
|
||||||
|
if (!supported)
|
||||||
|
return;
|
||||||
|
targetWindow.startSystemResize(edges);
|
||||||
|
}
|
||||||
|
|
||||||
|
function tryToggleMaximize() {
|
||||||
|
if (!supported)
|
||||||
|
return;
|
||||||
|
targetWindow.maximized = !targetWindow.maximized;
|
||||||
|
}
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
visible: root.supported
|
||||||
|
height: 6
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.right: parent.right
|
||||||
|
anchors.top: parent.top
|
||||||
|
anchors.leftMargin: 6
|
||||||
|
anchors.rightMargin: 6
|
||||||
|
cursorShape: Qt.SizeVerCursor
|
||||||
|
onPressed: root.tryStartResize(Qt.TopEdge)
|
||||||
|
}
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
visible: root.supported
|
||||||
|
width: 6
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.top: parent.top
|
||||||
|
anchors.bottom: parent.bottom
|
||||||
|
anchors.topMargin: 6
|
||||||
|
anchors.bottomMargin: 6
|
||||||
|
cursorShape: Qt.SizeHorCursor
|
||||||
|
onPressed: root.tryStartResize(Qt.LeftEdge)
|
||||||
|
}
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
visible: root.supported
|
||||||
|
width: 6
|
||||||
|
anchors.right: parent.right
|
||||||
|
anchors.top: parent.top
|
||||||
|
anchors.bottom: parent.bottom
|
||||||
|
anchors.topMargin: 6
|
||||||
|
anchors.bottomMargin: 6
|
||||||
|
cursorShape: Qt.SizeHorCursor
|
||||||
|
onPressed: root.tryStartResize(Qt.RightEdge)
|
||||||
|
}
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
visible: root.supported
|
||||||
|
width: 6
|
||||||
|
height: 6
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.top: parent.top
|
||||||
|
cursorShape: Qt.SizeFDiagCursor
|
||||||
|
onPressed: root.tryStartResize(Qt.LeftEdge | Qt.TopEdge)
|
||||||
|
}
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
visible: root.supported
|
||||||
|
width: 6
|
||||||
|
height: 6
|
||||||
|
anchors.right: parent.right
|
||||||
|
anchors.top: parent.top
|
||||||
|
cursorShape: Qt.SizeBDiagCursor
|
||||||
|
onPressed: root.tryStartResize(Qt.RightEdge | Qt.TopEdge)
|
||||||
|
}
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
visible: root.supported
|
||||||
|
height: 6
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.right: parent.right
|
||||||
|
anchors.bottom: parent.bottom
|
||||||
|
anchors.leftMargin: 6
|
||||||
|
anchors.rightMargin: 6
|
||||||
|
cursorShape: Qt.SizeVerCursor
|
||||||
|
onPressed: root.tryStartResize(Qt.BottomEdge)
|
||||||
|
}
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
visible: root.supported
|
||||||
|
width: 6
|
||||||
|
height: 6
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.bottom: parent.bottom
|
||||||
|
cursorShape: Qt.SizeBDiagCursor
|
||||||
|
onPressed: root.tryStartResize(Qt.LeftEdge | Qt.BottomEdge)
|
||||||
|
}
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
visible: root.supported
|
||||||
|
width: 6
|
||||||
|
height: 6
|
||||||
|
anchors.right: parent.right
|
||||||
|
anchors.bottom: parent.bottom
|
||||||
|
cursorShape: Qt.SizeFDiagCursor
|
||||||
|
onPressed: root.tryStartResize(Qt.RightEdge | Qt.BottomEdge)
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user