Bug 168480 - applications do not respect the size of icons in toolbars
Summary: applications do not respect the size of icons in toolbars
Status: RESOLVED FIXED
Alias: None
Product: kdelibs
Classification: Frameworks and Libraries
Component: kdeui (show other bugs)
Version: 4.1
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: kdelibs bugs
URL:
Keywords:
: 152266 167280 175212 178018 182564 189348 190778 193618 198984 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-08-06 09:18 UTC by Cyrill Helg
Modified: 2010-12-12 20:42 UTC (History)
17 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
dolphinrc (1.50 KB, text/plain)
2009-01-25 16:25 UTC, Martin van Es
Details
kdeglobals (2.99 KB, text/plain)
2009-01-25 16:25 UTC, Martin van Es
Details
ktoolbar.cpp.patch (397 bytes, patch)
2009-01-25 22:43 UTC, Daniel Dumitrache
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Cyrill Helg 2008-08-06 09:18:45 UTC
Version:           unknown (using 4.1.1 (KDE 4.1.0 (4.1 >= 20080722)), Gentoo)
Compiler:          i686-pc-linux-gnu-gcc
OS:                Linux (i686) release 2.6.26-rc9-zen1-IBM-T43

When I change the icon size in the main toolbar in kontact to small, then close kontact and start it again, the size is default again. So its not saved properly.
Comment 1 Cyrill Helg 2008-08-06 09:31:25 UTC
this might be a kdelibs issue, as I found out that it happens in kopete too.
Comment 2 Cyrill Helg 2008-08-06 09:55:39 UTC
Furthermore settings icon size in systemsettings has no effect.

steps to reproduce:

1. Go to systemsettings->appeareance->icons->advanced->"main toolbar"
2. Change the icons to something else than the default.
3. Open your kopete, kontact whatever and notice that the icons still have the default size :(

Comment 3 George Kiagiadakis 2008-08-06 10:02:51 UTC
I can confirm that this happens in any kde application. This must be a kdelibs bug. Setting the default toolbar icon size from systemsettings doesn't work too. KMainWindow seems to always load 22x22 icons without checking the settings.
Comment 4 George Kiagiadakis 2008-08-23 11:50:18 UTC
One part of the problem is now fixed in trunk... http://websvn.kde.org/?view=rev&revision=849092

Toolbars now remember their settings. However, they still don't respect the size from systemsettings (see comment 2).
Comment 5 Simon St James 2008-08-27 16:57:49 UTC
The bug report for the "not respecting system settings" bug is here:

https://bugs.kde.org/show_bug.cgi?id=169067
Comment 6 Cyrill Helg 2008-09-29 20:19:29 UTC
I don't know if its a config mess probblem here, but with current trunk, applications still do not remember the icon size... :(
Comment 7 Cyrill Helg 2008-10-06 21:45:12 UTC
I found out that the remembering only works if the icon size is set to default size (22) in systemsettings for toolbars. Otherwise this bug still exists. So there is a mess somewhere in systemsettings.

I hope someone can sort out this until the release of 4.2.
Comment 8 Cyrill Helg 2008-11-15 13:47:55 UTC
This seems to be a dup of https://bugs.kde.org/show_bug.cgi?id=167280
Comment 9 George Kiagiadakis 2008-11-15 14:15:56 UTC
*** Bug 167280 has been marked as a duplicate of this bug. ***
Comment 10 George Kiagiadakis 2008-11-15 14:28:06 UTC
This bug is still present. The problem is that if the toolbar size that is set in systemsettings as the default is chosen in an application, when the application restarts, it loads the hard-coded 22x22 default.

To reproduce:
1) Set the size to 32x32 in systemsettings. Note that the applications will still use 22x22 (that's bug 169067).
2) Open konqueror and set the size to 16x16 or 48x48 and notice that if you close it and reopen it, it will remember it.
3) Now set the size to 32x32 in konqueror (which is the same as chosen in systemsettings!), close it and reopen it. You will notice that it loads in 22x22.

Confirmed with kde 4.2 trunk r884287.
Comment 11 George Kiagiadakis 2008-12-18 14:31:11 UTC
*** Bug 178018 has been marked as a duplicate of this bug. ***
Comment 12 Dario Andres 2009-01-02 14:37:08 UTC
Here using:

Qt: 4.4.3 + qt-copy-patches-889120
KDE: 4.1.86 (KDE 4.1.86 (KDE 4.2 >= 20081221))
kdelibs svn rev. 904448 / kdebase svn rev. 904448
on ArchLinux x86_64 - Kernel 2.6.27.10

I can't reproduce the bug following the steps in comment 10.
@George: can you still reproduce it with an updated build ?
Comment 13 Dario Andres 2009-01-02 14:41:45 UTC
Also, this report can be marked as duplicate of bug 152266
Comment 14 George Kiagiadakis 2009-01-02 17:41:38 UTC
*** Bug 152266 has been marked as a duplicate of this bug. ***
Comment 15 George Kiagiadakis 2009-01-02 17:45:59 UTC
(In reply to comment #13)
> Also, this report can be marked as duplicate of bug 152266

... or vice versa, as bug 152266 is not very clear to me and mixes up many issues in the comments... :)

The bug is still reproducable in svn rev 903389, however I forgot to mention in comment 10 that if you are testing the bug with the main toolbar of the application, you have to change the size setting for "Main Toolbar" from systemsettings or else the bug doesn't appear. Apparently the main toolbar of every application has different settings from all the other toolbars....
Comment 16 Daniel Dumitrache 2009-01-25 14:21:36 UTC
I've checked the bug report against KDE 4.2.0 and it seems it's still not fixed. 

The toolbar icon size from systemsettings is ignored by all applications. Changing the icon size for one application works until the application is restarted, after the restart the new settings are lost.
Comment 17 Simon St James 2009-01-25 15:00:38 UTC
Ok, I'm going to have another stab at fixing this and related bugs, and I'll ask for help on kdecore to see if we can get some more experienced brains than mine interested.  I'm completely unable to reproduce this particular part though:

"Changing the icon size for one application works until the application is
restarted"

so I'll probably be asking for a list of applications this affects (I've tried it with Dolphin, Konqueror and Kwrite so far, and all worked correctly - the changed sizes were remembered when restarting the applications) and maybe some config files.
Comment 18 Martin van Es 2009-01-25 15:17:20 UTC
The only feedback I can add is that I'm a real-estate freak so I have set ALL icon sizes in settings to 16, except those on the desktop (32).
What I get in applications is 22 and if I set them to 16 by hand, they're reset to 22 the next time the app starts.

On a sidenote: the 'Text position: Only icons' setting is also not respected. All taskbars show icons+text to start with. But if I change *that* setting in the application it *is* remembered the next time.
Comment 19 Simon St James 2009-01-25 15:58:54 UTC
Ok, test number #1:

- Open Dolphin from the command-line, using
  dolphin --nofork
- Right-click the Main Toolbar -> Icon Size -> Huge 48x48
- Close Dolphin.
- Re-open, again from the command-line.
- Verify that the size of the Icons are still Huge 48x48.

[this works for me]

If not, please attach your kdeglobals and dolphinrc (delete any sensitive data that you have in there, if you want) - they will both be in your $KDEHOME/share/config directory ($KDEHOME is usually either ~/.kde or ~/.kde4).
Comment 20 Martin van Es 2009-01-25 16:06:45 UTC
That's funny! It remembers the 48x48 setting (point taken) but not the 16x16 setting.
After setting it to 16x16 back and restarting, the menu context says it is 'default' (which is correct-by-settings) but renders it as 22x22, which *might* be KDE default, but certainly not *my* default... I think some defaults are getting messed up along the way.

Do you still need my kdeglobals and dolphinrc after this?
Comment 21 Simon St James 2009-01-25 16:14:48 UTC
@Martin:

"Do you still need my kdeglobals and dolphinrc after this?"

Yes, please :)
Comment 22 Daniel Dumitrache 2009-01-25 16:20:53 UTC
Done some more tests, and as far as I can tell the icon size for each application (as in test from comment #10) is not saved if it's the same as the global settings size.

here are my two tests:

test #1:
- System Settings -> Appearance -> Icons -> Advanced -> Main Toolbar is 16!
- Open Dolphin from the command-line, using dolphin --nofork
- Right-click the Main Toolbar -> Icon Size -> Huge 48x48 
- Close Dolphin
- Re-open, again from the command-line
- Verify that the size of the Icons are still Huge 48x48 (ok)

test #1 is ok for me

test #2:
- System Settings -> Appearance -> Icons -> Advanced -> Main Toolbar is 48!
- Open Dolphin from the command-line, using dolphin --nofork
- Right-click the Main Toolbar -> Icon Size -> Huge 48x48 
- Close Dolphin
- Re-open, again from the command-line
- Verify that the size of the Icons are still Huge 48x48 (failed)

test #2 is not ok for me, dolphin starts with 22x icons
Comment 23 Martin van Es 2009-01-25 16:25:13 UTC
Created attachment 30591 [details]
dolphinrc

As requested, dolphinrc, censored for personal data
Comment 24 Martin van Es 2009-01-25 16:25:41 UTC
Created attachment 30592 [details]
kdeglobals

And kdeglobals...
Comment 25 Simon St James 2009-01-25 16:35:12 UTC
@Daniel:

Good analysis, and this matches precisely what I'm seeing in the code.  I'll have to manually keep track of whether an IconSize is the Default (probably by using the logic "If the size does not appear in the config file, or the user has explicitly selected the 'Default' entry in the menu, then make note that the icon size should track the default value"), as the current method:

"
   if (!cg.hasDefault("IconSize") && iconSize().width() == iconSizeDefault())
    cg.revertToDefault("IconSize");
  else
    cg.writeEntry("IconSize", iconSize().width());
"

is logically broken.  This means that this "not getting saved" bug is merely a simple consequence of this dodgy logic coupled with the bug in http://bugs.kde.org/show_bug.cgi?id=169067, which is good news :)

@Martin:

Great, that should be good enough to be getting on with.  Thanks to both of your for your help: If you are compiling from trunk at all, I might ask you to test patches as we go along! :) No ETA on a fix, yet, though.
Comment 26 Martin van Es 2009-01-25 18:39:24 UTC
I depend on Jaunty packages, so that would be next RC or 4.2 release for me I'm afraid.
Comment 27 Daniel Dumitrache 2009-01-25 22:43:50 UTC
Created attachment 30607 [details]
ktoolbar.cpp.patch

I've been browsing trough the ktoolbar.cpp code, and I think I managed to find a simple fix for this bug, please see the attached patch (against trunk). Someone who knows that code better than me should review it and commit if ok. I've done several tests and didn't manage to find any new problems.

@Simon, according to the API docs for KConfigGroup::hasDefault() that's the way to do it
Comment 28 Simon St James 2009-01-25 22:57:03 UTC
@Daniel:

That's certainly going to be part of a fix (I had a similar thing here:

http://bugs.kde.org/show_bug.cgi?id=169067#c4

) but getting everything working together, including properly respecting the meaning of the word "Default" and adapting to changes made to global settings in System Settings, will probably need to be a bit more involved, I think :/
Comment 29 Dario Andres 2009-01-31 12:59:27 UTC
*** Bug 182564 has been marked as a duplicate of this bug. ***
Comment 30 Manolete 2009-02-02 21:56:59 UTC
I wrote an answer to a similar bug two days ago; but now I can't find it. I'm rather new to bugs.kde, so perhaps I did something wrong or I'm just unable to find it or the bug report was deleted, who knows.
Anyway, what I said in that report was more or less what I said here, a rather simple workaround:
http://forum.kde.org/-solved-kickoff-and-toolbars-icon-size-t-29186.html

I hope it helps.

Cheers.
Comment 31 Manolete 2009-02-02 22:01:02 UTC
Sorry, I copied the whole thread link in KDE forum. The direct link for the workaround is this one:
http://forum.kde.org/-solved-kickoff-and-toolbars-icon-size-t-29186.html#pid40364
Comment 32 Martin van Es 2009-03-10 12:58:34 UTC
This problem is still present in 4.2.1, is a fix planned for the 4.2 series?
Comment 33 Simon St James 2009-03-10 13:36:12 UTC
I'd love to fix it, but there's still some weird stuff in there that I don't fully understand:

http://www.nabble.com/KToolbar-Confusion-td21731850.html

I'll send a follow-up e-mail with more specific questions at some point, but I will be swamped with real-life work for the foreseeable future so if anyone else wants to step up, please do :)
Comment 34 peaches 2009-04-13 03:40:17 UTC
*** Bug 189348 has been marked as a duplicate of this bug. ***
Comment 35 Christoph Feck 2009-04-27 01:15:08 UTC
*** Bug 190778 has been marked as a duplicate of this bug. ***
Comment 36 Simon St James 2009-05-15 20:26:13 UTC
SVN commit 968441 by sstjames:

There seems to be some difficulty with specifying KConfig::Global when we are already using kdeglobals, in that it never writes out the settings, so do what the icons kcm does and use KGlobal::config()  - as dfaure points out, this has the advantage of being more efficient, anyway.  This is related to the following bugs (iconText and iconSize have much the same root causes), which I am also currently trying to fix:

CCBUG:168480 
CCBUG:169067

 M  +6 -6      kcmstyle.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=968441
Comment 37 Dario Andres 2009-05-22 15:18:26 UTC
*** Bug 193618 has been marked as a duplicate of this bug. ***
Comment 38 David Faure 2009-06-25 03:26:08 UTC
   
SVN commit 986786 by dfaure:

Rework the handling of settings (icon size and tool-button-style (e.g. text under icons)) in KToolBar, in order to obey the following priority order at all times:
KDE-Global config < App-XML attributes < user settings in KConfig < in-memory XML attributes
In particular, this fixes changing the kde-global icon size for toolbars, which is now applied to both running and future apps
 (had to add a signal to KIconLoader for the first case).
With unit tests (quite complete for icon size; to be finished for tool-button-style; to be written for hiding/showing)
Not sure yet if this will be in 4.3, depends on the number of regressions found in trunk...
BUG: 169067


 M  +1 -0      icons/kiconloader.cpp  
 M  +6 -0      icons/kiconloader.h  
 M  +1 -0      tests/CMakeLists.txt  
 A             tests/ktoolbar_unittest.cpp   [License: LGPL (v2/3+eV)]
 M  +3 -0      tests/ktoolbartest.cpp  
 M  +23 -76    tests/kxmlgui_unittest.cpp  
 M  +1 -6      widgets/kmainwindow.cpp  
 M  +2 -2      widgets/kmainwindow.h  
 M  +251 -332  widgets/ktoolbar.cpp  
 M  +37 -30    widgets/ktoolbar.h  
 M  +1 -4      xmlgui/kxmlguibuilder.cpp  


http://websvn.kde.org/?view=rev&revision=986786
Comment 39 Christoph Feck 2009-06-27 19:12:27 UTC
*** Bug 175212 has been marked as a duplicate of this bug. ***
Comment 40 Martin van Es 2009-07-22 10:26:04 UTC
Seems fixed for me in 4.3RC2, Thx!!
Comment 41 Martin van Es 2009-11-23 13:36:50 UTC
Kate still suffers from this bug. See #204796
Comment 42 Christoph Feck 2010-02-01 03:16:23 UTC
*** Bug 198984 has been marked as a duplicate of this bug. ***
Comment 43 Martin van Es 2010-12-12 20:09:34 UTC
This bug is still present in Kate (KDE 4.5.4, see bug 204796)
Comment 44 Anne-Marie Mahfouf 2010-12-12 20:20:30 UTC
Martin I run trunk (next 4.6) and this is fixed. In System Settings I changed the icon size to 48 for the main toolbar and immediately after Applying all toolbars icons went to size 48, included Kate.

For you so, is it only Kate not taking the global icon size? System Settings itself should change as soon as you apply a new size.
Comment 45 Martin van Es 2010-12-12 20:42:51 UTC
As far as I remember this discussion, the problem was linked to my icons being (extremely) small: I use 16 for all icons, except desktop and this patch fixed all applications *except* Kate! That's why I openened bug 204796, but nobody's listening there... I can set icons to default in KAte, which makes them small (16x16) as I want, but after closing Kate and reopening it resorts back to medium (22x22), see comment #20. The difference now is that Kate doesn't think it displays default, but knowingly puts it back to 22x22 before my eyes.