diff --git a/cmd/mist/assets/qml/main.qml b/cmd/mist/assets/qml/main.qml index 4b05bef1d4..4255cdb6ee 100644 --- a/cmd/mist/assets/qml/main.qml +++ b/cmd/mist/assets/qml/main.qml @@ -270,12 +270,22 @@ ApplicationWindow { id: blockModel } + + + + Rectangle { id: windowChrome color: "#EBE8E8" anchors.fill: parent radius: 3 + + + + + + /************************/ /* */ /* Resizeable Borders */ @@ -348,30 +358,6 @@ ApplicationWindow { } } - MouseArea { - id: topResizableBar - anchors { - top: parent.top - right: parent.right - left: parent.left - } - height: 5 - cursorShape: Qt.SizeVerCursor; - - property real lastMouseY: 0 - property real lastTop: root.y + root.height - onPressed: { - lastMouseY = mouseY - lastTop = root.y + root.height - } - onPositionChanged: { - if (!(root.height - mouseY + lastMouseY < root.minimumHeight)) { - root.height -= (mouseY - lastMouseY) - root.y = lastTop - root.height - } - } - } - MouseArea { id: bottomRightResizableHandle anchors { @@ -397,52 +383,211 @@ ApplicationWindow { root.height += (mouseY - lastMouseY) } } + } + } + + Rectangle { + id: topBar + anchors { + top: parent.top + left: parent.left + right: parent.right + } + height: 18.4 + z: 100 + color: "transparent" + + MouseArea { + id: menuMouseArea + anchors.fill: parent + property real lastMouseX: 0 + property real lastMouseY: 0 + hoverEnabled: true + onPressed: { + lastMouseX = mouseX + lastMouseY = mouseY + } + onPositionChanged: { + if (menuMouseArea.pressed){ + root.x += (mouseX - lastMouseX) + root.y += (mouseY - lastMouseY) + } + + } + onEntered: { + topBar.state = "hovered" + } + onExited: { + topBar.state = "normal" + } } - // Commenting this out because it's causing too many crashes - // MouseArea { - // id: bottomLeftResizableHandle - // anchors { - // bottom: parent.bottom - // left: parent.left - // } - // width: 5 - // height: 5 - // cursorShape: Qt.SizeBDiagCursor; + // gradient: Gradient { + // GradientStop { position: 0.0; color: "#FFFFFFFF" } + // GradientStop { position: 1.0; color: "#00FFFFFF" } + // } - // Rectangle { - // anchors.fill: parent - // color: "red" - // } + - // property real lastMouseX: 0 - // property real lastMouseY: 0 - // property real lastRight: root.x + root.width + Rectangle { + anchors { + top: parent.top + right: parent.right + bottom: parent.bottom + left: parent.left + leftMargin: 194 + } + radius: 3 + gradient: Gradient { + GradientStop { position: 0.0; color: "#FFFFFFFF" } + GradientStop { position: 1.0; color: "#00FFFFFF" } + } + } - // onPressed: { - // lastMouseX = mouseX - // lastMouseY = mouseY - // lastRight = root.x + root.width - // } - // onPositionChanged: { - // if (!(root.width + mouseX - lastMouseX < root.minimumWidth)) { - // root.width += (mouseX - lastMouseX) - // } + Rectangle { + id: topbarBackground + anchors.fill: parent + opacity: 0.0 + radius: 3 + color: "#AAA0A0" + } + - // if (!(root.height - mouseY + lastMouseY < root.minimumHeight)) { - // root.height -= (mouseY - lastMouseY) - // root.y = lastTop - root.height - // } - // } - // } + states: [ + State { + name: "normal" + when: menuMouseArea.hovered + PropertyChanges { + target: topbarBackground + opacity: 0 + } + }, + State { + name: "hovered" + when: menuMouseArea.hovered + PropertyChanges { + target: topbarBackground + opacity: 1 + } + }] + + + transitions: Transition { + NumberAnimation { + properties: "opacity" + duration: 250 + easing.type: Easing.InOutQuad + } + } + + /************************/ + /* Semafor Buttons */ + /************************/ + + Rectangle { + id: semaforButtons + color: "transparent" + height: 32 + + anchors { + top: parent.top + left: parent.left + right: parent.right + } + + Rectangle { + color: 'transparent' + width: 13 + height: 20 + x: 3 + + Image { + height: 13 + width: 13 + source: toolbarCloseButton.containsMouse ? "../window-control/window-close.png" : "../window-control/window-close-hover.png" + anchors.centerIn: parent + + MouseArea { + id: toolbarCloseButton + anchors.fill: parent + hoverEnabled: true + onClicked: Qt.quit() //gui.stop(); + + onEntered: { + topBar.state = "hovered" + } + } + } + } + Rectangle { + color: 'transparent' + width: 13 + height: 20 + x: 21 + + Image { + height: 13 + width: 13 + source: toolbarminimizeButton.containsMouse ? "../window-control/window-minimize.png" : "../window-control/window-minimize-hover.png" + anchors.centerIn: parent + + MouseArea { + id: toolbarminimizeButton + anchors.fill: parent + hoverEnabled: true + onClicked: { + console.log("Minimize"); + // Neither works.. + //root.visibility = QWindow.minimized; + // root.showMinimized(); + } + onEntered: { + topBar.state = "hovered" + console.log(topBar.state ) + } + } + } + } + + Rectangle { + color: 'transparent' + width: 13 + height: 20 + x: 40 + + Image { + height: 13 + width: 13 + source: toolbarzoomButton.containsMouse ? "../window-control/window-zoom.png" : "../window-control/window-zoom-hover.png" + anchors.centerIn: parent + + MouseArea { + id: toolbarzoomButton + anchors.fill: parent + hoverEnabled: true + onClicked: { + console.log("Maximize"); + // Neither works.. + //root.visibility = QWindow.maximized; + //root.showMaximized(); + } + onEntered: { + topBar.state = "hovered" + } + } + } + } + } } + SplitView { property var views: []; id: mainSplit anchors.fill: windowChrome anchors.margins: 2 + z: 50 //color: "brown" //radius: 5 @@ -484,6 +629,8 @@ ApplicationWindow { return {view: view, menuItem: menuItem} } + + /********************* * Main menu. ********************/ @@ -851,94 +998,6 @@ ApplicationWindow { return comp } - /************************/ - /* Semafor Buttons */ - /************************/ - - Rectangle { - id: semaforButtons - color: "transparent" - height: 32 - - anchors { - top: parent.top - left: parent.left - right: parent.right - } - - Rectangle { - color: 'transparent' - width: 13 - height: 20 - x: 3 - - Image { - height: 13 - width: 13 - source: toolbarCloseButton.containsMouse ? "../window-control/window-close.png" : "../window-control/window-close-hover.png" - anchors.centerIn: parent - - MouseArea { - id: toolbarCloseButton - anchors.fill: parent - hoverEnabled: true - onClicked: Qt.quit() //gui.stop(); - } - } - } - Rectangle { - color: 'transparent' - width: 13 - height: 20 - x: 21 - - Image { - height: 13 - width: 13 - source: toolbarminimizeButton.containsMouse ? "../window-control/window-minimize.png" : "../window-control/window-minimize-hover.png" - anchors.centerIn: parent - - MouseArea { - id: toolbarminimizeButton - anchors.fill: parent - hoverEnabled: true - onClicked: { - console.log("Minimize"); - // Neither works.. - //root.visibility = QWindow.minimized; - // root.showMinimized(); - } - } - } - } - - Rectangle { - color: 'transparent' - width: 13 - height: 20 - x: 40 - - Image { - height: 13 - width: 13 - source: toolbarzoomButton.containsMouse ? "../window-control/window-zoom.png" : "../window-control/window-zoom-hover.png" - anchors.centerIn: parent - - MouseArea { - id: toolbarzoomButton - anchors.fill: parent - hoverEnabled: true - onClicked: { - console.log("Maximize"); - // Neither works.. - //root.visibility = QWindow.maximized; - //root.showMaximized(); - } } - } - } - - - } ColumnLayout { id: menuColumn @@ -1059,36 +1118,6 @@ ApplicationWindow { anchors.top: parent.top color: "#00000000" - Rectangle { - id: topMovingHandle - anchors { - top: parent.top - left: parent.left - right: parent.right - } - height: 37 - z: 100 - - MouseArea { - anchors.fill: parent - property real lastMouseX: 0 - property real lastMouseY: 0 - onPressed: { - lastMouseX = mouseX - lastMouseY = mouseY - } - onPositionChanged: { - root.x += (mouseX - lastMouseX) - root.y += (mouseY - lastMouseY) - } - } - - gradient: Gradient { - GradientStop { position: 0.0; color: "#FFFFFFFF" } - GradientStop { position: 1.0; color: "#00FFFFFF" } - } - } - Rectangle { id: mainView color: "#00000000" @@ -1102,7 +1131,7 @@ ApplicationWindow { return view; } - } + } } } diff --git a/cmd/mist/assets/window-control/window-close.png b/cmd/mist/assets/window-control/window-close.png index 39ecae905c..fe7f4b9d73 100644 Binary files a/cmd/mist/assets/window-control/window-close.png and b/cmd/mist/assets/window-control/window-close.png differ diff --git a/cmd/mist/assets/window-control/window-close@2x.png b/cmd/mist/assets/window-control/window-close@2x.png index 49bd12a0eb..042342d2ee 100644 Binary files a/cmd/mist/assets/window-control/window-close@2x.png and b/cmd/mist/assets/window-control/window-close@2x.png differ diff --git a/cmd/mist/assets/window-control/window-minimize.png b/cmd/mist/assets/window-control/window-minimize.png deleted file mode 100644 index ff68c8da93..0000000000 Binary files a/cmd/mist/assets/window-control/window-minimize.png and /dev/null differ diff --git a/cmd/mist/assets/window-control/window-minimize@2x.png b/cmd/mist/assets/window-control/window-minimize@2x.png index 2b1e0e05bd..ac20f58b75 100644 Binary files a/cmd/mist/assets/window-control/window-minimize@2x.png and b/cmd/mist/assets/window-control/window-minimize@2x.png differ diff --git a/cmd/mist/assets/window-control/window-zoom.png b/cmd/mist/assets/window-control/window-zoom.png index fe30855db6..6325060846 100644 Binary files a/cmd/mist/assets/window-control/window-zoom.png and b/cmd/mist/assets/window-control/window-zoom.png differ diff --git a/cmd/mist/assets/window-control/window-zoom@2x.png b/cmd/mist/assets/window-control/window-zoom@2x.png index 02fca3f3b6..b6e8efc1d1 100644 Binary files a/cmd/mist/assets/window-control/window-zoom@2x.png and b/cmd/mist/assets/window-control/window-zoom@2x.png differ