diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2018-08-18 20:10:57 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2018-08-18 20:11:26 +0200 |
commit | c7956f98ab9cdff4767f11005c7c816a540ba3ab (patch) | |
tree | 8493fb7bb11867594635a0cdd9ed6e86f716c51e /framework/qml | |
parent | b51c5b583c131ca7301862b013aa59bfd07cadd2 (diff) | |
download | kube-c7956f98ab9cdff4767f11005c7c816a540ba3ab.tar.gz kube-c7956f98ab9cdff4767f11005c7c816a540ba3ab.zip |
Overlay positioning via the base View
This fixes the position when running the search view main.qml
Diffstat (limited to 'framework/qml')
-rw-r--r-- | framework/qml/View.qml | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/framework/qml/View.qml b/framework/qml/View.qml index 859b7155..64524999 100644 --- a/framework/qml/View.qml +++ b/framework/qml/View.qml | |||
@@ -19,19 +19,25 @@ | |||
19 | 19 | ||
20 | 20 | ||
21 | import QtQuick 2.7 | 21 | import QtQuick 2.7 |
22 | import QtQuick.Controls 2.0 as Controls2 | 22 | import QtQuick.Controls 2 |
23 | import QtQuick.Layouts 1.1 | 23 | import QtQuick.Layouts 1.1 |
24 | import org.kube.framework 1.0 as Kube | 24 | import org.kube.framework 1.0 as Kube |
25 | 25 | ||
26 | FocusScope { | 26 | FocusScope { |
27 | id: root | 27 | id: root |
28 | 28 | ||
29 | //Use overlayArea to position an overlay window, parented to ApplicationWindow.window, over just the view-section without the sidebar. | ||
30 | property int sidebarWidth: ApplicationWindow.window.sidebarWidth ? ApplicationWindow.window.sidebarWidth : 0 | ||
31 | property int windowWidth: ApplicationWindow.window.width ? ApplicationWindow.window.width : width | ||
32 | property int windowHeight: ApplicationWindow.window.height ? ApplicationWindow.window.height : height | ||
33 | property rect overlayArea: Qt.rect(sidebarWidth, 0, windowWidth - sidebarWidth, windowHeight) | ||
34 | |||
29 | //Search | 35 | //Search |
30 | property rect searchArea | 36 | property rect searchArea |
31 | property string filter: "" | 37 | property string filter: "" |
32 | property var searchObject: null | 38 | property var searchObject: null |
33 | function triggerSearch() { | 39 | function triggerSearch() { |
34 | if (!searchObject && Controls2.StackView.visible) { | 40 | if (!searchObject && StackView.visible) { |
35 | searchObject = searchComponent.createObject(root) | 41 | searchObject = searchComponent.createObject(root) |
36 | } | 42 | } |
37 | } | 43 | } |
@@ -60,11 +66,11 @@ FocusScope { | |||
60 | 66 | ||
61 | //This signal will be emitted once all initial properties have been set and the view is ready to load | 67 | //This signal will be emitted once all initial properties have been set and the view is ready to load |
62 | signal setup() | 68 | signal setup() |
63 | Controls2.StackView.onActivated: { | 69 | StackView.onActivated: { |
64 | root.setup() | 70 | root.setup() |
65 | } | 71 | } |
66 | 72 | ||
67 | Controls2.StackView.onDeactivated: { | 73 | StackView.onDeactivated: { |
68 | clearSearch() | 74 | clearSearch() |
69 | } | 75 | } |
70 | 76 | ||