on xenial help sign in
Use PreviewActionButton in PreviewActionCombo
889ebbdAlbert Astals
qml/Dash/Previews/PreviewActionCombo.qml+3−6
@@ -35,7 +35,7 @@ Item {
35 text: !expanded ? i18n.tr("More...") : i18n.tr("Less...")
35 text: !expanded ? i18n.tr("More...") : i18n.tr("Less...")
36 gradient: UbuntuColors.orangeGradient
36 gradient: UbuntuColors.orangeGradient
37 onClicked: expanded = !expanded
37 onClicked: expanded = !expanded
38− width: c.maxWidth
38+ width: column.maxWidth
39 }
39 }
40
40
41 Column {
41 Column {
@@ -50,11 +50,8 @@ Item {
50 Repeater {
50 Repeater {
51 id: actionRepeater
51 id: actionRepeater
52
52
53− delegate: Button {
53+ delegate: PreviewActionButton {
54− objectName: "button" + modelData.id
55− text: modelData.label || ""
56− iconSource: modelData.icon || ""
54+ data: modelData
57− gradient: UbuntuColors.orangeGradient
58 height: moreButton.expanded ? implicitHeight : 0
55 height: moreButton.expanded ? implicitHeight : 0
59 width: implicitWidth < parent.width ? parent.width : implicitWidth
56 width: implicitWidth < parent.width ? parent.width : implicitWidth
60 visible: height > 0
57 visible: height > 0
tests/qmltests/Dash/Previews/tst_PreviewActions.qml+3−3
@@ -57,21 +57,21 @@ Rectangle {
57 id: oneAction
57 id: oneAction
58 widgetId: "button"
58 widgetId: "button"
59 widgetData: actionDataOneAction
59 widgetData: actionDataOneAction
60− onTriggered: console.log("triggered", widgetId, actionId, data);
60+ onTriggered: console.log("triggered", widgetId, actionId);
61 }
61 }
62
62
63 PreviewActions {
63 PreviewActions {
64 id: buttonAndCombo
64 id: buttonAndCombo
65 widgetId: "buttonAndCombo"
65 widgetId: "buttonAndCombo"
66 widgetData: actionDataFiveActions
66 widgetData: actionDataFiveActions
67− onTriggered: console.log("triggered", widgetId, actionId, data);
67+ onTriggered: console.log("triggered", widgetId, actionId);
68 }
68 }
69
69
70 PreviewActions {
70 PreviewActions {
71 id: twoActions
71 id: twoActions
72 widgetId: "2buttons"
72 widgetId: "2buttons"
73 widgetData: actionDataTwoActions
73 widgetData: actionDataTwoActions
74− onTriggered: console.log("triggered", widgetId, actionId, data);
74+ onTriggered: console.log("triggered", widgetId, actionId);
75 }
75 }
76 }
76 }
77
77