aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorSander Ferdinand <sa.ferdinand@gmail.com>2018-04-21 21:25:52 +0200
committerSander Ferdinand <sa.ferdinand@gmail.com>2018-04-25 16:31:13 +0200
commitacefb965202f0b5f7c841b0b98628d52334ce9b1 (patch)
treebf392fd29fdd72e91bbf39288610b99f229b807f /js
parent7d8d477a19f167f15f04dfa8a9829b7ef1644dfd (diff)
downloadmonzero-gui-acefb965202f0b5f7c841b0b98628d52334ce9b1.tar.gz
monzero-gui-acefb965202f0b5f7c841b0b98628d52334ce9b1.tar.xz
monzero-gui-acefb965202f0b5f7c841b0b98628d52334ce9b1.zip
Added 'Windows.js' for dialogs/windows
Diffstat (limited to 'js')
-rw-r--r--js/Windows.js34
1 files changed, 34 insertions, 0 deletions
diff --git a/js/Windows.js b/js/Windows.js
new file mode 100644
index 00000000..be2f503e
--- /dev/null
+++ b/js/Windows.js
@@ -0,0 +1,34 @@
+var flagsCustomDecorations = (Qt.FramelessWindowHint | Qt.WindowSystemMenuHint | Qt.Window | Qt.WindowMinimizeButtonHint);
+var flags = (Qt.WindowSystemMenuHint | Qt.Window | Qt.WindowMinimizeButtonHint | Qt.WindowCloseButtonHint | Qt.WindowTitleHint | Qt.WindowMaximizeButtonHint);
+
+/**
+ * Toggles window decorations
+ * @param {bool} custom - toggle decorations
+ */
+function setCustomWindowDecorations(custom) {
+ // save x,y positions, because we need to hide/show the window
+ var x = appWindow.x
+ var y = appWindow.y
+ if (x < 0) x = 0
+ if (y < 0) y = 0
+
+ // Update persistentSettings
+ persistentSettings.customDecorations = custom;
+
+ titleBar.visible = custom;
+ daemonConsolePopup.titleBar.visible = custom;
+
+ if (custom) {
+ appWindow.flags = flagsCustomDecorations;
+ daemonConsolePopup.flags = flagsCustomDecorations;
+ } else {
+ appWindow.flags = flags;
+ daemonConsolePopup.flags = flags;
+ }
+
+ // Reset window
+ appWindow.hide()
+ appWindow.x = x
+ appWindow.y = y
+ appWindow.show()
+}