From 1e9fe867b0def399c63c42f35e83c3575e91ff83 Mon Sep 17 00:00:00 2001 From: tpearson Date: Mon, 8 Aug 2011 20:34:53 +0000 Subject: Fix Asteroid widget style crash on exit Enhance Asteriod widget style button down look git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1245819 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kstyles/asteroid/CMakeLists.txt | 2 +- kstyles/asteroid/asteroid.cpp | 76 ++++++++++++++++++++--------------------- 2 files changed, 39 insertions(+), 39 deletions(-) (limited to 'kstyles') diff --git a/kstyles/asteroid/CMakeLists.txt b/kstyles/asteroid/CMakeLists.txt index 0918dda96..264a16085 100644 --- a/kstyles/asteroid/CMakeLists.txt +++ b/kstyles/asteroid/CMakeLists.txt @@ -41,6 +41,6 @@ set( ${target}_SRCS tde_add_kpart( ${target} AUTOMOC SOURCES ${${target}_SRCS} - LINK kdefx-shared kutils-shared + LINK kdefx-shared DESTINATION ${PLUGIN_INSTALL_DIR}/plugins/styles ) diff --git a/kstyles/asteroid/asteroid.cpp b/kstyles/asteroid/asteroid.cpp index 452f5bbb7..d449d5a73 100644 --- a/kstyles/asteroid/asteroid.cpp +++ b/kstyles/asteroid/asteroid.cpp @@ -41,8 +41,6 @@ #define l_arrow 0,-3, 0,3, -1,-2, -1,2, -2,-1, -2,1, -3,0 #define r_arrow -2,-3, -2,3, -1,-2, -1,2, 0,-1, 0,1, 1,0 -#include <../../kutils/kmultitabbar.h> - #include "asteroid.h" // #define MINIMUM_PUSHBUTTON_WIDTH 75; @@ -142,7 +140,7 @@ void AsteroidStyle::unPolish(TQWidget *w) */ void AsteroidStyle::polish( TQApplication* app) -{ +{ TQPalette wp = TQApplication::tqpalette(); 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? @@ -154,8 +152,7 @@ AsteroidStyle::polish( TQApplication* app) void AsteroidStyle::unPolish( TQApplication* /* app */ ) { - TQFont f = TQApplication::font(); - TQApplication::tqsetFont( f, TRUE ); // get rid of the special fonts for special widget classes + } void AsteroidStyle::renderMenuBlendPixmap(KPixmap &pix, @@ -425,42 +422,46 @@ void AsteroidStyle::tqdrawPrimitive(TQ_PrimitiveElement pe, p->setBrush(TQBrush(cg.light(),TQt::Dense4Pattern)); p->drawRect(r); - p->setPen(cg.shadow()); - p->drawLine(x, y, x2-1, y); - p->drawLine(x, y, x, y2-1); - - p->setPen(cg.dark()); - p->drawLine(x+1, y+1, x2-2, y+1); - p->drawLine(x+1, y+1, x+1, y2-2); - - p->setPen(cg.light()); - p->drawLine(x, y2, x2, y2); - p->drawLine(x2, y, x2, y2); - - p->setPen(cg.background()); - p->drawLine(x2-1, y2-1, x+1, y2-1); - p->drawLine(x2-1, y2-1, x2-1, y+1); + if (!(sf & Style_ButtonDefault)) { + p->setPen(cg.shadow()); + p->drawLine(x, y, x2-1, y); + p->drawLine(x, y, x, y2-1); + + p->setPen(cg.dark()); + p->drawLine(x+1, y+1, x2-2, y+1); + p->drawLine(x+1, y+1, x+1, y2-2); + + p->setPen(cg.light()); + p->drawLine(x, y2, x2, y2); + p->drawLine(x2, y, x2, y2); + + p->setPen(cg.background()); + p->drawLine(x2-1, y2-1, x+1, y2-1); + p->drawLine(x2-1, y2-1, x2-1, y+1); + } p->setPen(cg.buttonText()); } else if (sf & Style_Down) { p->setPen(cg.mid()); p->drawRect(r); - p->setPen(cg.shadow()); - p->drawLine(x, y, x2-1, y); - p->drawLine(x, y, x, y2-1); - - p->setPen(cg.dark()); - p->drawLine(x+1, y+1, x2-2, y+1); - p->drawLine(x+1, y+1, x+1, y2-2); - - p->setPen(cg.light()); - p->drawLine(x, y2, x2, y2); - p->drawLine(x2, y, x2, y2); - - p->setPen(cg.background()); - p->drawLine(x2-1, y2-1, x+1, y2-1); - p->drawLine(x2-1, y2-1, x2-1, y+1); + if (!(sf & Style_ButtonDefault)) { + p->setPen(cg.shadow()); + p->drawLine(x, y, x2-1, y); + p->drawLine(x, y, x, y2-1); + + p->setPen(cg.dark()); + p->drawLine(x+1, y+1, x2-2, y+1); + p->drawLine(x+1, y+1, x+1, y2-2); + + p->setPen(cg.light()); + p->drawLine(x, y2, x2, y2); + p->drawLine(x2, y, x2, y2); + + p->setPen(cg.background()); + p->drawLine(x2-1, y2-1, x+1, y2-1); + p->drawLine(x2-1, y2-1, x2-1, y+1); + } p->setPen(cg.buttonText()); } else { @@ -1255,7 +1256,7 @@ void AsteroidStyle::tqdrawControl(TQ_ControlElement ce, case CE_PushButton: { const TQPushButton *pb = dynamic_cast(w); - if ( ::tqqt_cast(w) ) { + if ( w->inherits("KMultiTabBarButton") ) { p->setPen(cg.mid()); p->setBrush(cg.background()); p->drawRect(r); @@ -1357,7 +1358,7 @@ void AsteroidStyle::tqdrawControl(TQ_ControlElement ce, dx = r.center().x()-(pixmap.width()/2); else dx = (r.height() - pixmap.height())/2; - if ( ::tqqt_cast(pb) ) { + if ( pb->inherits("KMultiTabBarButton") ) { pr.moveCenter(TQPoint(((pixmap.width()/2)+dx), r.center().y())); dx = (pixmap.width()+dx+(dx*0.5)); } @@ -1940,7 +1941,6 @@ void AsteroidStyle::tqdrawComplexControlMask(TQ_ComplexControl cc, int AsteroidStyle::tqpixelMetric(PixelMetric pm, const TQWidget *w) const { - switch (pm) { /* PixelMetrics available are: -- cgit v1.2.1