]> git.lyx.org Git - features.git/commitdiff
fix wrong toolbar icon size, default value is
authorPeter Kümmel <syntheticpp@gmx.net>
Mon, 27 Nov 2006 23:35:43 +0000 (23:35 +0000)
committerPeter Kümmel <syntheticpp@gmx.net>
Mon, 27 Nov 2006 23:35:43 +0000 (23:35 +0000)
in lyx_main.C. Size will be stored in the session
file.

*      src/lyx_main.C              : default value
*      src/frontends/Application.h : restore also icon size
*      src/frontends/LyXView.h     :        "
*      src/frontends/qt4/GuiView.h :        "
*      src/frontends/qt4/GuiView.C :        "
*      src/frontends/Application.C :        "

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

Status.15x
src/frontends/Application.C
src/frontends/Application.h
src/frontends/LyXView.h
src/frontends/qt4/GuiView.C
src/frontends/qt4/GuiView.h
src/lyx_main.C

index 771a715d0fa207567b34b8e8b3a00662a90234fb..cd4d1427a481162ce1e9bc7127f15dbe73f2c6db 100644 (file)
@@ -126,11 +126,6 @@ TOOLBARS & MINIBUFFER
 * When toolbars are hidden, they pop up again after clicking on the document
   area (Joost 4/11/06).
 
-* Icons in the toolbars do not have the correct size, they are stretched a few
-  pixels compared to 1.4. This makes the images look jagged and the initial
-  window size has also become to small to show the whole toolbar
-  (Joost 4/11/06). See also the math panel buttons entry above.
-  
 * TODO toolbar popup menu, currently disabled (Peter 9/11/06)  
 
 
@@ -457,3 +452,10 @@ CREDITS:
 * new document; insert note; insert "hello" into note; place the cursor at the beginning of the note;
   activate change tracking; press backspace => seg fault
   FIXED (Michael 2006-11-25)
+
+* Icons in the toolbars do not have the correct size, they are stretched a few
+  pixels compared to 1.4. This makes the images look jagged and the initial
+  window size has also become to small to show the whole toolbar
+  (Joost 4/11/06). See also the math panel buttons entry above.
+  FIXED (Peter, 2006-11-28)
+
index 98d357427bd443f204a61b39a3543088f2e27e49..7d2dc985521a4b855ff8ab8e11073fad48f39818 100644 (file)
@@ -51,7 +51,8 @@ Application::Application(int &, char **)
 LyXView & Application::createView(unsigned int width,
                                                                  unsigned int height,
                                                                  int posx, int posy,
-                                                                 bool maximize)
+                                                                 bool maximize,
+                                                                 unsigned int iconSizeXY)
 {
        int view_id = gui().newView();
        LyXView & view = gui().view(view_id);
@@ -61,7 +62,7 @@ LyXView & Application::createView(unsigned int width,
        /*int workArea_id_ =*/ gui().newWorkArea(width, height, view_id);
 
        view.init();
-       view.setGeometry(width, height, posx, posy, maximize);
+       view.setGeometry(width, height, posx, posy, maximize, iconSizeXY);
 
        setCurrentView(view);
 
index 8f977ab737736ca29b92e4a92cf1b1215b38db7f..76031a4a0c6e4cc531661029a69b202d047cdcff 100644 (file)
@@ -172,7 +172,7 @@ public:
 
        /// Create the main window with given geometry settings.
        LyXView & createView(unsigned int width, unsigned int height,
-               int posx, int posy, bool maximize);
+               int posx, int posy, bool maximize, unsigned int iconSizeXY);
        
        /// 
        LyXView const & currentView() const;
index 6f36161c09b2a6b7f2e43915673216a766a7a62c..5a2bfadeaae83b57fb60917238c877776f370d9d 100644 (file)
@@ -87,7 +87,8 @@ public:
                unsigned int width,
                unsigned int height,
                int posx, int posy,
-               bool maximize) = 0;
+               bool maximize,
+               unsigned int iconSizeXY) = 0;
 
        /// save the geometry state in the session manager.
        virtual void saveGeometry() = 0;
index 6b563ab3d9763b3e1bcd459e2786e253bb454c7b..d98c52763708e263596d07834c70c93f29827b79 100644 (file)
@@ -6,6 +6,7 @@
  * \author Lars Gullik Bjønnes
  * \author John Levon
  * \author Abdelrazak Younes
+ * \author Peter Kümmel
  *
  * Full author contact details are available in file CREDITS.
  */
@@ -105,15 +106,20 @@ struct GuiView::GuiViewPrivate
 
        GuiViewPrivate() : wt(0), posx_offset(0), posy_offset(0)
        {}
+
+       static int iconSizeXY_;
 };
 
+int GuiView::GuiViewPrivate::iconSizeXY_ = -1;
+
 GuiView::GuiView(int id)
        : QMainWindow(), LyXView(id), commandbuffer_(0), d(*new GuiViewPrivate)
 {
-//     setToolButtonStyle(Qt::ToolButtonIconOnly);
-//     setIconSize(QSize(12,12));
+       // static var needed by the "New Window", because setGeometry will not be called
+       if (GuiViewPrivate::iconSizeXY_ != -1)
+               setIconSize(QSize(GuiViewPrivate::iconSizeXY_, GuiViewPrivate::iconSizeXY_));
 
-//     bufferview_.reset(new BufferView(this, width, height));
+       //bufferview_.reset(new BufferView(this, width, height));
 
 #ifndef Q_WS_MACX
        //  assign an icon to main form. We do not do it under Qt/Mac,
@@ -139,8 +145,7 @@ void GuiView::close()
 QMenu* GuiView::createPopupMenu()
 {
        // disable toolbar popup menu 
-       // Qt docs: Ownership of the popup menu is transferred to the caller.
-       return new QMenu;
+       return 0;
 }
 
 void GuiView::init()
@@ -187,6 +192,7 @@ void GuiView::saveGeometry()
        session.sessionInfo().save("WindowWidth", convert<string>(geometry.width()));
        session.sessionInfo().save("WindowHeight", convert<string>(geometry.height()));
        session.sessionInfo().save("WindowIsMaximized", (isMaximized() ? "yes" : "no"));
+       session.sessionInfo().save("IconSizeXY", convert<string>(iconSize().width()));
        if (lyxrc.geometry_xysaved) {
                session.sessionInfo().save("WindowPosX", convert<string>(geometry.x() + d.posx_offset));
                session.sessionInfo().save("WindowPosY", convert<string>(geometry.y() + d.posy_offset));
@@ -197,8 +203,15 @@ void GuiView::saveGeometry()
 void GuiView::setGeometry(unsigned int width,
                                                                  unsigned int height,
                                                                  int posx, int posy,
-                                                                 bool maximize)
+                                                                 bool maximize,
+                                                                 unsigned int iconSizeXY)
 {
+       if (iconSizeXY > 8)
+               GuiViewPrivate::iconSizeXY_ = iconSizeXY;
+       else
+               GuiViewPrivate::iconSizeXY_ = 28;
+       setIconSize(QSize(GuiViewPrivate::iconSizeXY_, GuiViewPrivate::iconSizeXY_));
+
        // only true when the -geometry option was NOT used
        if (width != 0 && height != 0) {
                if (posx != -1 && posy != -1) {
index c4fb5317d730b8260e6826ee683468f9afa50c6e..43d3e859ff10bdff699a0730bc1b25fd37bc5a59 100644 (file)
@@ -59,7 +59,8 @@ public:
                unsigned int width,
                unsigned int height,
                int posx, int posy,
-               bool maximize);
+               bool maximize,
+               unsigned int iconSizeXY);
        virtual void saveGeometry();
        virtual void busy(bool);
        Toolbars::ToolbarPtr makeToolbar(ToolbarBackend::Toolbar const & tbb);
index de468f542d2b80c73f24a4888a63a7ae6e1636fd..6833bc16c0c1a3e43853416510868c1b07cea200 100644 (file)
@@ -560,6 +560,8 @@ LyXView * LyX::newLyXView()
        // initial geometry
        unsigned int width = 690;
        unsigned int height = 510;
+       // default icon size, will be overwritten by  stored session value
+       unsigned int iconSizeXY = 26;
        bool maximize = false;
        // first try lyxrc
        if (lyxrc.geometry_width != 0 && lyxrc.geometry_height != 0 ) {
@@ -576,6 +578,9 @@ LyXView * LyX::newLyXView()
                        height = convert<unsigned int>(val);
                if (session().sessionInfo().load("WindowIsMaximized") == "yes")
                        maximize = true;
+               val = session().sessionInfo().load("IconSizeXY");
+               if (!val.empty())
+                       iconSizeXY = convert<unsigned int>(val);
        }
 
        // if user wants to restore window position
@@ -595,7 +600,7 @@ LyXView * LyX::newLyXView()
                height = 0;
        }
        // create the main window
-       LyXView * view = &pimpl_->application_->createView(width, height, posx, posy, maximize);
+       LyXView * view = &pimpl_->application_->createView(width, height, posx, posy, maximize, iconSizeXY);
 
        return view;
 }