From 64bdffbac47752d5fec76df9829feaefa0986b14 Mon Sep 17 00:00:00 2001 From: Enrico Forestieri Date: Tue, 22 Mar 2011 23:41:26 +0000 Subject: [PATCH] Let the icon set decide what the normal size is, but bound it to the 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 | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp index 0832aea5f5..0826273036 100644 --- a/src/frontends/qt4/GuiView.cpp +++ b/src/frontends/qt4/GuiView.cpp @@ -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; -- 2.39.2