aboutsummaryrefslogtreecommitdiff
path: root/components/TitleBar.qml
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 /components/TitleBar.qml
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 'components/TitleBar.qml')
-rw-r--r--components/TitleBar.qml98
1 files changed, 70 insertions, 28 deletions
diff --git a/components/TitleBar.qml b/components/TitleBar.qml
index 3fd9a8a0..166e2be9 100644
--- a/components/TitleBar.qml
+++ b/components/TitleBar.qml
@@ -33,39 +33,55 @@ import QtQuick.Layouts 1.1
Rectangle {
id: titleBar
+ height: {
+ if(!customDecorations || isMobile){
+ return 0;
+ }
+
+ if(small) return 38 * scaleRatio;
+ else return 50 * scaleRatio;
+ }
+ y: -height
+ z: 1
+
+ property string title
property int mouseX: 0
property bool containsMouse: false
property alias basicButtonVisible: goToBasicVersionButton.visible
- property bool customDecorations: true
+ property bool customDecorations: persistentSettings.customDecorations
+ property bool showWhatIsButton: true
+ property bool showMinimizeButton: false
+ property bool showMaximizeButton: false
+ property bool showCloseButton: true
+ property bool showMoneroLogo: false
+ property bool small: false
+
+ signal closeClicked
+ signal maximizeClicked
+ signal minimizeClicked
signal goToBasicVersion(bool yes)
- height: customDecorations && !isMobile ? 50 : 0
- y: -height
- property string title
- property alias maximizeButtonVisible: maximizeButton.visible
- z: 1
Item {
- id: test
+ // Background gradient
width: parent.width
- height: 50
- z: 1
+ height: s
+ z: parent.z + 1
- // use jpg for gradiency
Image {
- anchors.fill: parent
- height: parent.height
- width: parent.width
+ anchors.fill: titleBar
+ height: titleBar.height
+ width: titleBar.width
source: "../images/titlebarGradient.jpg"
}
}
- Item{
+ Item {
id: titlebarlogo
width: 125
- height: 50
+ height: parent.height
anchors.centerIn: parent
- visible: customDecorations
- z: 1
+ visible: customDecorations && showMoneroLogo
+ z: parent.z + 1
Image {
anchors.left: parent.left
@@ -77,6 +93,15 @@ Rectangle {
}
}
+ Label {
+ id: titleLabel
+ visible: !showMoneroLogo && customDecorations && titleBar.title !== ''
+ anchors.centerIn: parent
+ fontSize: 18
+ text: titleBar.title
+ z: parent.z + 1
+ }
+
// collapse left panel
Rectangle {
id: goToBasicVersionButton
@@ -85,10 +110,10 @@ Rectangle {
anchors.top: parent.top
anchors.left: parent.left
color: "transparent"
- height: 50 * scaleRatio
+ height: titleBar.height
width: height
visible: isMobile
- z: 2
+ z: parent.z + 2
Image {
width: 14
@@ -118,10 +143,11 @@ Rectangle {
anchors.top: parent.top
anchors.bottom: parent.bottom
visible: parent.customDecorations
- z: 2
+ z: parent.z + 2
Rectangle {
id: minimizeButton
+ visible: showMinimizeButton
anchors.top: parent.top
anchors.bottom: parent.bottom
width: 42
@@ -139,14 +165,13 @@ Rectangle {
cursorShape: Qt.PointingHandCursor
onEntered: minimizeButton.color = "#262626";
onExited: minimizeButton.color = "transparent";
- onClicked: {
- appWindow.visibility = Window.Minimized
- }
+ onClicked: minimizeClicked();
}
}
Rectangle {
id: maximizeButton
+ visible: showMaximizeButton
anchors.top: parent.top
anchors.bottom: parent.bottom
width: 42
@@ -167,15 +192,13 @@ Rectangle {
cursorShape: Qt.PointingHandCursor
onEntered: maximizeButton.color = "#262626";
onExited: maximizeButton.color = "transparent";
- onClicked: {
- appWindow.visibility = appWindow.visibility !== Window.FullScreen ? Window.FullScreen :
- Window.Windowed
- }
+ onClicked: maximizeClicked();
}
}
Rectangle {
id: closeButton
+ visible: showCloseButton
anchors.top: parent.top
anchors.bottom: parent.bottom
width: 42
@@ -190,7 +213,7 @@ Rectangle {
MouseArea {
anchors.fill: parent
- onClicked: appWindow.close();
+ onClicked: closeClicked();
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onEntered: closeButton.color = "#262626";
@@ -199,4 +222,23 @@ Rectangle {
}
}
+ // window borders
+ Rectangle {
+ anchors.bottom: parent.bottom
+ anchors.right: parent.right
+ anchors.left: parent.left
+ height: 1
+ color: "#2F2F2F"
+ z: parent.z + 1
+ }
+
+ Rectangle {
+ anchors.top: parent.top
+ anchors.right: parent.right
+ anchors.left: parent.left
+ visible: titleBar.small
+ height: 1
+ color: "#2F2F2F"
+ z: parent.z + 1
+ }
}