]> git.lyx.org Git - lyx.git/commitdiff
Let the icon set decide what the normal size is, but bound it to the
authorEnrico Forestieri <forenr@lyx.org>
Tue, 22 Mar 2011 23:41:26 +0000 (23:41 +0000)
committerEnrico Forestieri <forenr@lyx.org>
Tue, 22 Mar 2011 23:41:26 +0000 (23:41 +0000)
range between the hardcoded small and large sizes.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@38000 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/GuiView.cpp

index 0832aea5f5c67174686477aaa970e5a3745aad58..0826273036c0310d588e1f173eb584673d2831ff 100644 (file)
@@ -212,9 +212,21 @@ struct GuiView::GuiViewPrivate
        {
                // hardcode here the platform specific icon size
                smallIconSize = 16;  // scaling problems
-               normalIconSize = 22; // ok, default
+               normalIconSize = 22; // ok, default if iconsize.png is missing
                bigIconSize = 26;       // better for some math icons
 
+               // if it exists, use width of iconsize.png as normal size
+               FileName const fn = lyx::libFileSearch("images", "iconsize.png");
+               if (!fn.empty()) {
+                       QImage image(toqstr(fn.absFileName()));
+                       if (image.width() < int(smallIconSize))
+                               normalIconSize = smallIconSize;
+                       else if (image.width() > int(bigIconSize))
+                               normalIconSize = bigIconSize;
+                       else
+                               normalIconSize = image.width();
+               }
+
                splitter_ = new QSplitter;
                bg_widget_ = new BackgroundWidget;
                stack_widget_ = new QStackedWidget;