mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-10-15 07:44:01 -04:00
57 lines
1.2 KiB
QML
57 lines
1.2 KiB
QML
import QtQuick
|
|
import QtQuick.Window
|
|
import qs.Common
|
|
import qs.Modules.Settings
|
|
import qs.Modules.Settings.Widgets
|
|
import qs.Widgets
|
|
|
|
DankFloatingWindow {
|
|
id: root
|
|
|
|
signal ruleSubmitted
|
|
|
|
objectName: "windowRuleModal"
|
|
title: editor.title
|
|
minimumSize: Qt.size(Math.min(SettingsMetrics.formDialogWidth + Theme.spacingL * 2, Screen.width), Math.min(Math.round(Theme.fontSizeMedium * 52), Screen.height))
|
|
maximumSize: minimumSize
|
|
visible: false
|
|
|
|
onClosed: hide()
|
|
|
|
function show(window) {
|
|
visible = true;
|
|
editor.show(window);
|
|
}
|
|
|
|
function showEdit(rule) {
|
|
visible = true;
|
|
editor.showEdit(rule);
|
|
}
|
|
|
|
function showCopy(rule) {
|
|
visible = true;
|
|
editor.showCopy(rule);
|
|
}
|
|
|
|
function hide() {
|
|
editor.opened = false;
|
|
visible = false;
|
|
}
|
|
|
|
WindowRuleEditorDialog {
|
|
id: editor
|
|
anchors.fill: parent
|
|
windowControls: ruleWindowControls
|
|
onRejected: root.hide()
|
|
onRuleSubmitted: {
|
|
root.ruleSubmitted();
|
|
root.hide();
|
|
}
|
|
}
|
|
|
|
FloatingWindowControls {
|
|
id: ruleWindowControls
|
|
targetWindow: root
|
|
}
|
|
}
|