Changeset View
Changeset View
Standalone View
Standalone View
applets/kicker/package/contents/ui/CompactRepresentation.qml
Show First 20 Lines • Show All 63 Lines • ▼ Show 20 Line(s) | 61 | } else { | |||
---|---|---|---|---|---|
64 | root.Layout.minimumHeight = units.iconSizes.small; | 64 | root.Layout.minimumHeight = units.iconSizes.small; | ||
65 | root.Layout.maximumHeight = inPanel ? units.iconSizeHints.panel : -1; | 65 | root.Layout.maximumHeight = inPanel ? units.iconSizeHints.panel : -1; | ||
66 | } | 66 | } | ||
67 | } | 67 | } | ||
68 | 68 | | |||
69 | Connections { | 69 | Connections { | ||
70 | target: units.iconSizeHints | 70 | target: units.iconSizeHints | ||
71 | 71 | | |||
72 | onPanelChanged: updateSizeHints() | 72 | onPanelChanged: root.updateSizeHints() | ||
73 | } | 73 | } | ||
74 | 74 | | |||
75 | PlasmaCore.IconItem { | 75 | PlasmaCore.IconItem { | ||
76 | id: buttonIcon | 76 | id: buttonIcon | ||
77 | 77 | | |||
78 | anchors.fill: parent | 78 | anchors.fill: parent | ||
79 | 79 | | |||
80 | readonly property double aspectRatio: (vertical ? implicitHeight / implicitWidth | 80 | readonly property double aspectRatio: (root.vertical ? implicitHeight / implicitWidth | ||
81 | : implicitWidth / implicitHeight) | 81 | : implicitWidth / implicitHeight) | ||
82 | 82 | | |||
83 | source: useCustomButtonImage ? plasmoid.configuration.customButtonImage : plasmoid.configuration.icon | 83 | source: root.useCustomButtonImage ? plasmoid.configuration.customButtonImage : plasmoid.configuration.icon | ||
84 | 84 | | |||
85 | active: mouseArea.containsMouse && !justOpenedTimer.running | 85 | active: mouseArea.containsMouse && !justOpenedTimer.running | ||
86 | 86 | | |||
87 | smooth: true | 87 | smooth: true | ||
88 | 88 | | |||
89 | // A custom icon could also be rectangular. However, if a square, custom, icon is given, assume it | 89 | // A custom icon could also be rectangular. However, if a square, custom, icon is given, assume it | ||
90 | // to be an icon and round it to the nearest icon size again to avoid scaling artifacts. | 90 | // to be an icon and round it to the nearest icon size again to avoid scaling artifacts. | ||
91 | roundToIconSize: !useCustomButtonImage || aspectRatio === 1 | 91 | roundToIconSize: !root.useCustomButtonImage || aspectRatio === 1 | ||
92 | 92 | | |||
93 | onSourceChanged: updateSizeHints() | 93 | onSourceChanged: root.updateSizeHints() | ||
94 | } | 94 | } | ||
95 | 95 | | |||
96 | MouseArea | 96 | MouseArea | ||
97 | { | 97 | { | ||
98 | id: mouseArea | 98 | id: mouseArea | ||
99 | property bool wasExpanded: false; | 99 | property bool wasExpanded: false; | ||
100 | 100 | | |||
101 | anchors.fill: parent | 101 | anchors.fill: parent | ||
102 | 102 | | |||
103 | hoverEnabled: !dashWindow || !dashWindow.visible | 103 | hoverEnabled: !root.dashWindow || !root.dashWindow.visible | ||
104 | 104 | | |||
105 | onPressed: { | 105 | onPressed: { | ||
106 | if (!isDash) { | 106 | if (!isDash) { | ||
107 | wasExpanded = plasmoid.expanded | 107 | wasExpanded = plasmoid.expanded | ||
108 | } | 108 | } | ||
109 | } | 109 | } | ||
110 | 110 | | |||
111 | onClicked: { | 111 | onClicked: { | ||
112 | if (isDash) { | 112 | if (isDash) { | ||
113 | dashWindow.toggle(); | 113 | root.dashWindow.toggle(); | ||
114 | justOpenedTimer.start(); | 114 | justOpenedTimer.start(); | ||
115 | } else { | 115 | } else { | ||
116 | plasmoid.expanded = !wasExpanded; | 116 | plasmoid.expanded = !wasExpanded; | ||
117 | } | 117 | } | ||
118 | } | 118 | } | ||
119 | } | 119 | } | ||
120 | 120 | | |||
121 | Component.onCompleted: { | 121 | Component.onCompleted: { | ||
Show All 9 Lines |