Verified Commit 56dbb54b authored by Fushan Wen's avatar Fushan Wen 💬
Browse files

Revert "applets/tasmanager: consider `devicePixelRatio` in font height"

This reverts commit 98e0e17a.
parent 142ee970
Pipeline #207268 passed with stage
in 3 minutes and 30 seconds
......@@ -130,23 +130,28 @@ function preferredMaxWidth() {
function preferredMinHeight() {
// TODO FIXME UPSTREAM: Port to proper font metrics for descenders once we have access to them.
return PlasmaCore.Theme.mSize(PlasmaCore.Theme.defaultFont).height / tasks.devicePixelRatio + 4;
return PlasmaCore.Theme.mSize(PlasmaCore.Theme.defaultFont).height + 4;
}
function preferredMaxHeight() {
let adjustedHeight;
if (tasks.vertical) {
// Do not allow the preferred icon size to exceed the width of
// the vertical task manager.
if (tasks.iconsOnly) {
adjustedHeight = tasks.width;
} else {
adjustedHeight = Math.max(PlasmaCore.Theme.mSize(PlasmaCore.Theme.defaultFont).height / tasks.devicePixelRatio, PlasmaCore.Units.iconSizes.medium);
}
return verticalMargins() + Math.min(tasks.width, adjustedHeight);
return verticalMargins() +
Math.min(
// Do not allow the preferred icon size to exceed the width of
// the vertical task manager.
tasks.width,
tasks.iconsOnly ? tasks.width :
Math.max(
PlasmaCore.Theme.mSize(PlasmaCore.Theme.defaultFont).height,
PlasmaCore.Units.iconSizes.medium
)
);
} else {
adjustedHeight = Math.min(PlasmaCore.Units.iconSizes.small, PlasmaCore.Theme.mSize(PlasmaCore.Theme.defaultFont).height / tasks.devicePixelRatio) * 3
return verticalMargins() + adjustedHeight;
return verticalMargins() +
Math.min(
PlasmaCore.Units.iconSizes.small * 3,
PlasmaCore.Theme.mSize(PlasmaCore.Theme.defaultFont).height *
3);
}
}
......
......@@ -6,7 +6,6 @@
import QtQuick 2.15
import QtQuick.Layouts 1.15
import QtQuick.Window 2.15
import QtQml 2.15
import org.kde.plasma.plasmoid 2.0
......@@ -24,7 +23,6 @@ MouseArea {
anchors.fill: parent
hoverEnabled: true
readonly property real devicePixelRatio: Screen.devicePixelRatio
readonly property bool shouldShirnkToZero: !LayoutManager.logicalTaskCount()
property bool vertical: plasmoid.formFactor === PlasmaCore.Types.Vertical
property bool iconsOnly: plasmoid.pluginName === "org.kde.plasma.icontasks"
......
Supports Markdown
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