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: {
if (!(root.width - mouseX + lastMouseX < root.minimumWidth)) {
//root.x += (mouseX - lastMouseX)
root.width -= (mouseX - lastMouseX)
root.x = lastRight - root.width
}
@ -518,8 +517,6 @@ ApplicationWindow {
source: "fonts/Simple-Line-Icons.ttf"
}
Rectangle {
id: sideMenuInteractions
anchors.fill: parent
@ -536,15 +533,9 @@ ApplicationWindow {
root.x += (mouseX - lastMouseX)
root.y += (mouseY - lastMouseY)
}
/*onDoubleClicked: {
//!maximized ? view.set_max() : view.set_normal()}
visibility = "Minimized"
}*/
}
}
Rectangle {
width: parent.height
height: parent.width
@ -1068,54 +1059,31 @@ ApplicationWindow {
anchors.top: parent.top
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 {
id: divider
id: topMovingHandle
anchors {
top: parent.top
left: parent.left
right: parent.right
top: urlPane.bottom
}
z: -1
height: 1
color: "#CCCCCC"
}*/
height: 37
color: "transparent"
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 {
id: mainView

View file

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