Commit bad5d2b8 authored by Nate Graham's avatar Nate Graham 🔩

[Folder View] Implement a user-configurable setting for label width

Summary:
It seems impossible to satisfy everyone's preferences regarding label width in Folder
View. Some people want small icons with narrow labels (403412). Other people want small
icons with wide labels (379432). There have been other complaints in the past too, which
have led to the current settings, but because these preferences are opposed, the more we
tweak the settings to please one group of people, the more we annoy another.

Accordingly, This patch implements a user-configurable setting to determine the label width
for Folder View items in Icons view. This should put the matter to rest once and for all.

FEATURE: 403094
FIXED-IN: 5.16

Test Plan:
Default settings (large icons + medium label width): {F6758619}

Small icons + narrow labels: {F6758622}

Small icons + medium labels: {F6758624}

SmallMedium icons + medium labels: {F6758625}

Large icons + wide labels: {F6758626}

Reviewers: hein, #plasma, #vdg

Reviewed By: hein, #plasma

Subscribers: broulik, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D20370
parent e74e344f
......@@ -102,6 +102,10 @@
<label>The icon size to use for Folder View icons. One of the list of Plasma icon sizes.</label>
<default>4</default>
</entry>
<entry name="labelWidth" type="Int">
<label>The width of the grid cells when using icon view. 0 = Narrow, 1 = Medium, 2 = Wide</label>
<default>1</default>
</entry>
<entry name="textLines" type="Int">
<label>The (maximum) number of lines of text to use below Folder View icons.</label>
<default>2</default>
......
......@@ -56,6 +56,7 @@ Item {
property alias cfg_previewPlugins: previewPluginsDialog.previewPlugins
property alias cfg_viewMode: viewMode.currentIndex
property alias cfg_iconSize: iconSize.value
property alias cfg_labelWidth: labelWidth.currentIndex
property alias cfg_textLines: textLines.value
readonly property bool lockedByKiosk: !KAuthorized.authorize("editable_desktop_icons")
......@@ -228,7 +229,7 @@ Item {
id: iconSize
visible: !isPopup || viewMode.currentIndex === 1
Kirigami.FormData.label: i18n("Size:")
Kirigami.FormData.label: i18n("Icon size:")
minimumValue: 0
maximumValue: 5
......@@ -256,6 +257,19 @@ Item {
}
}
ComboBox {
id: labelWidth
visible: !isPopup || viewMode.currentIndex === 1
Kirigami.FormData.label: i18n("Label width:")
model: [
i18n("Narrow"),
i18n("Medium"),
i18n("Wide")
]
}
SpinBox {
id: textLines
visible: !isPopup || viewMode.currentIndex === 1
......
......@@ -607,7 +607,7 @@ FocusScope {
} else {
var iconWidth = iconSize + (2 * units.largeSpacing) + (2 * units.smallSpacing);
if (root.isContainment && isRootView && scrollArea.viewportWidth > 0) {
var minIconWidth = Math.max(iconWidth, units.iconSizes.small * 6);
var minIconWidth = Math.max(iconWidth, units.iconSizes.small * ((plasmoid.configuration.labelWidth * 2) + 4));
var extraWidth = calcExtraSpacing(minIconWidth, scrollArea.viewportWidth);
return minIconWidth + extraWidth;
} else {
......
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