mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
sync with mobilecomponents a85365111 + patches
This is the latest state of the upstream art from Plasma, plus our patches to disable the gamma effect on the icon, and the drawer removed. Signed-off-by: Sebastian Kügler <sebas@kde.org>
This commit is contained in:
parent
8664925e20
commit
548d6fc956
11 changed files with 553 additions and 904 deletions
|
|
@ -25,14 +25,15 @@ import org.kde.plasma.mobilecomponents 0.2
|
|||
OverlayDrawer {
|
||||
id: root
|
||||
|
||||
property string title
|
||||
property string title: typeof i18n !== "undefined" ? i18n("Actions") : "Actions"
|
||||
|
||||
//This can be any type of object that a ListView can accept as model. It expects items compatible with either QAction or QQC Action
|
||||
property var actions
|
||||
property var actions: pageStack.lastVisiblePage ? pageStack.lastVisiblePage.contextualActions : null
|
||||
enabled: menu.count > 0
|
||||
edge: Qt.RightEdge
|
||||
|
||||
contentItem: QtControls.ScrollView {
|
||||
implicitWidth: Units.gridUnit * 20
|
||||
ListView {
|
||||
id: menu
|
||||
interactive: contentHeight > height
|
||||
|
|
@ -49,9 +50,8 @@ OverlayDrawer {
|
|||
root.actions[0];
|
||||
}
|
||||
}
|
||||
verticalLayoutDirection: ListView.BottomToTop
|
||||
//in bottomtotop all is flipped
|
||||
footer: Item {
|
||||
topMargin: menu.height - menu.contentHeight
|
||||
header: Item {
|
||||
height: heading.height
|
||||
width: menu.width
|
||||
Heading {
|
||||
|
|
@ -66,23 +66,11 @@ OverlayDrawer {
|
|||
text: root.title
|
||||
}
|
||||
}
|
||||
delegate: ListItem {
|
||||
delegate: BasicListItem {
|
||||
enabled: true
|
||||
RowLayout {
|
||||
height: implicitHeight + Units.smallSpacing * 2
|
||||
anchors {
|
||||
left: parent.left
|
||||
margins: Units.largeSpacing
|
||||
}
|
||||
Icon {
|
||||
height: parent.height
|
||||
width: height
|
||||
source: modelData.iconName
|
||||
}
|
||||
Label {
|
||||
text: model ? model.text : modelData.text
|
||||
}
|
||||
}
|
||||
checked: modelData.checked
|
||||
icon: modelData.iconName
|
||||
label: model ? model.text : modelData.text
|
||||
onClicked: {
|
||||
if (modelData && modelData.trigger !== undefined) {
|
||||
modelData.trigger();
|
||||
|
|
@ -92,6 +80,7 @@ OverlayDrawer {
|
|||
} else {
|
||||
console.warning("Don't know how to trigger the action")
|
||||
}
|
||||
root.opened = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue