Changeset View
Changeset View
Standalone View
Standalone View
src/qmlcontrols/kcmcontrols/qml/GridDelegate.qml
Show All 17 Lines | |||||
18 | 18 | | |||
19 | import QtQuick 2.8 | 19 | import QtQuick 2.8 | ||
20 | import QtQuick.Layouts 1.1 | 20 | import QtQuick.Layouts 1.1 | ||
21 | import QtQuick.Controls 2.2 as Controls | 21 | import QtQuick.Controls 2.2 as Controls | ||
22 | import QtQuick.Templates 2.2 as T2 | 22 | import QtQuick.Templates 2.2 as T2 | ||
23 | import QtGraphicalEffects 1.0 | 23 | import QtGraphicalEffects 1.0 | ||
24 | 24 | | |||
25 | import org.kde.kirigami 2.2 as Kirigami | 25 | import org.kde.kirigami 2.2 as Kirigami | ||
26 | import org.kde.kcm 1.1 as KCM | ||||
26 | 27 | | |||
27 | /** | 28 | /** | ||
28 | * Base delegate for KControlmodules based on Grid views of thumbnails | 29 | * Base delegate for KControlmodules based on Grid views of thumbnails | ||
29 | * Use the onClicked signal handler for managing the main action when | 30 | * Use the onClicked signal handler for managing the main action when | ||
30 | * the user clicks on the thumbnail | 31 | * the user clicks on the thumbnail | ||
31 | * @inherits QtQuick.Templates.ItemDelegate | 32 | * @inherits QtQuick.Templates.ItemDelegate | ||
32 | */ | 33 | */ | ||
33 | T2.ItemDelegate { | 34 | T2.ItemDelegate { | ||
Show All 25 Lines | |||||
59 | * icons on the bottom-right corner of the thumbnail on mouse over | 60 | * icons on the bottom-right corner of the thumbnail on mouse over | ||
60 | */ | 61 | */ | ||
61 | property list<QtObject> actions | 62 | property list<QtObject> actions | ||
62 | 63 | | |||
63 | width: GridView.view.cellWidth | 64 | width: GridView.view.cellWidth | ||
64 | height: GridView.view.cellHeight | 65 | height: GridView.view.cellHeight | ||
65 | hoverEnabled: true | 66 | hoverEnabled: true | ||
66 | 67 | | |||
68 | // Apply immediately when double-clicked | ||||
69 | onDoubleClicked: kcm.save() | ||||
70 | | ||||
67 | Rectangle { | 71 | Rectangle { | ||
68 | id: thumbnail | 72 | id: thumbnail | ||
69 | anchors { | 73 | anchors { | ||
70 | centerIn: parent | 74 | centerIn: parent | ||
71 | verticalCenterOffset: Math.ceil(-label.height/2) | 75 | verticalCenterOffset: Math.ceil(-label.height/2) | ||
72 | } | 76 | } | ||
73 | width: Kirigami.Settings.isMobile ? delegate.width - Kirigami.Units.gridUnit : Math.min(delegate.GridView.view.implicitCellWidth, delegate.width - Kirigami.Units.gridUnit) | 77 | width: Kirigami.Settings.isMobile ? delegate.width - Kirigami.Units.gridUnit : Math.min(delegate.GridView.view.implicitCellWidth, delegate.width - Kirigami.Units.gridUnit) | ||
74 | height: Kirigami.Settings.isMobile ? Math.round((delegate.width - Kirigami.Units.gridUnit) / 1.6) | 78 | height: Kirigami.Settings.isMobile ? Math.round((delegate.width - Kirigami.Units.gridUnit) / 1.6) | ||
▲ Show 20 Lines • Show All 118 Lines • Show Last 20 Lines |