aboutsummaryrefslogtreecommitdiff
path: root/js/Windows.js
diff options
context:
space:
mode:
authorluigi1111 <luigi1111w@gmail.com>2018-04-27 15:35:34 -0500
committerluigi1111 <luigi1111w@gmail.com>2018-04-27 15:35:34 -0500
commit679d18166fd4eadb447bf5c193932733bfcf0556 (patch)
tree6075a29298c5ae9ae459ff0f7041b344ccbd7a21 /js/Windows.js
parent1deef732374c0734d91e36e98d7ad812b431dc3c (diff)
parent75ccc7a31b0ab3b969da9a599e8244a8119aa74d (diff)
downloadmonzero-gui-679d18166fd4eadb447bf5c193932733bfcf0556.tar.gz
monzero-gui-679d18166fd4eadb447bf5c193932733bfcf0556.tar.xz
monzero-gui-679d18166fd4eadb447bf5c193932733bfcf0556.zip
Merge pull request #1341
7d8d477 Redesigned the daemon console pop-up acefb96 Added 'Windows.js' for dialogs/windows 47f9a17 Modify password dialog and move customdecorations function out of main.qml 4d56ed9 Make the titlebar more modular 7fe9d71 Added daemonConsole component to main.qml 75ccc7a Added Utils.js, for miscellaneous Javascript functions
Diffstat (limited to 'js/Windows.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()
+}