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.0 as Kirigami | 26 | import org.kde.kirigami 2.8 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 | 31 | | |||
32 | // FIXME: Dirty workaround for 385992 | 32 | // FIXME: Dirty workaround for 385992 | ||
33 | width: Kirigami.Units.gridUnit * 14 | 33 | width: Kirigami.Units.gridUnit * 14 | ||
34 | 34 | | |||
35 | property bool wideScreen: false | 35 | property bool wideScreen: false | ||
36 | bannerImageSource: "qrc:/banners/banner.svg" | 36 | bannerImageSource: "qrc:/banners/banner.svg" | ||
37 | //make the left and bottom margins for search field the same | 37 | //make the left and bottom margins for search field the same | ||
38 | topPadding: drawer.wideScreen ? -toploader.height - leftPadding : 0 | 38 | topPadding: drawer.wideScreen ? -toploader.height - leftPadding : 0 | ||
39 | bottomPadding: 0 | 39 | bottomPadding: 0 | ||
40 | 40 | | |||
41 | // In desktop view, it's a sidebar, and sidebars get the view BG color | ||||
42 | Kirigami.Theme.colorSet: modal ? Kirigami.Theme.Window : Kirigami.Theme.View | ||||
43 | | ||||
41 | resetMenuOnTriggered: false | 44 | resetMenuOnTriggered: false | ||
42 | 45 | | |||
43 | onBannerClicked: { | 46 | onBannerClicked: { | ||
44 | Navigation.openHome(); | 47 | Navigation.openHome(); | ||
45 | if (modal) | 48 | if (modal) | ||
46 | drawerOpen = false | 49 | drawerOpen = false | ||
47 | } | 50 | } | ||
48 | 51 | | |||
▲ Show 20 Lines • Show All 140 Lines • Show Last 20 Lines |