#include <QStyleOptionButton>
#include <QStyleOptionTab>
#include <QStyleOptionToolButton>
+#include <QStyleOptionFocusRect>
#include <QStyleOption>
#include <QSize>
#include <QToolBar>
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 ),
}
case CE_TabBarTabLabel:
if (const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(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 ) {
}
}
break;
+ /*
+ case CE_ToolBoxTab:
+ QCommonStyle::drawControl( ce, opt, p, w );
+ break;
+ */
case CE_HeaderSection: {
bool aStateOn = opt->state & State_On;
QColor aColor = getColor( Style_Model::header_clr );
break;
}
default:
- QWindowsStyle::drawControl( ce, opt, p, w );
+ QWindowsStyle::drawControl( ce, opt, p, w );
+ break;
}
}
pal.color( QPalette::Window ),
getColor( Style_Model::border_bot_clr ),
aBrdTopCol, aBrdBotCol, false, false, isHover, true );
- break;
}
- else
- QWindowsStyle::drawPrimitive( pe, opt, p, w );
+ else {
+ QWindowsStyle::drawPrimitive( pe, opt, p, w );
+ }
break;
}
case PE_IndicatorArrowRight:
QColor aColor = getColor( Style_Model::pointer_clr );
if ( !(opt->state & State_Enabled ) )
aColor = opt->palette.mid().color();
- if ( opt->state & State_Selected && itemViewOpt && itemViewOpt->showDecorationSelected )
+ if ( opt->state & State_Selected && itemViewOpt && itemViewOpt->showDecorationSelected )
aColor = opt->palette.highlightedText().color();
p->setPen( QPen( aColor ) );
drawHoverRect(p, opt->rect, opt->palette.color( QPalette::Window ), aRad, Style_Tools::All, true);
else {
Style_Tools::shadowRect( p, opt->rect, aRad, LINE_GR_MARGIN, SHADOW,
- Style_Tools::All, opt->palette.color( QPalette::Base ), // getColor( Style_Model::fld_light_clr ),
+ Style_Tools::All, opt->palette.color( QPalette::Base ), // getColor( Style_Model::fld_light_clr ),
getColor( Style_Model::fld_dark_clr ), aBrdTopCol, aBrdBotCol,
getBoolValue( Style_Model::all_antialized ), false );
}
if (const QStyleOptionFrame *panel = qstyleoption_cast<const QStyleOptionFrame *>(opt)) {
QRect rect = panel->rect.adjusted( panel->lineWidth, panel->lineWidth,
-panel->lineWidth, -panel->lineWidth);
- if (panel->lineWidth > 0) // QLineEdit
+ if ( w->inherits("QLineEdit") && panel->lineWidth > 0 ) {
drawPrimitive( PE_FrameLineEdit, panel, p, w );
- else // not QLineEdit
- p->fillRect(rect, panel->palette.brush(QPalette::Base));
- }
+ }
+ else {
+ QColor c = panel->palette.color(QPalette::Base); c.setAlpha(255);
+ p->fillRect( rect, c ); // panel->palette.brush(QPalette::Base)
+ }
+ }
}
break;
}
light = base,
light_alt = base.dark(110),//AlternateBase color
dark = getColor( Style_Model::fld_dark_clr );
- //light.setAlpha( 0 ); // VSR commented: IPAL19262
+ light.setAlpha( 0 ); // VSR commented: IPAL19262
QLinearGradient gr_h(r.x(), r.y(), r.right(), r.y());
gr_h.setColorAt( 0.0, dark );
gr_h.setColorAt( aMarg / r.width(), light );
// draw frame
p->fillRect( r, base );
p->fillRect( r, gr_h );
- p->fillRect( r, gr_v );
+ p->fillRect( r, gr_v );
aPal.setBrush( QPalette::Base, QBrush( light ) );
QLinearGradient gr_alt(r.x(), r.y(), r.right(), r.y());
switch (ct) {
case CT_TabBarTab:
if (const QStyleOptionTab *tab = qstyleoption_cast<const QStyleOptionTab *>(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 );
aPal.setColor( QPalette::AlternateBase, getColor( Style_Model::pal_base_clr ).dark( 110 ) );
aPal.setColor( QPalette::Window, getColor( Style_Model::bg_clr ) );
//aPal.setColor( QPalette::Shadow, ??? );
- aPal.setColor( QPalette::Highlight, getColor( Style_Model::pal_high_clr ) );
+ QColor hc = getColor( Style_Model::pal_high_clr );
+ hc.setAlpha(100);
+ aPal.setColor( QPalette::Highlight, hc );
aPal.setColor( QPalette::HighlightedText, getColor( Style_Model::pal_high_text_clr ) );
//aPal.setColor( QPalette::Link, ??? );
//aPal.setColor( QPalette::LinkVisited, ??? );
if (aPal.midlight() == aPal.button())
aPal.setColor(QPalette::Inactive, QPalette::Midlight, aPal.color(QPalette::Active, QPalette::Button).light(110));
if (aPal.window() != aPal.base()) {
- aPal.setColor(QPalette::Inactive, QPalette::Highlight, aPal.color(QPalette::Inactive, QPalette::Window));
+ QColor hc1 = aPal.color(QPalette::Inactive, QPalette::Window);
+ hc1.setAlpha(100);
+ aPal.setColor(QPalette::Inactive, QPalette::Highlight, hc1);
aPal.setColor(QPalette::Inactive, QPalette::HighlightedText, aPal.color(QPalette::Inactive, QPalette::Text));
}