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 { Rectangle {
id: urlPane id: topMovingHandle
height: 40 anchors {
color: "#00000000" top: parent.top
anchors { left: parent.left
left: parent.left right: parent.right
right: parent.right }
leftMargin: 5 height: 37
rightMargin: 5 color: "transparent"
top: parent.top z: 100
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: { MouseArea {
if(/^https?/.test(this.text)) { anchors.fill: parent
newBrowserTab(this.text); property real lastMouseX: 0
} else { property real lastMouseY: 0
addPlugin(this.text, {close: true, section: "apps"}) onPressed: {
} lastMouseX = mouseX
} lastMouseY = mouseY
} }
onPositionChanged: {
} root.x += (mouseX - lastMouseX)
root.y += (mouseY - lastMouseY)
// Border }
Rectangle { }
id: divider }
anchors {
left: parent.left
right: parent.right
top: urlPane.bottom
}
z: -1
height: 1
color: "#CCCCCC"
}*/
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