Commit 16ff74c0 authored by Nate Graham's avatar Nate Graham 🔩
Browse files

Port task switchers to use units.iconSizes

This makes them high DPI compatible instantly as those constants are
themselves high DPI compatible. It's always better to use them rather
than specifying hardcoded integer sizes.

BUG: 422547
FIXED-IN: 5.19.3
parent c9037d5f
......@@ -47,7 +47,7 @@ KWin.Switcher {
IconTabBox {
id: icons
model: tabBox.model
iconSize: 128
iconSize: units.iconSizes.enormous
height: iconSize + icons.margins.top + icons.margins.bottom
anchors {
top: parent.top
......
......@@ -80,8 +80,8 @@ KWin.Switcher {
QIconItem {
id: iconItem
icon: model.icon
width: 16
height: 16
width: units.iconSizes.small
height: units.iconSizes.small
anchors {
verticalCenter: parent.verticalCenter
left: parent.left
......
......@@ -66,8 +66,8 @@ KWin.Switcher {
QIconItem {
id: iconItem
icon: model.icon
width: 32
height: 32
width: units.iconSizes.medium
height: units.iconSizes.medium
state: index == listView.currentIndex ? QIconItem.ActiveState : QIconItem.DisabledState
anchors {
verticalCenter: parent.verticalCenter
......
......@@ -99,7 +99,7 @@ KWin.Switcher {
QIconItem {
id: iconItem
icon: model.icon
property int iconSize: 32
property int iconSize: units.iconSizes.medium
width: iconSize
height: iconSize
Layout.alignment: Qt.AlignVCenter | Qt.AlignRight
......
......@@ -47,7 +47,7 @@ KWin.Switcher {
IconTabBox {
id: icons
model: tabBox.model
iconSize: 16
iconSize: units.iconSizes.small
height: iconSize + icons.margins.top + icons.margins.bottom
anchors {
top: parent.top
......
......@@ -126,7 +126,7 @@ KWin.Switcher {
model: tabBox.model
property int iconSize: 22 * units.devicePixelRatio
property int iconSize: units.iconSizes.smallMedium
property int captionRowHeight: 30 * units.devicePixelRatio // The close button is 30x30 in Breeze
property int thumbnailWidth: 300 * units.devicePixelRatio
property int thumbnailHeight: thumbnailWidth * (1.0/dialogMainItem.screenFactor)
......
......@@ -58,7 +58,7 @@ KWin.Switcher {
id: thumbnailListView
model: tabBox.model
orientation: ListView.Horizontal
property int thumbnailWidth: 300
property int thumbnailWidth: 300 * units.devicePixelRatio
height: thumbnailWidth * (1.0/dialogMainItem.screenFactor) + hoverItem.margins.bottom + hoverItem.margins.top
spacing: 5
highlightMoveDuration: 0
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment