summaryrefslogtreecommitdiff
path: root/noncore/styles/liquid/liquid.cpp
Unidiff
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:
1083 * since if it's inside a combobox we want to highlight the combobox during 1083 * since if it's inside a combobox we want to highlight the combobox during
1084 * hovering in the edit. 1084 * hovering in the edit.
1085 */ 1085 */
1086bool LiquidStyle::eventFilter(QObject *obj, QEvent *ev) 1086bool LiquidStyle::eventFilter(QObject *obj, QEvent *ev)
1087{ 1087{
1088 if(obj->inherits("QToolBar")){ 1088 if(obj->inherits("QToolBar")){
1089 if(ev->type() == QEvent::Resize){ 1089 if(ev->type() == QEvent::Resize){
1090 const QObjectList *tbChildList = obj->children(); 1090 const QObjectList *tbChildList = obj->children();
1091 QObjectListIt it(*tbChildList); 1091 QObjectListIt it(*tbChildList);
1092 QObject *child; 1092 QObject *child;
1093 while((child = it.current()) != NULL){ 1093 while((child = it.current()) != NULL){
1094 ++it; 1094 ++it;
1095 if(child->isWidgetType()) 1095 if(child->isWidgetType())
1096 ((QWidget *)child)->repaint(true); 1096 ((QWidget *)child)->repaint(true);
1097 } 1097 }
1098 1098
1099 } 1099 }
1100 } 1100 }
1101 else if(obj->inherits("QToolButton")){ 1101 else if(obj->inherits("QToolButton")){
1102 QToolButton *btn = (QToolButton *)obj; 1102 QToolButton *btn = (QToolButton *)obj;
1103 if(ev->type() == QEvent::FocusIn ){ // && !btn-> autoRaise () 1103 if(ev->type() == QEvent::FocusIn ){ // && !btn-> autoRaise ()
1104 if(btn->isEnabled()){ 1104 if(btn->isEnabled()){
1105 highlightWidget = btn; 1105 highlightWidget = btn;
1106 btn->repaint(false); 1106 btn->repaint(false);
1107
1108 qDebug ( "TB FOCUS IN [%p]", btn );
1109 } 1107 }
1110 } 1108 }
1111 else if(ev->type() == QEvent::FocusOut ){ 1109 else if(ev->type() == QEvent::FocusOut ){
1112 if(btn == highlightWidget){ 1110 if(btn == highlightWidget){
1113 highlightWidget = NULL; 1111 highlightWidget = NULL;
1114 btn->repaint(false); 1112 btn->repaint(false);
1115
1116 qDebug ( "TB FOCUS OUT [%p]", btn );
1117 } 1113 }
1118 } 1114 }
1119 else if(ev->type() == QEvent::Paint) { 1115 else if(ev->type() == QEvent::Paint) {
1120 (( HackToolButton *) btn )-> paint ((QPaintEvent *) ev ); 1116 (( HackToolButton *) btn )-> paint ((QPaintEvent *) ev );
1121 return true; 1117 return true;
1122 } 1118 }
1123 } 1119 }
1124 else if(obj->inherits("QRadioButton") || obj->inherits("QCheckBox")){ 1120 else if(obj->inherits("QRadioButton") || obj->inherits("QCheckBox")){
1125 QButton *btn = (QButton *)obj; 1121 QButton *btn = (QButton *)obj;
1126 bool isRadio = obj->inherits("QRadioButton"); 1122 bool isRadio = obj->inherits("QRadioButton");
1127 if(ev->type() == QEvent::Paint){ 1123 if(ev->type() == QEvent::Paint){
1128 //if(btn->autoMask()) 1124 //if(btn->autoMask())
1129 btn->erase(); 1125 btn->erase();
1130 QPainter p; 1126 QPainter p;
1131 p.begin(btn); 1127 p.begin(btn);
1132 QFontMetrics fm = btn->fontMetrics(); 1128 QFontMetrics fm = btn->fontMetrics();
1133 QSize lsz = fm.size(ShowPrefix, btn->text()); 1129 QSize lsz = fm.size(ShowPrefix, btn->text());
1134 QSize sz = isRadio ? exclusiveIndicatorSize() 1130 QSize sz = isRadio ? exclusiveIndicatorSize()
1135 : indicatorSize(); 1131 : indicatorSize();
1136 1132
1137/* 1133/*
1138 if(btn->hasFocus()){ 1134 if(btn->hasFocus()){
1139 QRect r = QRect(0, 0, btn->width(), btn->height()); 1135 QRect r = QRect(0, 0, btn->width(), btn->height());
1140 p.setPen(btn->colorGroup().button().dark(140)); 1136 p.setPen(btn->colorGroup().button().dark(140));
@@ -1226,53 +1222,50 @@ void LiquidStyle::drawButton(QPainter *p, int x, int y, int w, int h,
1226void LiquidStyle::drawToolButton(QPainter *p, int x, int y, int w, int h, 1222void LiquidStyle::drawToolButton(QPainter *p, int x, int y, int w, int h,
1227 const QColorGroup &g, bool sunken, 1223 const QColorGroup &g, bool sunken,
1228 const QBrush *) 1224 const QBrush *)
1229{ 1225{
1230 if(p->device()->devType() != QInternal::Widget){ 1226 if(p->device()->devType() != QInternal::Widget){
1231 // drawing into a temp pixmap, don't use mask 1227 // drawing into a temp pixmap, don't use mask
1232 QColor c = sunken ? g.button() : g.background(); 1228 QColor c = sunken ? g.button() : g.background();
1233 p->setPen(c.dark(130)); 1229 p->setPen(c.dark(130));
1234 p->drawRect(x, y, w, h); 1230 p->drawRect(x, y, w, h);
1235 p->setPen(c.light(105)); 1231 p->setPen(c.light(105));
1236 p->drawRect(x+1, y+1, w-2, h-2); 1232 p->drawRect(x+1, y+1, w-2, h-2);
1237 1233
1238 1234
1239 // fill 1235 // fill
1240 QPixmap *pix = bevelFillDict.find(c.rgb()); 1236 QPixmap *pix = bevelFillDict.find(c.rgb());
1241 if(!pix){ 1237 if(!pix){
1242 int h, s, v; 1238 int h, s, v;
1243 c.hsv(&h, &s, &v); 1239 c.hsv(&h, &s, &v);
1244 pix = new QPixmap(*bevelFillPix); 1240 pix = new QPixmap(*bevelFillPix);
1245 adjustHSV(*pix, h, s, v); 1241 adjustHSV(*pix, h, s, v);
1246 bevelFillDict.insert(c.rgb(), pix); 1242 bevelFillDict.insert(c.rgb(), pix);
1247 } 1243 }
1248 1244
1249 p->drawTiledPixmap(x+2, y+2, w-4, h-4, *pix); 1245 p->drawTiledPixmap(x+2, y+2, w-4, h-4, *pix);
1250 qDebug ( "DRAW TOOLBUTTON IN PIXMAP" );
1251 } 1246 }
1252 else{ 1247 else{
1253 qDebug ( "DRAW TOOLBUTTON sunken=%d/high=%p/device=%p", sunken, highlightWidget,p->device() );
1254
1255 drawClearBevel(p, x, y, w, h, sunken ? g.button() : 1248 drawClearBevel(p, x, y, w, h, sunken ? g.button() :
1256 highlightWidget == p->device() ? g.button().light(110) : 1249 highlightWidget == p->device() ? g.button().light(110) :
1257 g.background(), g.background()); 1250 g.background(), g.background());
1258 } 1251 }
1259} 1252}
1260 1253
1261void LiquidStyle::drawPushButton(QPushButton *btn, QPainter *p) 1254void LiquidStyle::drawPushButton(QPushButton *btn, QPainter *p)
1262{ 1255{
1263 QRect r = btn->rect(); 1256 QRect r = btn->rect();
1264 bool sunken = btn->isOn() || btn->isDown(); 1257 bool sunken = btn->isOn() || btn->isDown();
1265 QColorGroup g = btn->colorGroup(); 1258 QColorGroup g = btn->colorGroup();
1266 1259
1267 1260
1268 //int dw = buttonDefaultIndicatorWidth(); 1261 //int dw = buttonDefaultIndicatorWidth();
1269 if(btn->hasFocus() || btn->isDefault()){ 1262 if(btn->hasFocus() || btn->isDefault()){
1270 QColor c = btn->hasFocus() ? g.button().light(110) : g.background(); 1263 QColor c = btn->hasFocus() ? g.button().light(110) : g.background();
1271 QPixmap *pix = bevelFillDict.find(c.rgb()); 1264 QPixmap *pix = bevelFillDict.find(c.rgb());
1272 if(!pix){ 1265 if(!pix){
1273 int h, s, v; 1266 int h, s, v;
1274 c.hsv(&h, &s, &v); 1267 c.hsv(&h, &s, &v);
1275 pix = new QPixmap(*bevelFillPix); 1268 pix = new QPixmap(*bevelFillPix);
1276 adjustHSV(*pix, h, s, v); 1269 adjustHSV(*pix, h, s, v);
1277 bevelFillDict.insert(c.rgb(), pix); 1270 bevelFillDict.insert(c.rgb(), pix);
1278 } 1271 }