summaryrefslogtreecommitdiff
path: root/noncore
authorsandman <sandman>2002-10-06 03:07:56 (UTC)
committer sandman <sandman>2002-10-06 03:07:56 (UTC)
commit56276f60d5dd404c3cd8a65003faf75b289f1131 (patch) (side-by-side diff)
treeb531ea59a3dfbb737078d07ef006d417bd5f8698 /noncore
parent0e67d3b0704e10c1e4676d568caf67d97b604445 (diff)
downloadopie-56276f60d5dd404c3cd8a65003faf75b289f1131.zip
opie-56276f60d5dd404c3cd8a65003faf75b289f1131.tar.gz
opie-56276f60d5dd404c3cd8a65003faf75b289f1131.tar.bz2
- some tweaks to get a better stipple alignment (Qt/E does not understand
X11ParentRelative bg mode) - toolbar separators are not drawn anymore
Diffstat (limited to 'noncore') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/styles/liquid/liquid.cpp18
1 files changed, 15 insertions, 3 deletions
diff --git a/noncore/styles/liquid/liquid.cpp b/noncore/styles/liquid/liquid.cpp
index 1d01c65..259f6af 100644
--- a/noncore/styles/liquid/liquid.cpp
+++ b/noncore/styles/liquid/liquid.cpp
@@ -833,119 +833,131 @@ void LiquidStyle::polish(QWidget *w)
{
if(w->inherits("QMenuBar")){
//((QFrame*)w)->setLineWidth(0);
w->setBackgroundMode(QWidget::PaletteBackground);
w->setBackgroundOrigin(QWidget::ParentOrigin);
return;
}
if(w->inherits("QToolBar")){
w->installEventFilter(this);
w->setBackgroundMode(QWidget::PaletteBackground);
w->setBackgroundOrigin(QWidget::WidgetOrigin);
return;
}
if(w->inherits("QPopupMenu"))
w->setBackgroundMode(QWidget::NoBackground);
else if(w-> testWFlags(Qt::WType_Popup) && !w->inherits("QListBox")) {
w->installEventFilter(menuHandler);
}
if(w->isTopLevel()){
return;
}
- if ( !w-> inherits("QFrame") || (((QFrame*) w)-> frameShape () == QFrame::NoFrame ))
- w-> setBackgroundOrigin ( QWidget::ParentOrigin );
+
if(w->inherits("QComboBox") ||
w->inherits("QLineEdit") || w->inherits("QRadioButton") ||
w->inherits("QCheckBox") || w->inherits("QScrollBar")) {
w->installEventFilter(this);
}
if(w->inherits("QLineEdit")){
QPalette pal = w->palette();
pal.setBrush(QColorGroup::Base, baseBrush);
w->setPalette(pal);
}
if(w->inherits("QPushButton")){
applyCustomAttributes((QPushButton *)w);
w->installEventFilter(this);
}
if(w->inherits("QButton") || w-> inherits("QComboBox")){
w-> setBackgroundMode ( QWidget::PaletteBackground );
+ w->setBackgroundOrigin ( QWidget::ParentOrigin);
}
bool isViewport = qstrcmp(w->name(), "qt_viewport") == 0 ||
qstrcmp(w->name(), "qt_clipped_viewport") == 0;
bool isViewportChild = w->parent() &&
((qstrcmp(w->parent()->name(), "qt_viewport") == 0) ||
(qstrcmp(w->parent()->name(), "qt_clipped_viewport") == 0));
if(isViewport && w->parent() && qstrcmp(w->parent()->name(), "proxyview") == 0){
w->setBackgroundMode(QWidget::X11ParentRelative);
return;
}
if(isViewportChild){
if(w->inherits("QButton") || w->inherits("QComboBox")){
if(w->parent()){ // heh, only way to test for KHTML children ;-)
if(w->parent()->parent()){
if(w->parent()->parent()->parent() &&
w->parent()->parent()->parent()->inherits("KHTMLView")){
w->setAutoMask(true);
w->setBackgroundMode(QWidget::NoBackground);
}
}
}
return;
}
}
if(w->inherits("QHeader")){
w->setMouseTracking(true);
w->installEventFilter(this);
}
if(w-> inherits("QToolButton")&&w->parent()->inherits("QToolBar")) {
((QToolButton*)w)->setAutoRaise (flatTBButtons);
if ( flatTBButtons )
w->setBackgroundOrigin(QWidget::ParentOrigin);
}
+ if(w-> inherits("QToolBarSeparator")&&w->parent()->inherits("QToolBar")) {
+ ((QFrame *) w)-> setFrameShape ( QFrame::NoFrame );
+ }
if(w->ownPalette() && !w->inherits("QButton") && !w->inherits("QComboBox")){
return;
}
if(w->parent() && w->parent()->isWidgetType() && !((QWidget*)w->parent())->
palette().active().brush(QColorGroup::Background).pixmap()){
qWarning("No parent pixmap for child widget %s", w->className());
return;
}
if(!isViewport && !isViewportChild && !w->testWFlags(WType_Popup) &&
!( !w-> inherits("QLineEdit") && w-> parent() && w-> parent()-> isWidgetType ( ) && w-> parent()-> inherits ( "QMultiLineEdit" ))) {
if(w->backgroundMode() == QWidget::PaletteBackground ||
w->backgroundMode() == QWidget::PaletteButton){
- w->setBackgroundMode(QWidget::X11ParentRelative);
+ w->setBackgroundMode(w->parentWidget()->backgroundMode( )/*QWidget::X11ParentRelative*/);
+ w->setBackgroundOrigin(QWidget::ParentOrigin);
+// w->setBackgroundMode(QWidget::NoBackground);
}
}
+ if ( !w-> inherits("QFrame") || (((QFrame*) w)-> frameShape () == QFrame::NoFrame ))
+ w-> setBackgroundOrigin ( QWidget::ParentOrigin );
+ else if ( w-> inherits("QFrame") )
+ w->setBackgroundOrigin ( QWidget::WidgetOrigin );
+ if ( w->parentWidget()->inherits ( "QWidgetStack" )) {
+ w->setBackgroundOrigin ( QWidget::WidgetOrigin );
+ }
}
void LiquidStyle::unPolish(QWidget *w)
{
if(w->inherits("QMenuBar")){
((QFrame *)w)->setLineWidth(1);
w->setBackgroundMode(QWidget::PaletteBackground);
return;
}
if(w->inherits("QPopupMenu"))
w->setBackgroundMode(QWidget::PaletteButton);
else if(w-> testWFlags(Qt::WType_Popup) && !w->inherits("QListBox")) {
w->removeEventFilter(menuHandler);
}
if(w->isTopLevel())
return;
// for viewport children, don't just check for NoBackground....
bool isViewportChild = w->parent() &&
((qstrcmp(w->parent()->name(), "qt_viewport") == 0) ||
(qstrcmp(w->parent()->name(), "qt_clipped_viewport") == 0));