diff options
| author | Riccardo Spagni <ric@spagni.net> | 2016-12-20 17:49:35 +0200 |
|---|---|---|
| committer | Riccardo Spagni <ric@spagni.net> | 2016-12-20 17:49:35 +0200 |
| commit | 0526aff950c44de053738d4cb1b992181659941d (patch) | |
| tree | f2df598b8573c80a2cbc19127f018349225b77f0 /components | |
| parent | 55f4858a40948da244b1b5c48799d35f69f7a4a3 (diff) | |
| parent | 2a7f1605348cfeca6def8e0f336d174bd7c13eb1 (diff) | |
| download | monzero-gui-0526aff950c44de053738d4cb1b992181659941d.tar.gz monzero-gui-0526aff950c44de053738d4cb1b992181659941d.tar.xz monzero-gui-0526aff950c44de053738d4cb1b992181659941d.zip | |
Merge pull request #260
2a7f160 Settings hide/show window after changing decorations type (moneromooo.monero)
456bf04 Settings: add user option to toggle custom decorations (moneromooo.monero)
eff8bde Make the custom decorations optional (moneromooo.monero)
Diffstat (limited to 'components')
| -rw-r--r-- | components/TitleBar.qml | 119 |
1 files changed, 115 insertions, 4 deletions
diff --git a/components/TitleBar.qml b/components/TitleBar.qml index 4279c792..aa793985 100644 --- a/components/TitleBar.qml +++ b/components/TitleBar.qml @@ -35,19 +35,36 @@ Rectangle { property int mouseX: 0 property bool containsMouse: false property alias basicButtonVisible: goToBasicVersionButton.visible + property bool customDecorations: true signal goToBasicVersion(bool yes) + height: customDecorations ? 30 : 0 + y: -height + property string title + property alias maximizeButtonVisible: maximizeButton.visible + + Text { + anchors.centerIn: parent + font.family: "Arial" + font.pixelSize: 15 + font.letterSpacing: -1 + color: "#FFFFFF" + text: titleBar.title + visible: customDecorations + } + + Behavior on y { + NumberAnimation { duration: 100; easing.type: Easing.InQuad } + } Rectangle { id: goToBasicVersionButton property bool containsMouse: titleBar.mouseX >= x && titleBar.mouseX <= x + width property bool checked: false anchors.top: parent.top - anchors.bottom: parent.bottom anchors.left: parent.left - anchors.right: parent.right color: containsMouse || checked ? "#FFE00A" : "#000000" - width: parent.width - height: parent.height + height: 30 + width: height Image { anchors.centerIn: parent @@ -64,4 +81,98 @@ Rectangle { } } } + + Row { + id: row + anchors.right: parent.right + anchors.top: parent.top + anchors.bottom: parent.bottom + visible: parent.customDecorations + + Rectangle { + property bool containsMouse: titleBar.mouseX >= x + row.x && titleBar.mouseX <= x + row.x + width && titleBar.containsMouse + anchors.top: parent.top + anchors.bottom: parent.bottom + width: height + color: containsMouse ? "#6B0072" : "#000000" + + Image { + anchors.centerIn: parent + source: "../images/helpIcon.png" + } + + MouseArea { + id: whatIsArea + anchors.fill: parent + onClicked: { + + } + } + } + + Rectangle { + property bool containsMouse: titleBar.mouseX >= x + row.x && titleBar.mouseX <= x + row.x + width && titleBar.containsMouse + anchors.top: parent.top + anchors.bottom: parent.bottom + width: height + color: containsMouse ? "#3665B3" : "#000000" + + Image { + anchors.centerIn: parent + source: "../images/minimizeIcon.png" + } + + MouseArea { + id: minimizeArea + anchors.fill: parent + onClicked: { + appWindow.visibility = Window.Minimized + } + } + } + + Rectangle { + id: maximizeButton + property bool containsMouse: titleBar.mouseX >= x + row.x && titleBar.mouseX <= x + row.x + width && titleBar.containsMouse + anchors.top: parent.top + anchors.bottom: parent.bottom + width: height + color: containsMouse ? "#FF6C3C" : "#000000" + + Image { + anchors.centerIn: parent + source: appWindow.visibility === Window.FullScreen ? "../images/backToWindowIcon.png" : + "../images/maximizeIcon.png" + + } + + MouseArea { + id: maximizeArea + anchors.fill: parent + onClicked: { + appWindow.visibility = appWindow.visibility !== Window.FullScreen ? Window.FullScreen : + Window.Windowed + } + } + } + + Rectangle { + property bool containsMouse: titleBar.mouseX >= x + row.x && titleBar.mouseX <= x + row.x + width && titleBar.containsMouse + anchors.top: parent.top + anchors.bottom: parent.bottom + width: height + color: containsMouse ? "#E04343" : "#000000" + + Image { + anchors.centerIn: parent + source: "../images/closeIcon.png" + } + + MouseArea { + anchors.fill: parent + onClicked: appWindow.close(); + } + } + } + } |
