Added a thin invisible top handle for moving the window around

This commit is contained in:
Alexandre Van de Sande 2015-03-05 18:42:20 -03:00
parent 56dbe20540
commit 93575c8dce
2 changed files with 26 additions and 56 deletions

View file

@ -321,7 +321,6 @@ ApplicationWindow {
} }
onPositionChanged: { onPositionChanged: {
if (!(root.width - mouseX + lastMouseX < root.minimumWidth)) { if (!(root.width - mouseX + lastMouseX < root.minimumWidth)) {
//root.x += (mouseX - lastMouseX)
root.width -= (mouseX - lastMouseX) root.width -= (mouseX - lastMouseX)
root.x = lastRight - root.width root.x = lastRight - root.width
} }
@ -518,8 +517,6 @@ ApplicationWindow {
source: "fonts/Simple-Line-Icons.ttf" source: "fonts/Simple-Line-Icons.ttf"
} }
Rectangle { Rectangle {
id: sideMenuInteractions id: sideMenuInteractions
anchors.fill: parent anchors.fill: parent
@ -536,15 +533,9 @@ ApplicationWindow {
root.x += (mouseX - lastMouseX) root.x += (mouseX - lastMouseX)
root.y += (mouseY - lastMouseY) root.y += (mouseY - lastMouseY)
} }
/*onDoubleClicked: {
//!maximized ? view.set_max() : view.set_normal()}
visibility = "Minimized"
}*/
} }
} }
Rectangle { Rectangle {
width: parent.height width: parent.height
height: parent.width height: parent.width
@ -1068,54 +1059,31 @@ ApplicationWindow {
anchors.top: parent.top anchors.top: parent.top
color: "#00000000" color: "#00000000"
/*Rectangle {
id: urlPane
height: 40
color: "#00000000"
anchors {
left: parent.left
right: parent.right
leftMargin: 5
rightMargin: 5
top: parent.top
topMargin: 5
}
TextField {
id: url
objectName: "url"
placeholderText: "DApp URL"
anchors {
left: parent.left
right: parent.right
top: parent.top
topMargin: 5
rightMargin: 5
leftMargin: 5
}
Keys.onReturnPressed: {
if(/^https?/.test(this.text)) {
newBrowserTab(this.text);
} else {
addPlugin(this.text, {close: true, section: "apps"})
}
}
}
}
// Border
Rectangle { Rectangle {
id: divider id: topMovingHandle
anchors { anchors {
top: parent.top
left: parent.left left: parent.left
right: parent.right right: parent.right
top: urlPane.bottom
} }
z: -1 height: 37
height: 1 color: "transparent"
color: "#CCCCCC" 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)
}
}
}
Rectangle { Rectangle {
id: mainView id: mainView

View file

@ -70,6 +70,8 @@ Rectangle {
anchors.fill: parent anchors.fill: parent
state: "inspectorShown" state: "inspectorShown"
WebEngineView { WebEngineView {
objectName: "webView" objectName: "webView"
id: webview id: webview