Changeset View
Changeset View
Standalone View
Standalone View
sidebar/package/contents/ui/main.qml
Show All 10 Lines | 1 | /* | |||
---|---|---|---|---|---|
11 | Library General Public License for more details. | 11 | Library General Public License for more details. | ||
12 | 12 | | |||
13 | You should have received a copy of the GNU Library General Public License | 13 | You should have received a copy of the GNU Library General Public License | ||
14 | along with this library; see the file COPYING.LIB. If not, write to | 14 | along with this library; see the file COPYING.LIB. If not, write to | ||
15 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 15 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
16 | Boston, MA 02110-1301, USA. | 16 | Boston, MA 02110-1301, USA. | ||
17 | */ | 17 | */ | ||
18 | 18 | | |||
19 | import QtQuick 2.1 | 19 | import QtQuick 2.5 | ||
20 | import QtQuick.Layouts 1.1 | 20 | | ||
21 | import QtQuick.Controls 1.0 as QtControls | 21 | import org.kde.kirigami 2.5 as Kirigami | ||
22 | import org.kde.kirigami 2.1 as Kirigami | | |||
23 | 22 | | |||
24 | Kirigami.ApplicationItem { | 23 | Kirigami.ApplicationItem { | ||
25 | id: root | 24 | id: root | ||
26 | implicitWidth: wideScreen ? Kirigami.Units.gridUnit * 30 : Kirigami.Units.gridUnit * 15 | 25 | implicitWidth: wideScreen ? Kirigami.Units.gridUnit * 30 : Kirigami.Units.gridUnit * 15 | ||
27 | pageStack.initialPage: mainColumn | 26 | pageStack.initialPage: mainColumn | ||
28 | pageStack.defaultColumnWidth: wideScreen ? root.width / 2 : root.width | 27 | pageStack.defaultColumnWidth: wideScreen ? root.width / 2 : root.width | ||
29 | 28 | | |||
30 | LayoutMirroring.enabled: Qt.application.layoutDirection === Qt.RightToLeft | 29 | LayoutMirroring.enabled: Qt.application.layoutDirection === Qt.RightToLeft | ||
31 | LayoutMirroring.childrenInherit: true | 30 | LayoutMirroring.childrenInherit: true | ||
32 | 31 | | |||
33 | signal focusNextRequest() | 32 | signal focusNextRequest() | ||
34 | signal focusPreviousRequest() | 33 | signal focusPreviousRequest() | ||
35 | 34 | | |||
36 | function focusFirstChild() { | 35 | function focusFirstChild() { | ||
37 | mainColumn.focus = true; | 36 | mainColumn.focus = true; | ||
38 | } | 37 | } | ||
39 | 38 | | |||
40 | function focusLastChild() { | 39 | function focusLastChild() { | ||
41 | subCategoryColumn.focus = true; | 40 | subCategoryColumn.focus = true; | ||
42 | } | 41 | } | ||
43 | 42 | | |||
44 | wideScreen: pageStack.depth > 1 && systemsettings.width > Kirigami.Units.gridUnit * 70 | 43 | wideScreen: pageStack.depth > 1 && systemsettings.width > Kirigami.Units.gridUnit * 70 | ||
45 | CategoriesPage { | 44 | CategoriesPage { | ||
broulik: Can you instead do a `Q_PROPERTY(bool actionMenuVisible ...)` in `systemsettings` which you set… | |||||
46 | id: mainColumn | 45 | id: mainColumn | ||
47 | } | 46 | } | ||
48 | 47 | | |||
49 | SubCategoryPage { | 48 | SubCategoryPage { | ||
50 | id: subCategoryColumn | 49 | id: subCategoryColumn | ||
51 | } | 50 | } | ||
52 | Kirigami.Separator { | 51 | Kirigami.Separator { | ||
53 | z: 999 | 52 | z: 999 | ||
54 | anchors { | 53 | anchors { | ||
55 | top: parent.top | 54 | top: parent.top | ||
56 | right: parent.right | 55 | right: parent.right | ||
57 | bottom: parent.bottom | 56 | bottom: parent.bottom | ||
58 | } | 57 | } | ||
59 | } | 58 | } | ||
60 | } | 59 | } |
Can you instead do a Q_PROPERTY(bool actionMenuVisible ...) in systemsettings which you set true before the menu opens and set false in aboutToHide. Then bind the checked of the button to it.
This way everything is in a predictable space and not called all over the place.