From: nds Date: Sat, 9 Feb 2008 06:10:07 +0000 (+0000) Subject: Correction for TabWidget with only one tab. X-Git-Tag: TG_Saint_Valentine-Day~5 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=118971ac47bb6927c594eb1ee6bf6766befa47fa;p=modules%2Fgui.git Correction for TabWidget with only one tab. --- diff --git a/src/Style/Style_Salome.cxx b/src/Style/Style_Salome.cxx index 85c6e1875..fe568a7e7 100644 --- a/src/Style/Style_Salome.cxx +++ b/src/Style/Style_Salome.cxx @@ -725,7 +725,8 @@ void Style_Salome::drawControl( ControlElement ce, const QStyleOption* opt, QRect tabRect = opt->rect; // line under selected tab bar object bool isSelected = opt->state & State_Selected; - bool isLast = tab->position == QStyleOptionTab::End; + bool isLast = tab->position == QStyleOptionTab::End || + tab->position == QStyleOptionTab::OnlyOneTab; QColor aColor = opt->palette.color( QPalette::Window ), aDarkColor = aColor.dark( BUT_PERCENT_ON ); QColor aBrdTopCol = getColor( Style_Model::border_tab_top_clr ), @@ -749,7 +750,8 @@ void Style_Salome::drawControl( ControlElement ce, const QStyleOption* opt, } case CE_TabBarTabLabel: if (const QStyleOptionTab *tab = qstyleoption_cast(opt)) { - if ( tab->position == QStyleOptionTab::End ) { + if ( tab->position == QStyleOptionTab::End || + tab->position == QStyleOptionTab::OnlyOneTab ) { QRect oldRect = opt->rect; int aDelta = 0; if ( tab->shape == QTabBar::RoundedNorth || tab->shape == QTabBar::RoundedSouth ) { @@ -1791,7 +1793,8 @@ QSize Style_Salome::sizeFromContents( ContentsType ct, const QStyleOption* opt, switch (ct) { case CT_TabBarTab: if (const QStyleOptionTab *tab = qstyleoption_cast(opt)) { - if ( tab->position == QStyleOptionTab::End ) { + if ( tab->position == QStyleOptionTab::End || + tab->position == QStyleOptionTab::OnlyOneTab ) { if ( tab->shape == QTabBar::RoundedNorth || tab->shape == QTabBar::RoundedSouth ) { int aDelta = (int)(opt->rect.height()*DELTA_H_TAB/2); sz.setWidth( sz.width() + aDelta );