The branch, master, has been updated. - Log -----------------------------------------------------------------
commit 655a4f5515f02c057dc47abd7bdfbd4059ff494c Author: Vincent van Ravesteijn <[email protected]> Date: Fri May 25 19:05:38 2012 +0200 Fix painting of hidden tabbar on gtk When there is a single document open, the tabbar gets hidden. The only and selected tab is still visible though as a break in the line delining the tabwidget. To fix this we paint the tabwidget ourselves and remove the presence of the hidden tab. diff --git a/src/frontends/qt4/GuiWorkArea.cpp b/src/frontends/qt4/GuiWorkArea.cpp index 5eca896..362f062 100644 --- a/src/frontends/qt4/GuiWorkArea.cpp +++ b/src/frontends/qt4/GuiWorkArea.cpp @@ -1555,6 +1555,25 @@ TabWorkArea::TabWorkArea(QWidget * parent) } +void TabWorkArea::paintEvent(QPaintEvent * event) +{ + if (tabBar()->isVisible()) { + QTabWidget::paintEvent(event); + } else { + // Prevent the selected tab to influence the + // painting of the frame of the tab widget. + // This is needed for gtk style in Qt. + QStylePainter p(this); + QStyleOptionTabWidgetFrameV2 opt; + initStyleOption(&opt); + opt.rect = style()->subElementRect(QStyle::SE_TabWidgetTabPane, + &opt, this); + opt.selectedTabRect = QRect(); + p.drawPrimitive(QStyle::PE_FrameTabWidget, opt); + } +} + + void TabWorkArea::mouseDoubleClickEvent(QMouseEvent * event) { if (event->button() != Qt::LeftButton) diff --git a/src/frontends/qt4/GuiWorkArea.h b/src/frontends/qt4/GuiWorkArea.h index 42bde9d..e283d31 100644 --- a/src/frontends/qt4/GuiWorkArea.h +++ b/src/frontends/qt4/GuiWorkArea.h @@ -201,6 +201,7 @@ public: GuiWorkArea * currentWorkArea(); GuiWorkArea * workArea(Buffer & buffer); GuiWorkArea * workArea(int index); + void paintEvent(QPaintEvent *); Q_SIGNALS: /// ----------------------------------------------------------------------- Summary of changes: src/frontends/qt4/GuiWorkArea.cpp | 19 +++++++++++++++++++ src/frontends/qt4/GuiWorkArea.h | 1 + 2 files changed, 20 insertions(+), 0 deletions(-) hooks/post-receive -- The LyX Source Repository
