Bug 169067 - Changing icon size in systemsetting does not apply to applications
Summary: Changing icon size in systemsetting does not apply to applications
Status: RESOLVED FIXED
Alias: None
Product: kdelibs
Classification: Unmaintained
Component: kdeui (show other bugs)
Version: 4.1
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: kdelibs bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-08-13 21:12 UTC by Kristjan Ugrin
Modified: 2009-06-29 16:37 UTC (History)
9 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Preliminary patch that makes app toolbars respect the current default toolbar icon size(s) (738 bytes, patch)
2008-08-16 17:29 UTC, Simon St James
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kristjan Ugrin 2008-08-13 21:12:27 UTC
Version:           4.1.0 (using KDE 4.1.0)
Installed from:    SuSE RPMs
OS:                Linux

Steps to reproduce:
1. open systemsettings
2. select appereance → icons → advanced
3. set toolbar / main toolbar size to 16.
4. open e.g. dolphin and set toolbar size to default - it will not change.
Also toolbar size in application alone is not saved, but this is another bug an bug report is open.
Comment 1 Simon St James 2008-08-13 21:17:27 UTC
Confirmed here, using trunk/.  Seems to be 100% reproducible.

Comment 2 FiNeX 2008-08-13 22:01:05 UTC

*** This bug has been marked as a duplicate of 153689 ***
Comment 3 Simon St James 2008-08-16 17:28:07 UTC
I don't agree that this is precisely a dupe of 153689, so re-opening :)

The problem here - that the toolbar of even newly opened applications does not respect the default setting of the icon size set via System Settings (that is, the "Size=" entry in the MainToolbarIcons and/ or ToolbarIcons groups of kdeglobals) - seems to be caused by KToolBar's IconSizeDefault being hard-coded to 22 and not being changed to the correct value before it is used. 

Setting it initially to iconSizeDefault() seems to fix it, but I'll need someone familiar with the KToolbar code to verify it.  

The problem with the toolbars of currently running apps with Default icon size in their toolbars not updating immediately when the setting is changed in System Settings likely lies in System Settings; I'll have a look when I get the chance.

Patch follows.  I've CC'd Hamish as he was the last person to have a copyright on the code :)
Comment 4 Simon St James 2008-08-16 17:29:17 UTC
Created attachment 26877 [details]
Preliminary patch that makes app toolbars respect the current default toolbar icon size(s)
Comment 5 Simon St James 2008-08-17 10:28:25 UTC
Hmmm ... this might be one best left to the experts, or perhaps I could ask a bunch of questions on the mailing lists :)

At least part of the problem seems to be that the line:

connect(kapp, SIGNAL(toolbarAppearanceChanged(int)), this, SLOT(slotAppearanceChanged()));

was removed in 

http://websvn.kde.org/trunk/KDE/kdelibs/kdeui/widgets/ktoolbar.cpp?revision=518519&view=markup

leaving slotAppearanceChanged dangling, but even after adding that I have a lot of confusion about why xmlgui apps should not respond to changes to global Icon sizes.

Hamish - do you think it's worth it for a newbie KDE dev to keep persevering with this? :)
Comment 6 George Kiagiadakis 2008-08-27 17:42:26 UTC
I have also looked at this code but it's very confusing. It looks like there are many left-overs from very old kde versions that are broken. For example, look at KToolBar::applyAppearanceSettings. I still can't understand what this function really does. afaict, it does nothing. All the if clauses fail and it returns control without really applying any settings.

I was looking at that function a few days ago to see if I can figure out where to load the default icon size, but I got disappointed from the state of that code. Your patch is what I had in mind too as a temporary workaround, but imho, I consider it a bad solution.
Comment 7 Søren Holm 2008-10-15 23:30:35 UTC
Additionally appications generaly does not save if you force the icons size to be fx. 16 px it just flips back to 22 px when logging in again.
Comment 8 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 9 David Faure 2009-06-25 03:24:41 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  


WebSVN link: http://websvn.kde.org/?view=rev&revision=986786
Comment 10 David Faure 2009-06-29 16:37:05 UTC
SVN commit 989134 by dfaure:

Backport commits 986786 987038 989030 989068 989076 989133:
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.
The fix will be in KDE-4.3.0.
CCBUG: 169067


 M  +1 -0      icons/kiconloader.cpp  
 M  +6 -0      icons/kiconloader.h  
 M  +1 -0      tests/CMakeLists.txt  
 A             tests/ktoolbar_unittest.cpp   trunk/KDE/kdelibs/kdeui/tests/ktoolbar_unittest.cpp#986786 [License: LGPL (v2/3+eV)]
 M  +3 -0      tests/ktoolbartest.cpp  
 M  +17 -98    tests/kxmlgui_unittest.cpp  
 A             tests/testguiclient.h   trunk/KDE/kdelibs/kdeui/tests/testguiclient.h#989133 [License: LGPL (v2/3+eV)]
 A             tests/testxmlguiwindow.h   trunk/KDE/kdelibs/kdeui/tests/testxmlguiwindow.h#987038 [License: LGPL (v2/3+eV)]
 M  +1 -6      widgets/kmainwindow.cpp  
 M  +2 -2      widgets/kmainwindow.h  
 M  +319 -401  widgets/ktoolbar.cpp  
 M  +37 -30    widgets/ktoolbar.h  
 M  +1 -4      xmlgui/kxmlguibuilder.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=989134