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
v3.5.13-sru
tpearson 13 years ago
parent 434af181a1
commit 1e9fe867b0

@ -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
)

@ -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;
@ -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,6 +422,7 @@ void AsteroidStyle::tqdrawPrimitive(TQ_PrimitiveElement pe,
p->setBrush(TQBrush(cg.light(),TQt::Dense4Pattern));
p->drawRect(r);
if (!(sf & Style_ButtonDefault)) {
p->setPen(cg.shadow());
p->drawLine(x, y, x2-1, y);
p->drawLine(x, y, x, y2-1);
@ -440,12 +438,14 @@ void AsteroidStyle::tqdrawPrimitive(TQ_PrimitiveElement pe,
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);
if (!(sf & Style_ButtonDefault)) {
p->setPen(cg.shadow());
p->drawLine(x, y, x2-1, y);
p->drawLine(x, y, x, y2-1);
@ -461,6 +461,7 @@ void AsteroidStyle::tqdrawPrimitive(TQ_PrimitiveElement pe,
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<const TQPushButton *>(w);
if ( ::tqqt_cast<KMultiTabBarButton*>(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<KMultiTabBarButton*>(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:

Loading…
Cancel
Save