Changeset View
Changeset View
Standalone View
Standalone View
discover/qml/DiscoverDrawer.qml
Show All 23 Lines | |||||
24 | import org.kde.discover 2.0 | 24 | import org.kde.discover 2.0 | ||
25 | import org.kde.discover.app 1.0 | 25 | import org.kde.discover.app 1.0 | ||
26 | import org.kde.kirigami 2.0 as Kirigami | 26 | import org.kde.kirigami 2.0 as Kirigami | ||
27 | import "navigation.js" as Navigation | 27 | import "navigation.js" as Navigation | ||
28 | 28 | | |||
29 | Kirigami.GlobalDrawer { | 29 | Kirigami.GlobalDrawer { | ||
30 | id: drawer | 30 | id: drawer | ||
31 | bannerImageSource: "qrc:/banners/banner.svg" | 31 | bannerImageSource: "qrc:/banners/banner.svg" | ||
32 | topPadding: -50 | 32 | //make the left and bottom margins for search field the same | ||
33 | leftPadding: 0 | 33 | topPadding: -searchField.height - leftPadding | ||
34 | rightPadding: 0 | | |||
35 | bottomPadding: 0 | 34 | bottomPadding: 0 | ||
36 | 35 | | |||
37 | resetMenuOnTriggered: false | 36 | resetMenuOnTriggered: false | ||
38 | 37 | | |||
39 | onBannerClicked: { | 38 | onBannerClicked: { | ||
40 | Navigation.openHome(); | 39 | Navigation.openHome(); | ||
41 | } | 40 | } | ||
42 | 41 | | |||
Show All 9 Lines | 46 | onCurrentSubMenuChanged: { | |||
52 | else | 51 | else | ||
53 | Navigation.openHome() | 52 | Navigation.openHome() | ||
54 | 53 | | |||
55 | } | 54 | } | ||
56 | 55 | | |||
57 | topContent: TextField { | 56 | topContent: TextField { | ||
58 | id: searchField | 57 | id: searchField | ||
59 | Layout.fillWidth: true | 58 | Layout.fillWidth: true | ||
60 | Layout.leftMargin: Kirigami.Units.smallSpacing | | |||
61 | Layout.rightMargin: Kirigami.Units.smallSpacing | | |||
62 | 59 | | |||
63 | enabled: window.leftPage && (window.leftPage.searchFor != null || window.leftPage.hasOwnProperty("search")) | 60 | enabled: window.leftPage && (window.leftPage.searchFor != null || window.leftPage.hasOwnProperty("search")) | ||
64 | Keys.forwardTo: [window.pageStack] | 61 | Keys.forwardTo: [window.pageStack] | ||
65 | 62 | | |||
66 | Component.onCompleted: { | 63 | Component.onCompleted: { | ||
67 | searchField.forceActiveFocus() | 64 | searchField.forceActiveFocus() | ||
68 | } | 65 | } | ||
69 | Shortcut { | 66 | Shortcut { | ||
Show All 32 Lines | 98 | } else | |||
102 | curr.search = parent.text; | 99 | curr.search = parent.text; | ||
103 | } | 100 | } | ||
104 | } | 101 | } | ||
105 | } | 102 | } | ||
106 | 103 | | |||
107 | ColumnLayout { | 104 | ColumnLayout { | ||
108 | spacing: 0 | 105 | spacing: 0 | ||
109 | Layout.fillWidth: true | 106 | Layout.fillWidth: true | ||
107 | Layout.leftMargin: -drawer.leftPadding | ||||
108 | Layout.rightMargin: -drawer.rightPadding | ||||
110 | 109 | | |||
111 | Kirigami.Separator { | 110 | Kirigami.Separator { | ||
112 | Layout.fillWidth: true | 111 | Layout.fillWidth: true | ||
113 | } | 112 | } | ||
114 | 113 | | |||
115 | ProgressView { | 114 | ProgressView { | ||
116 | separatorVisible: false | 115 | separatorVisible: false | ||
117 | } | 116 | } | ||
▲ Show 20 Lines • Show All 72 Lines • Show Last 20 Lines |