mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
sync with mobilecomponents 9d179eb74a227
- Workaround for black squares is merged upstream - brings back the FAB button, additional - swipe interaction improvements in the same Signed-off-by: Sebastian Kügler <sebas@kde.org>
This commit is contained in:
parent
a9b53efce6
commit
95bca4b50c
5 changed files with 24 additions and 20 deletions
|
|
@ -85,7 +85,6 @@ inputMethod.keyboardRectangle.y) : 0
|
||||||
width: Units.gridUnit * 25
|
width: Units.gridUnit * 25
|
||||||
height: Units.gridUnit * 30
|
height: Units.gridUnit * 30
|
||||||
|
|
||||||
/*
|
|
||||||
property alias actionButton: __actionButton
|
property alias actionButton: __actionButton
|
||||||
ActionButton {
|
ActionButton {
|
||||||
id: __actionButton
|
id: __actionButton
|
||||||
|
|
@ -98,5 +97,4 @@ inputMethod.keyboardRectangle.y) : 0
|
||||||
|
|
||||||
visible: root.globalDrawer || root.contextDrawer
|
visible: root.globalDrawer || root.contextDrawer
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -67,10 +67,11 @@ OverlayDrawer {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
delegate: BasicListItem {
|
delegate: BasicListItem {
|
||||||
enabled: true
|
|
||||||
checked: modelData.checked
|
checked: modelData.checked
|
||||||
icon: modelData.iconName
|
icon: modelData.iconName
|
||||||
label: model ? model.text : modelData.text
|
label: model ? model.text : modelData.text
|
||||||
|
enabled: model ? model.enabled : modelData.enabled
|
||||||
|
opacity: enabled ? 1.0 : 0.6
|
||||||
onClicked: {
|
onClicked: {
|
||||||
if (modelData && modelData.trigger !== undefined) {
|
if (modelData && modelData.trigger !== undefined) {
|
||||||
modelData.trigger();
|
modelData.trigger();
|
||||||
|
|
|
||||||
|
|
@ -38,9 +38,7 @@ Item {
|
||||||
sourceSize.width: root.width
|
sourceSize.width: root.width
|
||||||
sourceSize.height: root.height
|
sourceSize.height: root.height
|
||||||
}
|
}
|
||||||
/*
|
/* // FIXME: This causes black squares on some GLES drivers, notably on Adreno hardware
|
||||||
* this appears to cause us to show nothing but black squares instead
|
|
||||||
* of icons on some Android devices
|
|
||||||
GammaAdjust {
|
GammaAdjust {
|
||||||
anchors.fill: image
|
anchors.fill: image
|
||||||
source: image
|
source: image
|
||||||
|
|
|
||||||
|
|
@ -45,11 +45,8 @@ Rectangle {
|
||||||
* Defines the contextual actions for the page:
|
* Defines the contextual actions for the page:
|
||||||
* an easy way to assign actions in the right sliding panel
|
* an easy way to assign actions in the right sliding panel
|
||||||
*/
|
*/
|
||||||
property alias contextualActions: internalContextualActions.data
|
property list<QtObject> contextualActions
|
||||||
|
|
||||||
Item {
|
|
||||||
id: internalContextualActions
|
|
||||||
}
|
|
||||||
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
color: "transparent"
|
color: "transparent"
|
||||||
|
|
|
||||||
|
|
@ -29,9 +29,9 @@ MouseArea {
|
||||||
property bool checked: false
|
property bool checked: false
|
||||||
//either Action or QAction should work here
|
//either Action or QAction should work here
|
||||||
property QtObject action
|
property QtObject action
|
||||||
Layout.minimumWidth: Units.iconSizes.large
|
Layout.minimumWidth: Units.iconSizes.medium
|
||||||
Layout.maximumWidth: Layout.minimumWidth
|
Layout.maximumWidth: Layout.minimumWidth
|
||||||
implicitWidth: Units.iconSizes.large
|
implicitWidth: Units.iconSizes.medium
|
||||||
implicitHeight: width
|
implicitHeight: width
|
||||||
drag {
|
drag {
|
||||||
target: button
|
target: button
|
||||||
|
|
@ -52,11 +52,21 @@ MouseArea {
|
||||||
transform: Translate {
|
transform: Translate {
|
||||||
id: translateTransform
|
id: translateTransform
|
||||||
}
|
}
|
||||||
|
property var downTimestamp;
|
||||||
|
property int startX
|
||||||
|
onPressed: {
|
||||||
|
downTimestamp = (new Date()).getTime();
|
||||||
|
startX = button.x
|
||||||
|
}
|
||||||
onReleased: {
|
onReleased: {
|
||||||
if (globalDrawer && x > Math.min(parent.width/4*3, parent.width/2 + globalDrawer.contentItem.width/2)) {
|
//pixel/second
|
||||||
|
var speed = ((button.x - startX) / ((new Date()).getTime() - downTimestamp) * 1000);
|
||||||
|
|
||||||
|
//project where it would be a full second in the future
|
||||||
|
if (globalDrawer && x + speed > Math.min(parent.width/4*3, parent.width/2 + globalDrawer.contentItem.width/2)) {
|
||||||
globalDrawer.open();
|
globalDrawer.open();
|
||||||
contextDrawer.close();
|
contextDrawer.close();
|
||||||
} else if (contextDrawer && x < Math.max(parent.width/4, parent.width/2 - contextDrawer.contentItem.width/2)) {
|
} else if (contextDrawer && x + speed < Math.max(parent.width/4, parent.width/2 - contextDrawer.contentItem.width/2)) {
|
||||||
if (contextDrawer) {
|
if (contextDrawer) {
|
||||||
contextDrawer.open();
|
contextDrawer.open();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue