Skip to content

KFileWidget: allow icon sizes to go up to 512

Ahmad Samir requested to merge work/ahmad/preview-size into master

Nowadays monitors are getting bigger, and resolutions are getting higher, so bigger icon sizes make sense for the bigger image previews use-case.

Change the icons slider to only allow standard icon sizes:

  • with the range being 16-512, the slider handling code would be much more complicated to be usable (would have to use a logarithmic scale)
  • icons look best when at a standard size (otherwise scaling is involved and they don't look as good)
  • this is the "open file dialog", typically one would use this dialog for less than 1 minute, to open/save a file, so the fine-grained icon size control isn't needed, and 16, 22, 32, 48...etc pretty much cover a wide range already.

This is going back to not having 1:1 (1px icon size == 1 step on the slider) scale on the slider, but instead of having the logic to handle that in KDirOperator, I left KDirOperator as-is using setIconSize(actual-icon- size), and instead implemented the logic in KFileWidget by tweaking the slider handling code, I think it's simpler that way.

Also use the new enum values from KIconLoader::StdSizes.

BUG: 452139 FIXED-IN: 5.94

Merge request reports