Changeset View
Changeset View
Standalone View
Standalone View
discover/qml/DiscoverDrawer.qml
Show All 17 Lines | |||||
18 | * along with this program. If not, see <http://www.gnu.org/licenses/>. * | 18 | * along with this program. If not, see <http://www.gnu.org/licenses/>. * | ||
19 | ***************************************************************************/ | 19 | ***************************************************************************/ | ||
20 | 20 | | |||
21 | import QtQuick 2.5 | 21 | import QtQuick 2.5 | ||
22 | import QtQuick.Layouts 1.1 | 22 | import QtQuick.Layouts 1.1 | ||
23 | import QtQuick.Controls 2.1 | 23 | import QtQuick.Controls 2.1 | ||
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.8 as Kirigami | 26 | import org.kde.kirigami 2.11 as Kirigami | ||
ngraham: 2.12 now, right? | |||||
there aren't been components registered as 2.12 so far, so technically, it doesn't exist max i can be put there for now is 2.11 mart: there aren't been components registered as 2.12 so far, so technically, it doesn't exist max i… | |||||
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 | 31 | | |||
32 | leftPadding: 0 | 32 | leftPadding: 0 | ||
33 | rightPadding: 0 | 33 | rightPadding: 0 | ||
34 | topPadding: 0 | 34 | topPadding: 0 | ||
35 | bottomPadding: 0 | 35 | bottomPadding: 0 | ||
36 | 36 | | |||
37 | // FIXME: Dirty workaround for 385992 | 37 | // FIXME: Dirty workaround for 385992 | ||
38 | width: Kirigami.Units.gridUnit * 14 | 38 | width: Kirigami.Units.gridUnit * 14 | ||
39 | 39 | | |||
40 | property bool wideScreen: false | 40 | property bool wideScreen: false | ||
41 | bannerImageSource: modal ? "qrc:/banners/banner.svg" : "" | 41 | bannerImageSource: "qrc:/banners/banner.svg" | ||
42 | 42 | | |||
43 | // In desktop view, it's a sidebar, and sidebars get the view BG color | 43 | // In desktop view, it's a sidebar, and sidebars get the view BG color | ||
44 | Kirigami.Theme.colorSet: modal ? Kirigami.Theme.Window : Kirigami.Theme.View | 44 | Kirigami.Theme.colorSet: modal ? Kirigami.Theme.Window : Kirigami.Theme.View | ||
45 | 45 | | |||
46 | resetMenuOnTriggered: false | 46 | resetMenuOnTriggered: false | ||
47 | 47 | | |||
48 | onBannerClicked: { | 48 | onBannerClicked: { | ||
49 | Navigation.openHome(); | 49 | Navigation.openHome(); | ||
Show All 16 Lines | 64 | function suggestSearchText(text) { | |||
66 | searchField.forceActiveFocus() | 66 | searchField.forceActiveFocus() | ||
67 | } | 67 | } | ||
68 | 68 | | |||
69 | // Give the search field keyboard focus by default | 69 | // Give the search field keyboard focus by default | ||
70 | Component.onCompleted: { | 70 | Component.onCompleted: { | ||
71 | searchField.forceActiveFocus(); | 71 | searchField.forceActiveFocus(); | ||
72 | } | 72 | } | ||
73 | 73 | | |||
74 | topContent: Kirigami.AbstractApplicationHeader { | 74 | header: Kirigami.AbstractApplicationHeader { | ||
75 | id: toolbar | 75 | id: toolbar | ||
76 | preferredHeight: 40 // Match Kirigami.ToolBarApplicationHeader, which is hardcoded to this | | |||
77 | 76 | | |||
78 | RowLayout { | 77 | RowLayout { | ||
79 | anchors.fill: parent | 78 | anchors.fill: parent | ||
80 | anchors.leftMargin: Kirigami.Units.smallSpacing | 79 | anchors.leftMargin: Kirigami.Units.smallSpacing | ||
81 | anchors.rightMargin: Kirigami.Units.smallSpacing | 80 | anchors.rightMargin: Kirigami.Units.smallSpacing | ||
82 | 81 | | |||
83 | SearchField { | 82 | SearchField { | ||
84 | id: searchField | 83 | id: searchField | ||
▲ Show 20 Lines • Show All 65 Lines • ▼ Show 20 Line(s) | 123 | ColumnLayout { | |||
150 | } | 149 | } | ||
151 | 150 | | |||
152 | ActionListItem { | 151 | ActionListItem { | ||
153 | objectName: "updateButton" | 152 | objectName: "updateButton" | ||
154 | action: updateAction | 153 | action: updateAction | ||
155 | 154 | | |||
156 | backgroundColor: ResourcesModel.updatesCount>0 ? "orange" : Kirigami.Theme.backgroundColor | 155 | backgroundColor: ResourcesModel.updatesCount>0 ? "orange" : Kirigami.Theme.backgroundColor | ||
157 | } | 156 | } | ||
158 | 157 | | |||
apol: How's that related? at least the drawerOpen bit should stay. | |||||
ok, i can remove it.. not related but most of the manualadjustments discover is doing, it shouldn't, but this is for another topic/patch mart: ok, i can remove it.. not related but most of the manualadjustments discover is doing, it… | |||||
159 | states: [ | 158 | states: [ | ||
160 | State { | 159 | State { | ||
161 | name: "full" | 160 | name: "full" | ||
162 | when: drawer.wideScreen | 161 | when: drawer.wideScreen | ||
163 | PropertyChanges { target: drawer; drawerOpen: true } | 162 | PropertyChanges { target: drawer; drawerOpen: true } | ||
164 | PropertyChanges { target: drawer; topContent: toolbar } | | |||
165 | }, | 163 | }, | ||
166 | State { | 164 | State { | ||
167 | name: "compact" | 165 | name: "compact" | ||
168 | when: !drawer.wideScreen | 166 | when: !drawer.wideScreen | ||
169 | PropertyChanges { target: drawer; drawerOpen: false } | 167 | PropertyChanges { target: drawer; drawerOpen: false } | ||
170 | PropertyChanges { target: drawer; topContent: null } | | |||
171 | } | 168 | } | ||
172 | ] | 169 | ] | ||
173 | } | 170 | } | ||
174 | 171 | | |||
175 | Component { | 172 | Component { | ||
176 | id: categoryActionComponent | 173 | id: categoryActionComponent | ||
177 | Kirigami.Action { | 174 | Kirigami.Action { | ||
178 | property QtObject category | 175 | property QtObject category | ||
Show All 38 Lines |
2.12 now, right?