~ci-train-bot/unity8/unity8-ubuntu-zesty-2404

« back to all changes in this revision

Viewing changes to qml/Dash/Previews/PreviewActions.qml

  • Committer: Nick Dedekind
  • Date: 2016-11-28 13:46:55 UTC
  • mfrom: (2704 unity8)
  • mto: This revision was merged to the branch mainline in revision 2752.
  • Revision ID: nick.dedekind@canonical.com-20161128134655-vd70a64pbci1b4oc
merged with trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
 
28
28
    implicitHeight: row.height + units.gu(1)
29
29
    readonly property var actions: root.widgetData ? root.widgetData["actions"] : null
 
30
    readonly property real maxButtonWidth: (width - units.gu(1)) / 2
30
31
 
31
32
    Row {
32
33
        id: row
40
41
            readonly property bool button: root.actions && root.actions.length == 2
41
42
            readonly property bool combo: root.actions && root.actions.length > 2
42
43
            source: button ? "PreviewActionButton.qml" : (combo ? "PreviewActionCombo.qml" : "")
43
 
            width: (root.width - units.gu(1)) / 2
 
44
            width: Math.min(root.maxButtonWidth, implicitWidth + units.gu(2))
44
45
            onLoaded: {
45
46
                if (button) {
46
47
                    item.data = Qt.binding(function() { return root.actions[1]; });
65
66
            data: visible ? root.actions[0] : null
66
67
            visible: root.actions && root.actions.length > 0
67
68
            onTriggeredAction: root.triggered(root.widgetId, actionData.id, actionData)
68
 
            width: (root.width - units.gu(1)) / 2
 
69
            width: Math.min(root.maxButtonWidth, implicitWidth + units.gu(2))
69
70
            color: root.scopeStyle ? root.scopeStyle.previewButtonColor : theme.palette.normal.positive
70
71
        }
71
72
    }