summaryrefslogtreecommitdiff
path: root/noncore/styles/liquid/liquid.cpp
Side-by-side diff
Diffstat (limited to 'noncore/styles/liquid/liquid.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/styles/liquid/liquid.cpp7
1 files changed, 0 insertions, 7 deletions
diff --git a/noncore/styles/liquid/liquid.cpp b/noncore/styles/liquid/liquid.cpp
index daac22c..e6d8310 100644
--- a/noncore/styles/liquid/liquid.cpp
+++ b/noncore/styles/liquid/liquid.cpp
@@ -1083,58 +1083,54 @@ public:
* since if it's inside a combobox we want to highlight the combobox during
* hovering in the edit.
*/
bool LiquidStyle::eventFilter(QObject *obj, QEvent *ev)
{
if(obj->inherits("QToolBar")){
if(ev->type() == QEvent::Resize){
const QObjectList *tbChildList = obj->children();
QObjectListIt it(*tbChildList);
QObject *child;
while((child = it.current()) != NULL){
++it;
if(child->isWidgetType())
((QWidget *)child)->repaint(true);
}
}
}
else if(obj->inherits("QToolButton")){
QToolButton *btn = (QToolButton *)obj;
if(ev->type() == QEvent::FocusIn ){ // && !btn-> autoRaise ()
if(btn->isEnabled()){
highlightWidget = btn;
btn->repaint(false);
-
- qDebug ( "TB FOCUS IN [%p]", btn );
}
}
else if(ev->type() == QEvent::FocusOut ){
if(btn == highlightWidget){
highlightWidget = NULL;
btn->repaint(false);
-
- qDebug ( "TB FOCUS OUT [%p]", btn );
}
}
else if(ev->type() == QEvent::Paint) {
(( HackToolButton *) btn )-> paint ((QPaintEvent *) ev );
return true;
}
}
else if(obj->inherits("QRadioButton") || obj->inherits("QCheckBox")){
QButton *btn = (QButton *)obj;
bool isRadio = obj->inherits("QRadioButton");
if(ev->type() == QEvent::Paint){
//if(btn->autoMask())
btn->erase();
QPainter p;
p.begin(btn);
QFontMetrics fm = btn->fontMetrics();
QSize lsz = fm.size(ShowPrefix, btn->text());
QSize sz = isRadio ? exclusiveIndicatorSize()
: indicatorSize();
/*
if(btn->hasFocus()){
QRect r = QRect(0, 0, btn->width(), btn->height());
p.setPen(btn->colorGroup().button().dark(140));
@@ -1226,53 +1222,50 @@ void LiquidStyle::drawButton(QPainter *p, int x, int y, int w, int h,
void LiquidStyle::drawToolButton(QPainter *p, int x, int y, int w, int h,
const QColorGroup &g, bool sunken,
const QBrush *)
{
if(p->device()->devType() != QInternal::Widget){
// drawing into a temp pixmap, don't use mask
QColor c = sunken ? g.button() : g.background();
p->setPen(c.dark(130));
p->drawRect(x, y, w, h);
p->setPen(c.light(105));
p->drawRect(x+1, y+1, w-2, h-2);
// fill
QPixmap *pix = bevelFillDict.find(c.rgb());
if(!pix){
int h, s, v;
c.hsv(&h, &s, &v);
pix = new QPixmap(*bevelFillPix);
adjustHSV(*pix, h, s, v);
bevelFillDict.insert(c.rgb(), pix);
}
p->drawTiledPixmap(x+2, y+2, w-4, h-4, *pix);
- qDebug ( "DRAW TOOLBUTTON IN PIXMAP" );
}
else{
- qDebug ( "DRAW TOOLBUTTON sunken=%d/high=%p/device=%p", sunken, highlightWidget,p->device() );
-
drawClearBevel(p, x, y, w, h, sunken ? g.button() :
highlightWidget == p->device() ? g.button().light(110) :
g.background(), g.background());
}
}
void LiquidStyle::drawPushButton(QPushButton *btn, QPainter *p)
{
QRect r = btn->rect();
bool sunken = btn->isOn() || btn->isDown();
QColorGroup g = btn->colorGroup();
//int dw = buttonDefaultIndicatorWidth();
if(btn->hasFocus() || btn->isDefault()){
QColor c = btn->hasFocus() ? g.button().light(110) : g.background();
QPixmap *pix = bevelFillDict.find(c.rgb());
if(!pix){
int h, s, v;
c.hsv(&h, &s, &v);
pix = new QPixmap(*bevelFillPix);
adjustHSV(*pix, h, s, v);
bevelFillDict.insert(c.rgb(), pix);
}