]> git.lyx.org Git - features.git/commitdiff
* GuiWorkArea::addWorkArea(): avoid multiple unneeded drawing.
authorAbdelrazak Younes <younes@lyx.org>
Mon, 16 Jun 2008 07:23:08 +0000 (07:23 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Mon, 16 Jun 2008 07:23:08 +0000 (07:23 +0000)
* GuiWorkArea::on_currentTabChanged(): make sure the bufferView has the correct size.

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

src/frontends/qt4/GuiWorkArea.cpp

index 7fafe934d5f9200eed01f1620958b69ccc71abfc..5ab1a315e7b7d4a0e508ab4b9709acc751bd105a 100644 (file)
@@ -1312,6 +1312,7 @@ bool TabWorkArea::setCurrentWorkArea(GuiWorkArea * work_area)
 
 GuiWorkArea * TabWorkArea::addWorkArea(Buffer & buffer, GuiView & view)
 {
+       blockSignals(true);
        GuiWorkArea * wa = new GuiWorkArea(buffer, view);
        wa->setUpdatesEnabled(false);
        // Hide tabbar if there's no tab (avoid a resize and a flashing tabbar
@@ -1328,7 +1329,7 @@ GuiWorkArea * TabWorkArea::addWorkArea(Buffer & buffer, GuiView & view)
                showBar(count() > 1);
 
        updateTabTexts();
-       
+       blockSignals(false);    
        return wa;
 }
 
@@ -1371,7 +1372,11 @@ void TabWorkArea::on_currentTabChanged(int i)
        LASSERT(wa, return);
        BufferView & bv = wa->bufferView();
        bv.cursor().fixIfBroken();
-       bv.updateMetrics();
+       if (bv.workHeight() != wa->viewport()->height() 
+               || bv.workWidth() != wa->viewport()->width())
+                       wa->resizeBufferView();
+       else
+                       bv.updateMetrics();
        wa->setUpdatesEnabled(true);
        wa->redraw();
        wa->setFocus();