Am 27.10.2008 um 11:24 schrieb Jean-Marc Lasgouttes:

Stefan Schimanski <[EMAIL PROTECTED]> writes:

After thinking about it, I am not sure anymore whether it is really so
trivial. Don't I overwrite the default icon size of the desktop
environment with this?

The problem as I see it is that the icon size (which is set in yet
another config file which of course is in its own directory, grr) is not
set until some explicit setting is done.

What I would propose instead of you patch is: in restoreLayout(), set
icon size to normal instead of returning false when the icon_size key is
not found.

Of course, another problem is to know why we should not follow
system-wide icon size options... Large icons would be perfect on mac if
we followed the rules: nice big icons, and few icons on toolbar. But I
think we cannot afford that.

First we cannot afford that much space for a toolbar. But second the big icons just look bad. A lot of apps nowadays have much smaller icons (Mail.app, Safari, Finder, just a name a few). And just because Qt chooses 32 does not make it the right choice.

The problem with your approach above is that restoreLayout is only called if the session management is actived, right? So, if it is disabled then LyX will still get those big icons. Hence, we need some kind of overwrite on Mac in any case. I propose the following (or alternatively without the #else branch).

Stefan

diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/ GuiView.cpp
index 222f67b..9394244 100644
--- a/src/frontends/qt4/GuiView.cpp
+++ b/src/frontends/qt4/GuiView.cpp
@@ -283,8 +283,24 @@ public:
 GuiView::GuiView(int id)
        : d(*new GuiViewPrivate), id_(id), closing_(false)
 {
+#ifdef Q_WS_MACX
+       // at least on Mac the default is 32 otherwise, which is huge.
+       normalSizedIcons();
+#else
+       // set the nearest icon size
+       QSize defSize = iconSize();
+       int smallDist = abs((int)d.smallIconSize - defSize.width());
+       int normalDist = abs((int)d.normalIconSize - defSize.width());
+       int bigDist = abs((int)d.bigIconSize - defSize.width());
+       if (smallDist < normalDist)
+               smallSizedIcons();
+       else if (normalDist < bigDist)
+               normalSizedIcons();
+       else
+               bigSizedIcons();
+#endif
+
        // GuiToolbars *must* be initialised before the menu bar.
- normalSizedIcons(); // at least on Mac the default is 32 otherwise, which is huge
        constructToolbars();

// set ourself as the current view. This is needed for the menu bar

Reply via email to