summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Hein <[email protected]>2017-04-26 19:49:19 +0900
committerEike Hein <[email protected]>2017-04-26 20:54:47 +0900
commitad08c43ccaa28005750f4a04e2283cb78ecdbed6 (patch)
tree5bf4fd1c786915beba68b09cb01b9da441e2439e
parent25a2a4b30ded80b6ecee8eaf83d62082b437da20 (diff)
Configurable icon size
Summary: This patch uses the new units.iconSizeHints.panel API to limit the icon size to what the user sets for panel icons in System Settings, avoiding them taking up too much space, particularly in wide vertical panels. See D4550 for a similar change. CCBUG:378443 A similar change will need to be done for Kickoff, which uses the default CompactRepr instead. Depends on D5593. Reviewers: #plasma, mart Subscribers: plasma-devel Tags: #plasma Differential Revision: https://phabricator.kde.org/D5592
-rw-r--r--applets/kicker/package/contents/ui/CompactRepresentation.qml12
1 files changed, 8 insertions, 4 deletions
diff --git a/applets/kicker/package/contents/ui/CompactRepresentation.qml b/applets/kicker/package/contents/ui/CompactRepresentation.qml
index 592ebbe..a69f5f6 100644
--- a/applets/kicker/package/contents/ui/CompactRepresentation.qml
+++ b/applets/kicker/package/contents/ui/CompactRepresentation.qml
@@ -25,6 +25,10 @@ import org.kde.plasma.core 2.0 as PlasmaCore
Item {
id: root
+ readonly property bool inPanel: (plasmoid.location == PlasmaCore.Types.TopEdge
+ || plasmoid.location == PlasmaCore.Types.RightEdge
+ || plasmoid.location == PlasmaCore.Types.BottomEdge
+ || plasmoid.location == PlasmaCore.Types.LeftEdge)
readonly property bool vertical: (plasmoid.formFactor == PlasmaCore.Types.Vertical)
readonly property bool useCustomButtonImage: (plasmoid.configuration.useCustomButtonImage
&& plasmoid.configuration.customButtonImage.length != 0)
@@ -46,19 +50,19 @@ Item {
root.Layout.minimumHeight = scaledHeight;
root.Layout.maximumHeight = scaledHeight;
root.Layout.minimumWidth = units.iconSizes.small;
- root.Layout.maximumWidth = undefined;
+ root.Layout.maximumWidth = inPanel ? units.iconSizeHints.panel : undefined;
} else {
var scaledWidth = Math.floor(parent.height * (buttonIcon.implicitWidth / buttonIcon.implicitHeight));
root.Layout.minimumWidth = scaledWidth;
root.Layout.maximumWidth = scaledWidth;
root.Layout.minimumHeight = units.iconSizes.small;
- root.Layout.maximumHeight = undefined;
+ root.Layout.maximumHeight = inPanel ? units.iconSizeHints.panel : undefined;
}
} else {
root.Layout.minimumWidth = units.iconSizes.small;
- root.Layout.maximumWidth = undefined;
+ root.Layout.maximumWidth = inPanel ? units.iconSizeHints.panel : undefined;
root.Layout.minimumHeight = units.iconSizes.small
- root.Layout.maximumHeight = undefined;
+ root.Layout.maximumHeight = inPanel ? units.iconSizeHints.panel : undefined;
}
}