Commit 9c25757b authored by Nate Graham's avatar Nate Graham
Browse files

[folder view] Smooth out icon size steps

Right now, we have the following icon sizes available:

16 (small)
22 (smallMedium)
32 (medium)
48 (large)
64 (huge)
128 (enormous)

As a result, the differences between the first couple of options are very
small, while the differences between the last two are dramatic. it feels
a bit too abrupt.

This commit removes the smallest size and adds a new 96px size in between 64
and 128 to make the jump less abrupt. Appaopriate 96px places icons were
added in frameworks/breeze-icons!36.

As a result, these are the new icon size options:

22 (smallMedium)
32 (medium)
48 (large)
64 (huge)
96 (large * 2)
128 (enormous)

The default icon size (64) remains the same.

People who were previously using a non-default size that is not the
largest one will experience their icons becoming a bit larger.
(22->32, 32->48, 48->64, 64->96).
parent 3767b67a
...@@ -99,8 +99,8 @@ ...@@ -99,8 +99,8 @@
<default>0</default> <default>0</default>
</entry> </entry>
<entry name="iconSize" type="Int"> <entry name="iconSize" type="Int">
<label>The icon size to use for Folder View icons. One of the list of Plasma icon sizes.</label> <label>The icon size to use for Folder View icons. 0 = 22px (smallMedium); 1 = 32px (medium); 2 = 48px (large); 3 = 64px (huge); 4 = 96px (large * 2); 5 = 128px (enormous)</label>
<default>4</default> <default>3</default>
</entry> </entry>
<entry name="labelWidth" type="Int"> <entry name="labelWidth" type="Int">
<label>The width of the grid cells when using icon view. 0 = Narrow, 1 = Medium, 2 = Wide</label> <label>The width of the grid cells when using icon view. 0 = Narrow, 1 = Medium, 2 = Wide</label>
......
...@@ -32,7 +32,7 @@ PlasmaCore.SvgItem { ...@@ -32,7 +32,7 @@ PlasmaCore.SvgItem {
switch(plasmoid.configuration.iconSize) { switch(plasmoid.configuration.iconSize) {
case 0: return units.iconSizes.small; case 0: return units.iconSizes.small;
case 1: return units.iconSizes.small; case 1: return units.iconSizes.small;
case 2: return units.iconSizes.small; case 2: return units.iconSizes.smallMedium;
case 3: return units.iconSizes.smallMedium; case 3: return units.iconSizes.smallMedium;
case 4: return units.iconSizes.smallMedium; case 4: return units.iconSizes.smallMedium;
case 5: return units.iconSizes.medium; case 5: return units.iconSizes.medium;
......
...@@ -17,10 +17,15 @@ ...@@ -17,10 +17,15 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . *
***************************************************************************/ ***************************************************************************/
var iconSizes = new Array("small", "smallMedium", "medium", "large", "huge", "enormous"); var iconSizes = [units.iconSizes.smallMedium,
units.iconSizes.medium,
units.iconSizes.large,
units.iconSizes.huge,
units.iconSizes.large*2,
units.iconSizes.enormous];
function iconSizeFromTheme(size) { function iconSizeFromTheme(size) {
return units.iconSizes[iconSizes[size]]; return iconSizes[size];
} }
function effectiveNavDirection(flow, layoutDirection, direction) { function effectiveNavDirection(flow, layoutDirection, direction) {
......
// This script updates users' Folder View icon sizes following a change in what
// they mean in https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/111
var allDesktops = desktops();
for (var i = 0; i < allDesktops.length; ++i) {
var desktop = allDesktops[i];
desktop.currentConfigGroup = ["General"];
var currentIconSize = desktop.readConfig("iconSize");
// Don't do anything if there is no value in the config file, since in this
// case, no change is needed because the new default works properly
if (currentIconSize) {
currentIconSize = parseInt(currentIconSize);
// No change needed for iconSize=0 or 5
if (currentIconSize != 0 && currentIconSize != 5) {
print("Current icon size is " + currentIconSize);
var newIconSize = 3;
switch(currentIconSize) {
case 1:
newIconSize = 0;
break;
case 2:
newIconSize = 1;
break;
case 3:
newIconSize = 2;
break;
case 4:
newIconSize = 3;
break;
// We should never reach here, but in case we do anyway, reset to
// the default value
default:
break;
}
desktop.writeConfig("iconSize", newIconSize);
desktop.reloadConfig()
}
}
}
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