2014-01-23 04:07:05 +01:00
/ *
2020-08-13 21:08:54 +02:00
SPDX - FileCopyrightText: 2014 Sebastian Kügler < sebas @ kde . org >
SPDX - License - Identifier: GPL - 2.0 - or - later
* /
2014-01-23 04:07:05 +01:00
import QtQuick 2.1
import org . kde . plasma . core 2.0 as PlasmaCore
import org . kde . plasma . components 2.0 as PlasmaComponents
import org . kde . plasma . extras 2.0 as PlasmaExtras
2014-03-25 17:10:25 +01:00
import org . kde . kquickcontrolsaddons 2.0 as KQuickControlsAddons
2014-01-23 04:07:05 +01:00
Item {
property int cheight: 48
property int cwidth: themePage . width / 1.2
2021-03-05 20:22:42 +01:00
property int _m : PlasmaCore . Units . gridUnit / 2 * PlasmaCore . Units . devicePixelRatio
2014-01-23 04:07:05 +01:00
2014-03-26 01:10:41 +01:00
anchors {
2021-03-05 20:22:42 +01:00
margins: PlasmaCore . Units . largeSpacing
2014-03-26 01:10:41 +01:00
}
2014-01-23 04:07:05 +01:00
Column {
id: col
spacing: _m
anchors {
margins: _m
top: parent . top
left: parent . left
right: parent . right
}
2020-02-12 16:32:53 +01:00
PlasmaExtras . Heading {
2014-01-23 04:07:05 +01:00
width: parent . width
elide: Text . ElideRight
2020-02-12 16:32:53 +01:00
level: 1
2014-01-23 04:07:05 +01:00
text: "Scaling Test"
font.pointSize: cheatLabel . font . pointSize * 2
}
}
PlasmaComponents . Label {
id: cheatLabel
2014-01-27 18:22:54 +01:00
text: "Cheating with the font size. This label scales with the devicePixelRatio <b>on top of</b> font rendering. Just to show how text scaling can work dynamically. Normal labels scale with the font size. For demonstration purposes we're faking scaled fonts here, to show how layouts' flows change."
2021-04-08 17:20:30 +02:00
font.pointSize: PlasmaCore . Theme . defaultFont . pointSize * PlasmaCore . Units . devicePixelRatio / 1.8
2014-01-23 04:07:05 +01:00
wrapMode: Text . WordWrap
anchors {
margins: _m
top: col . bottom
left: parent . left
right: apeImage . left
}
}
Image {
id: apeImage
objectName: "apeImage"
2021-03-05 20:22:42 +01:00
height: parent . height / 6 * PlasmaCore . Units . devicePixelRatio
2014-01-23 04:07:05 +01:00
//width: height
anchors {
top: cheatLabel . top
right: parent . right
rightMargin: _m
}
fillMode: Image . PreserveAspectFit
source: "../images/orangutan.jpg"
}
2014-01-25 02:51:56 +01:00
Flow {
anchors {
left: parent . left
2014-01-27 18:22:54 +01:00
top: cheatLabel . height > apeImage . height ? cheatLabel.bottom : apeImage . bottom
2021-03-05 20:22:42 +01:00
topMargin: PlasmaCore . Units . largeSpacing
2014-01-25 02:51:56 +01:00
right: parent . right
}
//height: _h
//width: parent.width
2021-03-05 20:22:42 +01:00
spacing: PlasmaCore . Units . smallSpacing
2014-01-23 04:07:05 +01:00
2014-01-25 02:51:56 +01:00
PlasmaCore . IconItem {
source: "configure"
2021-03-05 20:22:42 +01:00
width: PlasmaCore . Units . iconSizes . small
2014-01-25 02:51:56 +01:00
height: width
}
PlasmaCore . IconItem {
source: "dialog-ok"
2021-03-05 20:22:42 +01:00
width: PlasmaCore . Units . iconSizes . smallMedium
2014-01-25 02:51:56 +01:00
height: width
}
PlasmaCore . IconItem {
source: "resize-tr2bl"
2021-03-05 20:22:42 +01:00
width: PlasmaCore . Units . iconSizes . medium
2014-01-25 02:51:56 +01:00
height: width
}
PlasmaCore . IconItem {
source: "akonadi"
2021-03-05 20:22:42 +01:00
width: PlasmaCore . Units . iconSizes . large
2014-01-25 02:51:56 +01:00
height: width
}
PlasmaCore . IconItem {
source: "clock"
2021-03-05 20:22:42 +01:00
width: PlasmaCore . Units . iconSizes . huge
2014-01-25 02:51:56 +01:00
height: width
}
2014-03-25 17:10:25 +01:00
// KQuickControlsAddons.QIconItem {
2014-01-25 03:41:45 +01:00
// icon: "preferences-desktop-icons"
2021-03-05 20:22:42 +01:00
// width: PlasmaCore.Units.iconSizes.enormous
2014-01-25 03:41:45 +01:00
// height: width
// }
2014-01-25 02:51:56 +01:00
}
2014-01-23 04:07:05 +01:00
}