Changeset View
Changeset View
Standalone View
Standalone View
kcms/lookandfeel/package/contents/ui/main.qml
Show All 12 Lines | 1 | /* | |||
---|---|---|---|---|---|
13 | You should have received a copy of the GNU Library General Public License | 13 | You should have received a copy of the GNU Library General Public License | ||
14 | along with this library; see the file COPYING.LIB. If not, write to | 14 | along with this library; see the file COPYING.LIB. If not, write to | ||
15 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 15 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
16 | Boston, MA 02110-1301, USA. | 16 | Boston, MA 02110-1301, USA. | ||
17 | */ | 17 | */ | ||
18 | 18 | | |||
19 | import QtQuick 2.1 | 19 | import QtQuick 2.1 | ||
20 | import QtQuick.Layouts 1.1 | 20 | import QtQuick.Layouts 1.1 | ||
21 | import QtQuick.Window 2.2 | ||||
21 | import QtQuick.Controls 1.0 as QtControls | 22 | import QtQuick.Controls 1.0 as QtControls | ||
22 | import org.kde.kquickcontrolsaddons 2.0 | 23 | import org.kde.kquickcontrolsaddons 2.0 | ||
23 | import QtQuick.Controls.Private 1.0 | 24 | import QtQuick.Controls.Private 1.0 | ||
24 | //We need units from it | 25 | //We need units from it | ||
25 | import org.kde.plasma.core 2.0 as PlasmaCore | 26 | import org.kde.plasma.core 2.0 as PlasmaCore | ||
26 | import org.kde.plasma.components 2.0 as PlasmaComponents | 27 | import org.kde.plasma.components 2.0 as PlasmaComponents | ||
27 | import org.kde.kcm 1.0 | 28 | import org.kde.kcm 1.0 | ||
28 | 29 | | |||
▲ Show 20 Lines • Show All 107 Lines • ▼ Show 20 Line(s) | 136 | Timer { | |||
136 | interval: 1000 // FIXME TODO: Use platform value for tooltip activation delay. | 137 | interval: 1000 // FIXME TODO: Use platform value for tooltip activation delay. | ||
137 | 138 | | |||
138 | running: parent.containsMouse && !parent.pressedButtons | 139 | running: parent.containsMouse && !parent.pressedButtons | ||
139 | 140 | | |||
140 | onTriggered: { | 141 | onTriggered: { | ||
141 | Tooltip.showText(parent, Qt.point(parent.mouseX, parent.mouseY), model.display); | 142 | Tooltip.showText(parent, Qt.point(parent.mouseX, parent.mouseY), model.display); | ||
142 | } | 143 | } | ||
143 | } | 144 | } | ||
145 | PlasmaComponents.ToolButton { | ||||
davidedmundson: Why the Plasma one? Everything else is QQC in this file? | |||||
as explained in the message, is purely an estetic thing, there the plasma one is fine as is on top of the thumbnail, that is an area where the qstyle control wouldn't visually work at all. mart: as explained in the message, is purely an estetic thing, there the plasma one is fine as is on… | |||||
146 | anchors { | ||||
147 | top: parent.top | ||||
148 | right: parent.right | ||||
149 | margins: units.smallSpacing | ||||
150 | } | ||||
151 | visible: model.fullScreenPreview != "" | ||||
152 | iconSource: "media-playback-start" | ||||
153 | tooltip: i18n("Test Splashscreen") | ||||
154 | flat: false | ||||
155 | onClicked: { | ||||
156 | previewWindow.url = model.fullScreenPreview; | ||||
157 | previewWindow.showFullScreen(); | ||||
158 | } | ||||
159 | opacity: parent.containsMouse ? 1 : 0 | ||||
160 | Behavior on opacity { | ||||
161 | PropertyAnimation { | ||||
162 | duration: units.longDuration | ||||
163 | easing.type: Easing.OutQuad | ||||
164 | } | ||||
165 | } | ||||
166 | } | ||||
144 | } | 167 | } | ||
145 | } | 168 | } | ||
146 | } | 169 | } | ||
147 | Timer { | 170 | Timer { | ||
148 | id: makeCurrentTimer | 171 | id: makeCurrentTimer | ||
149 | interval: 100 | 172 | interval: 100 | ||
150 | repeat: false | 173 | repeat: false | ||
151 | property int pendingIndex | 174 | property int pendingIndex | ||
Show All 31 Lines | 196 | RowLayout { | |||
183 | QtControls.Button { | 206 | QtControls.Button { | ||
184 | anchors.right: parent.right | 207 | anchors.right: parent.right | ||
185 | text: i18n("Get New Looks...") | 208 | text: i18n("Get New Looks...") | ||
186 | iconName: "get-hot-new-stuff" | 209 | iconName: "get-hot-new-stuff" | ||
187 | onClicked: kcm.getNewStuff(); | 210 | onClicked: kcm.getNewStuff(); | ||
188 | } | 211 | } | ||
189 | } | 212 | } | ||
190 | } | 213 | } | ||
214 | | ||||
215 | Window { | ||||
216 | id: previewWindow | ||||
217 | property alias url: previewImage.source | ||||
218 | color: Qt.rgba(0, 0, 0, 0.7) | ||||
219 | MouseArea { | ||||
220 | anchors.fill: parent | ||||
221 | Image { | ||||
222 | id: previewImage | ||||
223 | anchors.centerIn: parent | ||||
224 | fillMode: Image.PreserveAspectFit | ||||
225 | width: Math.min(parent.width, sourceSize.width) | ||||
226 | height: Math.min(parent.height, sourceSize.height) | ||||
227 | } | ||||
228 | onClicked: previewWindow.visible = false; | ||||
229 | QtControls.ToolButton { | ||||
230 | anchors { | ||||
231 | top: parent.top | ||||
232 | right: parent.right | ||||
233 | } | ||||
234 | iconName: "window-close" | ||||
235 | onClicked: previewWindow.visible = false; | ||||
236 | } | ||||
237 | } | ||||
238 | } | ||||
191 | } | 239 | } |
Why the Plasma one? Everything else is QQC in this file?