From efac64cef76adb0ca6311b83abb4e56751e2e7b9 Mon Sep 17 00:00:00 2001 From: Cyrille Bollu Date: Fri, 13 May 2016 14:28:12 +0200 Subject: [PATCH] Further flatened the design of TabWidget --- src/gui/widgets/TabWidget.cpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/gui/widgets/TabWidget.cpp b/src/gui/widgets/TabWidget.cpp index ae9a35997..92c717d35 100644 --- a/src/gui/widgets/TabWidget.cpp +++ b/src/gui/widgets/TabWidget.cpp @@ -208,24 +208,20 @@ void TabWidget::paintEvent( QPaintEvent * pe ) setFont( pointSize<8>( font() ) ); QPainter p( this ); + // Draw background QBrush bg_color = p.background(); - p.fillRect( 0, 0, width() - 1, height() - 1, bg_color ); bool big_tab_captions = ( m_caption == "" ); + // Draw external borders p.setPen( bg_color.color().darker( 150 ) ); p.drawRect( 0, 0, width() - 1, height() - 1 ); - p.setPen( bg_color.color().light( 150 ) ); - p.drawLine( width() - 1, 0, width() - 1, height() - 1 ); - p.drawLine( 0, height() - 1, width() - 1, height() - 1 ); - - p.setPen( QColor( 0, 0, 0 ) ); - p.drawRect( 1, 1, width() - 3, height() - 3 ); - - p.fillRect( 2, 0, width() - 3, m_tabheight + 2, bg_color.color().darker( 150 ) ); + // Draw tabs' bar background + p.fillRect( 1, 1, width() - 2, m_tabheight + 2, bg_color.color().darker( 150 ) ); + // Draw title, if any if( ! m_caption.isEmpty() ) { p.setPen( tabTitleText() );