Additional Asteroid widget style fixups

git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1245128 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
v3.5.13-sru
tpearson 13 years ago
parent 0721d1b1cd
commit 9de10454ff

@ -90,7 +90,7 @@ void KPopupTitle::paintEvent(TQPaintEvent *)
{ {
TQRect r(rect()); TQRect r(rect());
TQPainter p(this); TQPainter p(this);
kapp->tqstyle().tqdrawPrimitive(TQStyle::PE_HeaderSection, &p, r, tqpalette().active()); kapp->tqstyle().tqdrawPrimitive(TQStyle::PE_HeaderSectionMenu, &p, r, tqpalette().active());
if (!miniicon.isNull()) if (!miniicon.isNull())
p.drawPixmap(4, (r.height()-miniicon.height())/2, miniicon); p.drawPixmap(4, (r.height()-miniicon.height())/2, miniicon);

@ -112,7 +112,15 @@ void AsteroidStyle::polish(TQWidget *w)
wp.setColor(TQColorGroup::Dark, TQColor(128, 128, 128)); wp.setColor(TQColorGroup::Dark, TQColor(128, 128, 128));
wp.setColor(TQColorGroup::Mid, wp.active().color(TQColorGroup::Button).dark(150)); // Which GUI element(s) does this correspond to? wp.setColor(TQColorGroup::Mid, wp.active().color(TQColorGroup::Button).dark(150)); // Which GUI element(s) does this correspond to?
if ( ::tqqt_cast<TQLineEdit*>(w) || ::tqqt_cast<TQTextEdit*>(w) || ::tqqt_cast<TQMenuBar*>(w) || ::tqqt_cast<TQPushButton*>(w) || ::tqqt_cast<TQRadioButton*>(w) || ::tqqt_cast<TQTabBar*>(w) || ::tqqt_cast<TQToolBar*>(w) || ::tqqt_cast<TQProgressBar*>(w) || ::tqqt_cast<TQTabWidget*>(w) /*|| ::tqqt_cast<TQHeader*>(w) || ::tqqt_cast<TQComboBox*>(w) || ::tqqt_cast<TQFrame*>(w)*/ || ::tqqt_cast<TQGroupBox*>(w) || ::tqqt_cast<TQPopupMenu*>(w) || ::tqqt_cast<TQToolButton*>(w) || ::tqqt_cast<TQDockWindow*>(w)|| ::tqqt_cast<TQButton*>(w)) bool isProtectedObject = false;
TQObject *curparent = w;
while (curparent) {
if (curparent->inherits("KonqFileTip") || curparent->inherits("AppletItem")) {
isProtectedObject = true;
}
curparent = curparent->tqparent();
}
if (!isProtectedObject)
w->setPalette(wp); w->setPalette(wp);
if (w->inherits(TQPUSHBUTTON_OBJECT_NAME_STRING)) { if (w->inherits(TQPUSHBUTTON_OBJECT_NAME_STRING)) {
@ -345,11 +353,46 @@ void AsteroidStyle::tqdrawPrimitive(TQ_PrimitiveElement pe,
break; break;
} }
// FIXME
// This appears to do double duty,
// specifically it appears both in popup menu headers
// *and* at the top of tree views!
// The tree views need the stuff that is commented out
// to look correct, but when that is done the popup menus
// look absolutely HORRIBLE.
// How can we tell the two apart? Create PE_HeaderSectionMenu perhaps?
case PE_HeaderSection: { case PE_HeaderSection: {
p->setPen(cg.shadow()); p->setPen(cg.shadow());
p->setBrush(cg.background()); p->setBrush(cg.background());
p->drawRect(r); p->drawRect(r);
if (sf & Style_On) {
p->setPen(cg.mid());
p->setBrush(TQBrush(cg.light(),TQt::Dense4Pattern));
p->drawRect(r);
p->setPen(cg.buttonText());
} else if (sf & Style_Down) {
p->setPen(cg.mid());
p->drawRect(r);
p->setPen(cg.buttonText());
} else {
p->setPen(cg.light());
p->drawLine(x, y, x2-1, y);
p->drawLine(x, y, x, y2-1);
p->setPen(cg.mid());
p->drawLine(x2-1, y2-1, x+1, y2-1);
p->drawLine(x2-1, y2-1, x2-1, y+1);
}
break;
}
case PE_HeaderSectionMenu: {
p->setPen(cg.shadow());
p->setBrush(cg.background());
p->drawRect(r);
// if (sf & Style_On) { // if (sf & Style_On) {
// p->setPen(cg.mid()); // p->setPen(cg.mid());
// p->setBrush(TQBrush(cg.light(),TQt::Dense4Pattern)); // p->setBrush(TQBrush(cg.light(),TQt::Dense4Pattern));
@ -1014,7 +1057,7 @@ void AsteroidStyle::tqdrawControl(TQ_ControlElement ce,
etchedcg.setColor( TQColorGroup::HighlightedText, cg.dark() ); etchedcg.setColor( TQColorGroup::HighlightedText, cg.dark() );
etchedcg.setColor( TQColorGroup::BrightText, cg.dark() ); etchedcg.setColor( TQColorGroup::BrightText, cg.dark() );
etchedcg.setColor( TQColorGroup::ButtonText, cg.dark() ); etchedcg.setColor( TQColorGroup::ButtonText, cg.dark() );
drawItem( p, tr, tqalignment, cg, enabled, 0, t->text() ); drawItem( p, tr, tqalignment, etchedcg, enabled, 0, t->text() );
p->setPen(savePen); p->setPen(savePen);
} }
else { else {

Loading…
Cancel
Save