Source Code (Use browser search to find items of interest.)
Class Index
kdelibs'KStepStyle (./kdelibs/kstyles/stepplugin/kstep.h:13)
class KStepStyle : public KStyle
{
public:
KStepStyle();
~KStepStyle();
void drawButton(QPainter *p, int x, int y, int w, int h,
const QColorGroup &g, bool sunken = FALSE,
const QBrush *fill = 0 );
QRect buttonRect(int x, int y, int w, int h);
void drawBevelButton(QPainter *p, int x, int y, int w, int h,
const QColorGroup &g, bool sunken = FALSE,
const QBrush *fill = 0 );
void drawPushButton(QPushButton *btn, QPainter *p);
virtual void drawPushButtonLabel (QPushButton *btn, QPainter *p);
void drawScrollBarControls(QPainter*, const QScrollBar*, int sliderStart,
uint controls, uint activeControl );
QStyle::ScrollControl scrollBarPointOver(const QScrollBar *sb,
int sliderStart, const QPoint &p);
void scrollBarMetrics(const QScrollBar *sb, int &sliderMin, int &sliderMax,
int &sliderLength, int &buttonDim);
QSize indicatorSize() const;
void drawIndicator(QPainter* p, int x, int y, int w, int h,
const QColorGroup &g, int state, bool down = FALSE,
bool enabled = TRUE );
QSize exclusiveIndicatorSize() const;
void drawExclusiveIndicator(QPainter* p, int x, int y, int w, int h,
const QColorGroup &g, bool on,
bool down = FALSE, bool enabled = TRUE );
void drawComboButton(QPainter *p, int x, int y, int w, int h,
const QColorGroup &g, bool sunken = FALSE,
bool editable = FALSE, bool enabled = TRUE,
const QBrush *fill = 0 );
QRect comboButtonRect(int x, int y, int w, int h);
QRect comboButtonFocusRect(int x, int y, int w, int h);
int sliderLength() const;
void drawSliderGroove(QPainter *p, int x, int y, int w, int h,
const QColorGroup& g, QCOORD c, Orientation );
void drawArrow(QPainter *p, Qt::ArrowType type, bool down,
int x, int y, int w, int h, const QColorGroup &g,
bool enabled=true, const QBrush *fill = 0);
void drawSlider(QPainter *p, int x, int y, int w, int h,
const QColorGroup &g, Orientation orient,
bool tickAbove, bool tickBelow);
void polish( QApplication*);
void unPolish(QWidget *w);
void polish(QWidget *w);
void polish( QPalette &);
void unPolish( QApplication*);
void drawKToolBar(QPainter *p, int x, int y, int w, int h,
const QColorGroup &g, KToolBarPos type,
QBrush *fill=NULL);
void drawKBarHandle(QPainter *p, int x, int y, int w, int h,
const QColorGroup &g,
KToolBarPos type, QBrush *fill=NULL);
void drawKMenuBar(QPainter *p, int x, int y, int w, int h,
const QColorGroup &g, bool macMode,
QBrush *fill=NULL);
void drawKToolBarButton(QPainter *p, int x, int y, int w, int h,
const QColorGroup &g, bool sunken=false,
bool raised = true, bool enabled = true,
bool popup = false,
KToolButtonType icontext = Icon,
const QString& btext=QString::null,
const QPixmap *icon=NULL,
QFont *font=NULL, QWidget *btn=NULL);
void drawKMenuItem(QPainter *p, int x, int y, int w, int h,
const QColorGroup &g, bool active,
QMenuItem *item, QBrush *fill=NULL);
void drawPopupMenuItem(QPainter *p, bool checkable, int maxpmw,
int tab, QMenuItem *mi, const QPalette &pal,
bool act, bool enabled, int x, int y, int w,
int h);
void drawKProgressBlock(QPainter *p, int x, int y, int w, int h,
const QColorGroup &g, QBrush *fill);
void drawFocusRect(QPainter *p, const QRect &r, const QColorGroup &g,
const QColor *pen, bool atBorder);
protected:
void drawStepBarCircle(QPainter *p, int x, int y, int w, int h,
const QColorGroup &g);
void drawStepBarArrow(QPainter *p, Qt::ArrowType type, int x, int y,
const QColorGroup &g);
void drawStepBarGroove(QPainter *p, QRect r, const QWidget *w,
const QColorGroup &g);
private:
QColorGroup nextGrp;
QPalette oldPopupPal;
};
kdelibs'KStepStyle::KStepStyle() (./kdelibs/kstyles/kstep-highcolor/kstep.cpp:49)
KStepStyle::KStepStyle()
:KStyle()
{
setButtonDefaultIndicatorWidth(4);
if(QPixmap::defaultDepth() > 8){
vSmall = new KPixmap;
vSmall->resize(20, 24);
vMed = new KPixmap;
vMed->resize(20, 34);
vLarge = new KPixmap;
vLarge->resize(20, 64);
hSmall = new KPixmap;
hSmall->resize(24, 20);
hMed = new KPixmap;
hMed->resize(34, 20);
hLarge = new KPixmap;
hLarge->resize(64, 20);
}
else{
vSmall = vMed = vLarge = NULL;
hSmall = hMed = hLarge = NULL;
}
}
kdelibs'KStepStyle::~KStepStyle() (./kdelibs/kstyles/kstep-highcolor/kstep.cpp:73)
KStepStyle::~KStepStyle()
{
if(vSmall){
delete vSmall;
delete vMed;
delete vLarge;
delete hSmall;
delete hMed;
delete hLarge;
}
}
kdelibs'KStepStyle::polish() (./kdelibs/kstyles/kstep-highcolor/kstep.cpp:85)
void KStepStyle::polish(QApplication *)
{
setScrollBarExtent(18);
}
kdelibs'KStepStyle::polish() (./kdelibs/kstyles/kstep-highcolor/kstep.cpp:90)
void KStepStyle::polish(QPalette &pal)
{
KConfig *config = KGlobal::config();
QString oldGrp = config->group();
nextGrp = pal.normal();
nextGrp.setColor(QColorGroup::Dark, Qt::black);
if(vSmall){
KPixmapEffect::gradient(*vSmall, nextGrp.midlight(),
nextGrp.mid(),
KPixmapEffect::VerticalGradient);
KPixmapEffect::gradient(*vMed, nextGrp.midlight(),
nextGrp.mid(),
KPixmapEffect::VerticalGradient);
KPixmapEffect::gradient(*vLarge, nextGrp.midlight(),
nextGrp.mid(),
KPixmapEffect::VerticalGradient);
KPixmapEffect::gradient(*hSmall, nextGrp.midlight(),
nextGrp.mid(),
KPixmapEffect::HorizontalGradient);
KPixmapEffect::gradient(*hMed, nextGrp.midlight(),
nextGrp.mid(),
KPixmapEffect::HorizontalGradient);
KPixmapEffect::gradient(*hLarge, nextGrp.midlight(),
nextGrp.mid(),
KPixmapEffect::HorizontalGradient);
}
config->setGroup("Highcolor");
QString tmpStr = config->readEntry("CustomWallpaper", "");
if(!tmpStr.isEmpty()){
QPixmap wallPaper(tmpStr);
if(!wallPaper.isNull())
pal.setBrush(QColorGroup::Background,
QBrush(pal.color(QPalette::Active, QColorGroup::Background),
wallPaper));
else
warning("Highcolor PillBox: Unable to load wallpaper %s",
tmpStr.latin1());
}
else if(config->readBoolEntry("UseWallpaper", true)){
QPixmap wallPaper;
makeWallpaper(wallPaper,pal.color(QPalette::Active,
QColorGroup::Background));
pal.setBrush(QColorGroup::Background,
QBrush(pal.color(QPalette::Active, QColorGroup::Background),
wallPaper));
}
config->setGroup(oldGrp);
}
kdelibs'KStepStyle::unPolish() (./kdelibs/kstyles/kstep-highcolor/kstep.cpp:140)
void KStepStyle::unPolish(QApplication *)
{
setScrollBarExtent(16);
}
kdelibs'KStepStyle::polish() (./kdelibs/kstyles/kstep-highcolor/kstep.cpp:145)
void KStepStyle::polish(QWidget *w)
{
if(w->inherits("QPopupMenu")){ // force to our colorgroup
oldPopupPal = w->palette();
w->setPalette(QPalette(nextGrp, nextGrp, nextGrp));
}
if(QPixmap::defaultDepth() > 8){
if(w->inherits("KToolBar"))
w->installEventFilter(this);
if(w->inherits("KToolBarButton"))
w->setBackgroundMode(QWidget::NoBackground);
}
}
kdelibs'KStepStyle::unPolish() (./kdelibs/kstyles/kstep-highcolor/kstep.cpp:160)
void KStepStyle::unPolish(QWidget *w)
{
if(w->inherits("QPopupMenu"))
w->setPalette(oldPopupPal);
if(QPixmap::defaultDepth() > 8){
if(w->inherits("KToolBar"))
w->removeEventFilter(this);
if(w->inherits("KToolBarButton"))
w->setBackgroundMode(QWidget::PaletteBackground);
}
}
kdelibs'KStepStyle::eventFilter() (./kdelibs/kstyles/kstep-highcolor/kstep.cpp:173)
bool KStepStyle::eventFilter(QObject *obj, QEvent *ev)
{
if(ev->type() == QEvent::Resize){
// must be a toolbar resize
QObjectList *tbChildList = obj->queryList("KToolBarButton", NULL,
false, false);
QObjectListIt it(*tbChildList);
QObject *child;
while((child = it.current()) != NULL){
++it;
if(child->isWidgetType())
((QWidget *)child)->repaint(false);
}
}
return(false);
}
kdelibs'KStepStyle::drawButton() (./kdelibs/kstyles/kstep-highcolor/kstep.cpp:191)
void KStepStyle::drawButton(QPainter *p, int x, int y, int w, int h,
const QColorGroup &g, bool sunken,
const QBrush *)
{
QPen oldPen = p->pen();
int x2 = x+w-1;
int y2 = y+h-1;
drawVGradient(p, g.brush(QColorGroup::Mid), x+1, y+1, w-2, h-2);
p->setPen(sunken ? Qt::black : g.light());
p->drawLine(x, y, x2-1, y);
p->drawLine(x, y, x, y2-1);
p->setPen(sunken ? g.midlight() : g.mid());
p->drawLine(x+1, y2-1, x2-1, y2-1);
p->drawLine(x2-1, y+1, x2-1, y2-1);
p->setPen(sunken ? g.light() : Qt::black);
p->drawLine(x, y2, x2, y2);
p->drawLine(x2, y, x2, y2);
p->setPen(oldPen);
}
kdelibs'KStepStyle::drawPushButton() (./kdelibs/kstyles/kstep-highcolor/kstep.cpp:212)
void KStepStyle::drawPushButton(QPushButton *btn, QPainter *p)
{
QRect r = btn->rect();
if(btn->isDefault() || btn->autoDefault()){
if(btn->isDefault())
kDrawNextButton(p, r, nextGrp, true);
drawButton(p, r.x()+4, r.y()+4, r.width()-8, r.height()-8, nextGrp,
btn->isOn() || btn->isDown());
}
else
drawButton(p, r.x(), r.y(), r.width(), r.height(), nextGrp,
btn->isOn() || btn->isDown());
}
kdelibs'KStepStyle::drawPushButtonLabel() (./kdelibs/kstyles/kstep-highcolor/kstep.cpp:228)
void KStepStyle::drawPushButtonLabel(QPushButton *btn, QPainter *p)
{
int x1, y1, x2, y2;
btn->rect().coords(&x1, &y1, &x2, &y2);
bool act = btn->isOn() || btn->isDown();
static QBitmap arrowLightBmp(15, 9, arrow_light_bits, true);
static QBitmap arrowDarkBmp(15, 9, arrow_dark_bits, true);
static QBitmap arrowMidBmp(15, 9, arrow_mid_bits, true);
if(!arrowLightBmp.mask()){
arrowLightBmp.setMask(arrowLightBmp);
arrowDarkBmp.setMask(arrowDarkBmp);
arrowMidBmp.setMask(arrowMidBmp);
}
if (btn->isDefault()) {
// If this is a default button, we have a 4 pixel border which is
// used to give a frame.
// We need to add the 'return' pixmap in the correct position too.
// We adjust the width available for the label according to how
// much space is left after adding the pixmap at the right edge.
// - rikkus
// Changed to kColorBitmaps (mosfet
kColorBitmaps(p, btn->colorGroup(), btn->width() - 24,
btn->height() / 2 - 4, &arrowLightBmp, &arrowMidBmp,
NULL, &arrowDarkBmp, NULL, NULL);
drawItem(p,
(x1+act?1:0) + 6, y1+act?1:0,
btn->width() - 26, btn->height(),
AlignCenter | ShowPrefix, btn->colorGroup(), btn->isEnabled(),
btn->pixmap(), btn->text(), -1,
act ? &btn->colorGroup().light() : &btn->colorGroup().buttonText());
} else {
drawItem(p, x1+act?1:0, y1+act?1:0, btn->width(), btn->height(),
AlignCenter | ShowPrefix, btn->colorGroup(), btn->isEnabled(),
btn->pixmap(), btn->text(), -1,
act ? &btn->colorGroup().light() : &btn->colorGroup().buttonText());
}
}
kdelibs'KStepStyle::drawBevelButton() (./kdelibs/kstyles/kstep-highcolor/kstep.cpp:274)
void KStepStyle::drawBevelButton(QPainter *p, int x, int y, int w, int h,
const QColorGroup &, bool sunken,
const QBrush *fill)
{
drawButton(p, x, y, w, h, nextGrp, sunken, fill);
}
kdelibs'KStepStyle::buttonRect() (./kdelibs/kstyles/kstep-highcolor/kstep.cpp:281)
QRect KStepStyle::buttonRect(int x, int y, int w, int h)
{
return(QRect(x, y, w, h));
}
kdelibs'KStepStyle::drawComboButton() (./kdelibs/kstyles/kstep-highcolor/kstep.cpp:286)
void KStepStyle::drawComboButton(QPainter *p, int x, int y, int w, int h,
const QColorGroup &g, bool sunken,
bool, bool, const QBrush
*fill)
{
drawButton(p, x, y, w, h, nextGrp, sunken, fill);
int deco_y = (h-6)/2;
drawButton(p, x + w-16, y + deco_y, 10, 6, nextGrp, false, fill);
p->setPen(g.mid());
p->drawLine( x+w-6, y+deco_y+6, x+w-15, y+deco_y+6);
p->drawLine( x+w-6, y+deco_y+1, x+w-6, y+deco_y+6);
}
kdelibs'KStepStyle::comboButtonRect() (./kdelibs/kstyles/kstep-highcolor/kstep.cpp:300)
QRect KStepStyle::comboButtonRect(int x, int y, int w, int h){
return(QRect(x+4, y+4, w-8-16, h-8));
}
kdelibs'KStepStyle::comboButtonFocusRect() (./kdelibs/kstyles/kstep-highcolor/kstep.cpp:304)
QRect KStepStyle::comboButtonFocusRect(int x, int y, int w, int h)
{
return(QRect(x+5, y+5, w-10-16, h-10));
}
kdelibs'KStepStyle::drawScrollBarControls() (./kdelibs/kstyles/kstep-highcolor/kstep.cpp:309)
void KStepStyle::drawScrollBarControls(QPainter *p, const QScrollBar *sb,
int sliderStart, uint controls,
uint activeControl)
{
int sliderMin, sliderMax, sliderLength, buttonDim;
QRect add, sub, addPage, subPage, slider;
int addX, addY, subX, subY;
bool horizontal = sb->orientation() == QScrollBar::Horizontal;
int len = (horizontal) ? sb->width() : sb->height();
int extent = (horizontal) ? sb->height() : sb->width();
QColorGroup g = sb->colorGroup();
scrollBarMetrics(sb, sliderMin, sliderMax, sliderLength, buttonDim);
if(sliderStart > sliderMax)
sliderStart = sliderMax;
int sliderEnd = sliderStart + sliderLength;
if(horizontal){
subY = addY = (extent - buttonDim)/2;
subX = 1;
addX = buttonDim;
sub.setRect(subX, subY, buttonDim, buttonDim);
add.setRect(addX, addY, buttonDim, buttonDim);
subPage.setRect(buttonDim*2, 0, sliderStart-1, extent);
addPage.setRect(sliderEnd, 0, len-sliderEnd, extent);
slider.setRect(sliderStart, 0, sliderLength, extent);
}
else{
subX = addX = (extent - buttonDim)/2;
subY = len - (buttonDim*2);
addY = len - buttonDim-1;
sub.setRect(subX, subY, buttonDim, buttonDim);
add.setRect(addX, addY, buttonDim, buttonDim);
subPage.setRect(0, 1, extent, sliderStart-1);
addPage.setRect(0, sliderEnd, extent, subY-sliderEnd);
slider.setRect(0, sliderStart, extent, sliderLength);
}
if(controls & AddLine){
if(add.isValid()){
p->setPen(g.mid());
p->drawRect(add);
qDrawShadePanel(p, add.x()+1, add.y()+1, add.width()-2,
add.height()-2, nextGrp, activeControl == AddLine, 1);
drawVGradient(p, g.brush(QColorGroup::Mid), add.x()+2, add.y()+2,
add.width()-4, add.height()-4);
drawStepBarArrow(p, (horizontal) ? RightArrow : DownArrow,
add.x()+3, add.y()+3, nextGrp);
}
}
if(controls & SubLine){
if(sub.isValid()){
p->setPen(g.mid());
p->drawRect(sub);
qDrawShadePanel(p, sub.x()+1, sub.y()+1, sub.width()-2,
sub.height()-2, nextGrp, activeControl == SubLine, 1);
drawVGradient(p, g.brush(QColorGroup::Mid), sub.x()+2, sub.y()+2,
sub.width()-4, sub.height()-4);
drawStepBarArrow(p, (horizontal) ? LeftArrow : UpArrow, sub.x()+3,
sub.y()+3, nextGrp);
}
}
if((controls & SubPage)){
drawStepBarGroove(p, subPage, sb, g, horizontal);
}
if((controls & AddPage)){
drawStepBarGroove(p, addPage, sb, g, horizontal);
}
if(controls & Slider){
if(slider.isValid() && slider.width() > 1 && slider.height() > 1){
if(horizontal){
p->setPen(Qt::black);
p->drawLine(slider.x(), slider.y(), slider.right(), slider.y());
p->drawLine(slider.x(), slider.bottom(), slider.right(), slider.bottom());
p->setPen(g.mid());
p->drawLine(slider.x(), slider.y()+1, slider.right(), slider.y()+1);
p->drawLine(slider.x(), slider.bottom()-1, slider.right(), slider.bottom()-1);
drawSBSlider(p, slider.x(), slider.y()+2, slider.width(),
slider.height()-4, nextGrp, activeControl==Slider,
Qt::Horizontal);
}
else{
p->setPen(Qt::black);
p->drawLine(slider.x(), slider.y(), slider.x(), slider.bottom());
p->drawLine(slider.right(), slider.y(), slider.right(), slider.bottom());
p->setPen(g.mid());
p->drawLine(slider.x()+1, slider.y(), slider.x()+1, slider.bottom());
p->drawLine(slider.right()-1, slider.y(), slider.right()-1, slider.bottom());
drawSBSlider(p, slider.x()+2, slider.y(), slider.width()-4,
slider.height(), nextGrp, activeControl==Slider,
Qt::Vertical);
}
if(slider.width() > 8 && slider.height() > 8)
drawStepBarCircle(p, slider.x(), slider.y(), slider.width(),
slider.height(), nextGrp);
}
}
}
kdelibs'KStepStyle::drawSBSlider() (./kdelibs/kstyles/kstep-highcolor/kstep.cpp:409)
void KStepStyle::drawSBSlider(QPainter *p, int x, int y, int w, int h,
const QColorGroup &g, bool sunken, Orientation o)
{
int x2 = x+w-1;
int y2 = y+h-1;
p->setPen(sunken ? Qt::black : g.light());
p->drawLine(x, y, x2-1, y);
p->drawLine(x, y, x, y2-1);
p->setPen(sunken ? g.midlight() : g.mid());
p->drawLine(x+1, y2-1, x2-1, y2-1);
p->drawLine(x2-1, y+1, x2-1, y2-1);
p->setPen(sunken ? g.light() : Qt::black);
p->drawLine(x, y2, x2, y2);
p->drawLine(x2, y, x2, y2);
if(o == Horizontal)
drawVGradient(p, g.brush(QColorGroup::Mid), x+1, y+1, w-2, h-2);
else
drawHGradient(p, g.brush(QColorGroup::Mid), x+1, y+1, w-2, h-2);
}
kdelibs'KStepStyle::drawStepBarGroove() (./kdelibs/kstyles/kstep-highcolor/kstep.cpp:431)
void KStepStyle::drawStepBarGroove(QPainter *p, QRect r, const QWidget *w,
const QColorGroup &g, bool horiz)
{
// dont draw over black lines or it flickers
if(r.left() == 0)
r.setLeft(1);
if(r.top() == 0)
r.setTop(1);
if(r.right() == w->width()-1)
r.setRight(w->width()-2);
if(r.bottom() == w->height()-1)
r.setBottom(w->height()-2);
//p->fillRect(r, g.brush(QColorGroup::Mid));
if(horiz)
drawVGradient(p, g.brush(QColorGroup::Mid), r.x(), r.y(), r.width(),
r.height());
else
drawHGradient(p, g.brush(QColorGroup::Mid), r.x(), r.y(), r.width(),
r.height());
p->setPen(Qt::black);
p->drawRect(0, 0, w->width(), w->height());
}
kdelibs'KStepStyle::scrollBarMetrics() (./kdelibs/kstyles/kstep-highcolor/kstep.cpp:454)
void KStepStyle::scrollBarMetrics(const QScrollBar *sb, int &sliderMin,
int &sliderMax, int &sliderLength,
int &buttonDim)
{
int maxlen;
bool horizontal = sb->orientation() == QScrollBar::Horizontal;
int len = (horizontal) ? sb->width() : sb->height();
int extent = (horizontal) ? sb->height() : sb->width();
if(len > (extent - 1)*2)
buttonDim = extent-2;
else
buttonDim = len/2 - 1;
if(horizontal)
sliderMin = buttonDim*2;
else
sliderMin = 1;
maxlen = len - buttonDim*2 - 1;
sliderLength = (sb->pageStep()*maxlen) / (sb->maxValue() -
sb->minValue() + sb->pageStep());
if(sliderLength < 12)
sliderLength = 12;
if(sliderLength > maxlen)
sliderLength = maxlen;
sliderMax = sliderMin + maxlen - sliderLength;
}
QStyle::ScrollControl KStepStyle::scrollBarPointOver(const QScrollBar *sb,
int sliderStart,
const QPoint &p)
{
if(!sb->rect().contains(p))
return(NoScroll);
int sliderMin, sliderMax, sliderLength, buttonDim;
scrollBarMetrics(sb, sliderMin, sliderMax, sliderLength, buttonDim);
if(sb->orientation() == QScrollBar::Horizontal){
int x = p.x();
if(x <= buttonDim)
return(SubLine);
else if(x <= buttonDim*2)
return(AddLine);
else if(x < sliderStart)
return(SubPage);
else if(x < sliderStart+sliderLength)
return(Slider);
return(AddPage);
}
else{
int y = p.y();
if(y < sliderStart)
return(SubPage);
else if(y < sliderStart+sliderLength)
return(Slider);
else if(y < sliderMax+sliderLength)
return(AddPage);
else if(y < sliderMax+sliderLength+buttonDim)
return(SubLine);
return(AddLine);
}
}
kdelibs'KStepStyle::drawStepBarCircle() (./kdelibs/kstyles/kstep-highcolor/kstep.cpp:521)
void KStepStyle::drawStepBarCircle(QPainter *p, int x, int y, int w,
int h, const QColorGroup &g)
{
static QCOORD circle_dark[] = {2,0, 3,0, 4,0,
1,1,
0,2,
0,3,
0,4
};
static QCOORD circle_mid[] = {1,0,
0,1, 2,1, 3,1, 4,1, 5,1,
1,2, 2,2,
1,3,
1,4,
1,5
};
static QCOORD circle_light[] = { 4,3, 5,3,
3, 4, 4,4, 5,4,
3,5, 4,5
};
QPen oldPen = p->pen();
x = x + w/2 - 3;
y = y + h/2 - 3;
QPointArray a( QCOORDARRLEN(circle_dark), circle_dark );
a.translate( x, y );
p->setPen( g.dark() );
p->drawPoints( a );
a.setPoints( QCOORDARRLEN(circle_light), circle_light );
a.translate( x, y );
p->setPen( g.light() );
p->drawPoints( a );
a.setPoints( QCOORDARRLEN(circle_mid), circle_mid );
a.translate( x, y );
p->setPen( g.mid() );
p->drawPoints( a );
p->setPen(oldPen);
}
kdelibs'KStepStyle::exclusiveIndicatorSize() (./kdelibs/kstyles/kstep-highcolor/kstep.cpp:563)
QSize KStepStyle::exclusiveIndicatorSize() const
{
return(QSize(15,15));
}
kdelibs'KStepStyle::drawExclusiveIndicator() (./kdelibs/kstyles/kstep-highcolor/kstep.cpp:568)
void KStepStyle::drawExclusiveIndicator(QPainter *p, int x, int y, int w,
int h, const QColorGroup &g, bool on,
bool down, bool)
{
static QCOORD circle_dark[] = {5,1, 6,1, 7,1, 8,1, 9,1, 10,1,
3,2, 4,2,
2,3,
2,4,
1,5,
1,6,
1,7,
1,8,
1,9,
2,10
};
static QCOORD circle_mid[] = {5,0, 6,0, 7,0, 8,0, 9,0,
3,1, 4,1, 11,1,
2,2, 10,2, 12,2,
1,3, 3,3,
1,4,
0,5,
0,6,
0,7,
0,8,
0,9,
1,10,
1,11,
2,12
};
static QCOORD circle_light[] = {14,5,
14,6,
14,7,
14,8,
14,9,
13,10,
13,11,
12,12,
4,13, 5,13, 10,13, 11,13,
5,14, 6,14, 7,14, 8,14, 9,14
};
static QCOORD fill_lines[] = {6,3, 9,3, 3,6, 3,9, 12,6, 12,9, 6,12, 9,12};
QPen oldPen = p->pen();
p->fillRect( x, y, w, h, g.brush(QColorGroup::Background));
QPointArray a( QCOORDARRLEN(circle_dark), circle_dark );
a.translate( x, y );
p->setPen(nextGrp.dark() );
p->drawPoints( a );
a.setPoints( QCOORDARRLEN(circle_mid), circle_mid );
a.translate( x, y );
p->setPen(nextGrp.mid() );
p->drawPoints( a );
a.setPoints( QCOORDARRLEN(circle_light), circle_light );
a.translate( x, y );
p->setPen(nextGrp.light() );
p->drawPoints( a );
if(on || down){
if(down)
p->setPen(nextGrp.mid());
a.setPoints(QCOORDARRLEN(fill_lines), fill_lines);
a.translate(x,y);
p->drawLineSegments(a);
p->fillRect(4, 4, 8, 8, (down)? g.brush(QColorGroup::Mid) :
nextGrp.brush(QColorGroup::Light));
}
p->setPen(oldPen);
}
kdelibs'KStepStyle::indicatorSize() (./kdelibs/kstyles/kstep-highcolor/kstep.cpp:639)
QSize KStepStyle::indicatorSize() const
{
return(QSize(16, 16));
}
kdelibs'KStepStyle::drawIndicator() (./kdelibs/kstyles/kstep-highcolor/kstep.cpp:644)
void KStepStyle::drawIndicator(QPainter *p, int x, int y, int w, int h,
const QColorGroup &, int state, bool down, bool)
{
drawButton(p, x, y, w, h, nextGrp, down);
if(state != QButton::Off){
QPen oldPen = p->pen();
p->setPen(nextGrp.light());
p->drawLine(x+5, y+6, x+5, y+10);
p->drawLine(x+5, y+10, x+w-4, y+3);
p->setPen(nextGrp.dark());
p->drawLine(x+5, y+11, x+w-4, y+4);
p->drawLine(x+6, y+6, x+6, y+7);
p->setPen(nextGrp.mid());
p->drawLine(x+6, y+11, x+w-4, y+5);
p->drawLine(x+6, y+8, x+7, y+7);
p->setPen(oldPen);
}
}
kdelibs'KStepStyle::drawStepBarArrow() (./kdelibs/kstyles/kstep-highcolor/kstep.cpp:663)
void KStepStyle::drawStepBarArrow(QPainter *p, Qt::ArrowType type, int x,
int y, const QColorGroup &g)
{
static QBitmap upArrow(9, 9, uparrow_bits, true);
static QBitmap downArrow(9, 9, downarrow_bits, true);
static QBitmap leftArrow(9, 9, leftarrow_bits, true);
static QBitmap rightArrow(9, 9, rightarrow_bits, true);
if(!upArrow.mask()){
upArrow.setMask(upArrow);
downArrow.setMask(downArrow);
leftArrow.setMask(leftArrow);
rightArrow.setMask(rightArrow);
}
p->setPen(g.dark());
switch(type){
case Qt::UpArrow:
p->drawPixmap(x, y, upArrow);
break;
case Qt::DownArrow:
p->drawPixmap(x, y, downArrow);
break;
case Qt::LeftArrow:
p->drawPixmap(x, y, leftArrow);
break;
default:
p->drawPixmap(x, y, rightArrow);
break;
}
}
kdelibs'KStepStyle::drawSliderGroove() (./kdelibs/kstyles/kstep-highcolor/kstep.cpp:696)
void KStepStyle::drawSliderGroove(QPainter *p, int x, int y, int w, int h,
const QColorGroup &g, QCOORD,
Orientation orient)
{
qDrawShadePanel(p, x, y, w, h, nextGrp, true, 1);
if(orient == Horizontal)
drawVGradient(p, g.brush(QColorGroup::Mid), x+1, y+1, w-2, h-2);
else
drawHGradient(p, g.brush(QColorGroup::Mid), x+1, y+1, w-2, h-2);
}
kdelibs'KStepStyle::sliderLength() (./kdelibs/kstyles/kstep-highcolor/kstep.cpp:707)
int KStepStyle::sliderLength() const
{
return(30);
}
kdelibs'KStepStyle::drawSlider() (./kdelibs/kstyles/kstep-highcolor/kstep.cpp:712)
void KStepStyle::drawSlider(QPainter *p, int x, int y, int w, int h,
const QColorGroup &g, Orientation orient,
bool, bool)
{
drawButton(p, x+1, y+1, w-2, h-2, nextGrp, false);
if(orient == Horizontal){
int mid = x+w/2;
qDrawShadeLine(p, mid, y+1, mid, y+h-2, g, true, 1);
}
else{
int mid = y+w/2;
qDrawShadeLine(p, x+1, mid, x+w-2, mid, g, true, 1);
}
}
kdelibs'KStepStyle::drawArrow() (./kdelibs/kstyles/kstep-highcolor/kstep.cpp:727)
void KStepStyle::drawArrow(QPainter *p, Qt::ArrowType type, bool down, int x,
int y, int w, int h, const QColorGroup &g,
bool enabled, const QBrush *)
{
qDrawArrow(p, type, Qt::MotifStyle, down, x, y, w, h, g, enabled);
}
kdelibs'KStepStyle::drawKBarHandle() (./kdelibs/kstyles/kstep-highcolor/kstep.cpp:734)
void KStepStyle::drawKBarHandle(QPainter *p, int x, int y, int w, int h,
const QColorGroup &g, KToolBarPos, QBrush *)
{
drawButton(p, x, y, w, h, g, false);
}
kdelibs'KStepStyle::drawKMenuBar() (./kdelibs/kstyles/kstep-highcolor/kstep.cpp:740)
void KStepStyle::drawKMenuBar(QPainter *p, int x, int y, int w, int h,
const QColorGroup &, bool, QBrush *)
{
drawButton(p, x, y, w, h, nextGrp, false);
}
kdelibs'KStepStyle::drawKToolBar() (./kdelibs/kstyles/kstep-highcolor/kstep.cpp:746)
void KStepStyle::drawKToolBar(QPainter *p, int x, int y, int w, int h,
const QColorGroup &g, KToolBarPos, QBrush *)
{
int x2 = x+w-1;
int y2 = y+h-1;
if(w > h)
drawVGradient(p, g.brush(QColorGroup::Mid), x+1, y+1, w-2, h-2);
else
drawHGradient(p, g.brush(QColorGroup::Mid), x+1, y+1, w-2, h-2);
p->setPen(g.light());
p->drawLine(x, y, x2-1, y);
p->drawLine(x, y, x, y2-1);
p->setPen(Qt::black);
p->drawLine(x, y2, x2, y2);
p->drawLine(x2, y, x2, y2);
}
kdelibs'KStepStyle::drawKToolBarButton() (./kdelibs/kstyles/kstep-highcolor/kstep.cpp:763)
void KStepStyle::drawKToolBarButton(QPainter *p, int x, int y, int w, int h,
const QColorGroup &g, bool sunken,
bool raised, bool enabled, bool popup,
KToolButtonType icontext,
const QString& btext, const QPixmap *pixmap,
QFont *font, QWidget *btn)
{
int x2 = x+w-1;
int y2 = y+h-1;
int dx, dy;
if(raised || sunken){
p->setPen(sunken ? g.dark() : g.light());
p->drawLine(x, y, x2, y);
p->drawLine(x, y, x, y2);
p->setPen(sunken ? g.light() : g.dark());
p->drawLine(x, y2, x2-1, y2);
p->drawLine(x2, y, x2, y2-1);
drawVGradient(p, g.brush(QColorGroup::Mid), x+1, y+1, w-2, h-2);
}
else{
if(btn->parent() && btn->parent()->isWidgetType()){
QWidget *toolbar = (QWidget*)btn->parent();
// horizontal toolbar
if(toolbar->width() > toolbar->height()){
// See if we are top row. Buttons are offset a few pixels
// but not visibly.
if(btn->y() <= 3){
if(toolbar->height() <= 24)
p->drawTiledPixmap(x, y, w, h, *vSmall);
else if(toolbar->height() <= 34)
p->drawTiledPixmap(x, y, w, h, *vMed);
else
p->drawTiledPixmap(x, y, w, h, *vLarge);
}
// See if we are in the gradient at all. Two rows always are
// large.
else if(btn->y() <= 64){
p->fillRect(x, y, w, h, g.mid());
p->drawTiledPixmap(x, y, w, 64-btn->y(),
*vLarge, 0, btn->y());
}
// nope, we are not in the gradient
else
p->fillRect(x, y, w, h, g.mid());
}
// vertical toolbar
else{
if(btn->x() <= 3){
if(toolbar->width() <= 24)
p->drawTiledPixmap(x, y, w, h, *hSmall);
else if(toolbar->width() <= 34)
p->drawTiledPixmap(x, y, w, h, *hMed);
else
p->drawTiledPixmap(x, y, w, h, *hLarge);
}
else if(btn->x() <= 64){
p->fillRect(x, y, w, h, g.mid());
p->drawTiledPixmap(x, y, 64-btn->x(), h,
*hLarge, btn->x(), 0);
}
else
p->fillRect(x, y, w, h, g.mid());
}
}
}
p->setPen(g.text());
if (icontext == Icon){ // icon only
if (pixmap){
dx = ( w - pixmap->width() ) / 2;
dy = ( h - pixmap->height() ) / 2;
if ( sunken )
{
++dx;
++dy;
}
p->drawPixmap( x+dx, y+dy, *pixmap );
}
}
else if (icontext == IconTextRight){ // icon and text (if any)
if (pixmap){
dx = 1;
dy = ( h - pixmap->height() ) / 2;
if ( sunken ){
++dx;
++dy;
}
p->drawPixmap( x+dx, y+dy, *pixmap );
}
if (!btext.isNull()){
int tf = AlignVCenter|AlignLeft;
if (!enabled)
p->setPen(g.dark());
if (pixmap)
dx= pixmap->width();
else
dx= 1;
dy = 0;
if ( sunken ){
++dx;
++dy;
}
if (font)
p->setFont(*font);
if(raised)
p->setPen(Qt::blue);
p->drawText(x+dx, y+dy, w-dx, h, tf, btext);
}
}
else if (icontext == Text){ // only text, even if there is a icon
if (!btext.isNull()){
int tf = AlignVCenter|AlignLeft;
if (!enabled)
p->setPen(g.dark());
dx= 1;
dy= 0;
if ( sunken ){
++dx;
++dy;
}
if (font)
p->setFont(*font);
if(raised)
p->setPen(Qt::blue);
p->drawText(x+dx, y+dy, w-dx, h, tf, btext);
}
}
else if (icontext == IconTextBottom){
if (pixmap){
dx = (w - pixmap->width()) / 2;
dy = 1;
if ( sunken ){
++dx;
++dy;
}
p->drawPixmap( x+dx, y+dy, *pixmap );
}
if (!btext.isNull()){
int tf = AlignBottom|AlignHCenter;
if (!enabled)
p->setPen(g.dark());
dy= pixmap->height();
dx = 2;
if ( sunken ){
++dx;
++dy;
}
if (font)
p->setFont(*font);
if(raised)
p->setPen(Qt::blue);
p->drawText(x, y, w, h-4, tf, btext);
}
}
if (popup){
if (enabled)
qDrawArrow (p, Qt::DownArrow, Qt::WindowsStyle, false, w-5, h-5, 0, 0,
g, true);
else
qDrawArrow (p, Qt::DownArrow, Qt::WindowsStyle, false, w-5, h-5,
0, 0, g, false);
}
}
kdelibs'KStepStyle::drawKMenuItem() (./kdelibs/kstyles/kstep-highcolor/kstep.cpp:931)
void KStepStyle::drawKMenuItem(QPainter *p, int x, int y, int w, int h,
const QColorGroup &g, bool active, QMenuItem *mi,
QBrush *)
{
QColor btext = active ? g.light() : g.buttonText();
if(active){
int x2 = x+w-1;
int y2 = y+h-1;
p->setPen(g.light());
p->drawLine(x, y, x2, y);
p->drawLine(x, y, x, y2);
p->setPen(g.dark());
p->drawLine(x2, y, x2, y2);
p->drawLine(x, y2, x2, y2);
p->fillRect(x+1, y+1, w-2, h-2, g.mid());
}
QApplication::style().drawItem(p, x, y, w, h,
AlignCenter|ShowPrefix|DontClip|SingleLine,
g, mi->isEnabled(), mi->pixmap(), mi->text(),
-1, &btext );
}
kdelibs'KStepStyle::drawPopupMenuItem() (./kdelibs/kstyles/kstep-highcolor/kstep.cpp:953)
void KStepStyle::drawPopupMenuItem( QPainter* p, bool checkable, int maxpmw,
int tab, QMenuItem* mi,
const QPalette& pal, bool act,
bool enabled, int x, int y, int w, int h)
{
static const int motifItemFrame = 2;
static const int motifItemHMargin = 3;
static const int motifItemVMargin = 2;
static const int motifArrowHMargin = 6;
static const int windowsRightBorder = 12;
if(act){
bool dis = !enabled;
QColorGroup itemg = dis ? pal.disabled() : pal.active();
if (checkable)
maxpmw = QMAX( maxpmw, 12 );
int checkcol = maxpmw;
int x2 = x+w-1;
int y2 = y+h-1;
p->setPen(itemg.light());
p->drawLine(x, y, x2, y);
p->drawLine(x, y, x, y2);
p->setPen(itemg.dark());
p->drawLine(x2, y, x2, y2);
p->drawLine(x, y2, x2, y2);
p->fillRect(x+1, y+1, w-2, h-2, itemg.mid());
if ( mi->iconSet() ) {
QIconSet::Mode mode = dis? QIconSet::Disabled : QIconSet::Normal;
if (!dis)
mode = QIconSet::Active;
QPixmap pixmap = mi->iconSet()->pixmap(QIconSet::Small, mode);
int pixw = pixmap.width();
int pixh = pixmap.height();
QRect cr(x, y, checkcol, h);
QRect pmr(0, 0, pixw, pixh);
pmr.moveCenter( cr.center() );
p->setPen(itemg.text());
p->drawPixmap(pmr.topLeft(), pixmap );
}
else if(checkable) {
int mw = checkcol + motifItemFrame;
int mh = h - 2*motifItemFrame;
if (mi->isChecked()){
drawCheckMark( p, x + motifItemFrame,
y+motifItemFrame, mw, mh, itemg, act, dis );
}
}
p->setPen(itemg.light());
QColor discol;
if (dis) {
discol = itemg.text();
p->setPen(discol);
}
int xm = motifItemFrame + checkcol + motifItemHMargin;
QString s = mi->text();
if (!s.isNull()) {
int t = s.find( '\t' );
int m = motifItemVMargin;
const int text_flags = AlignVCenter|ShowPrefix | DontClip | SingleLine;
if (t >= 0) {
p->drawText(x+w-tab-windowsRightBorder-motifItemHMargin-motifItemFrame,
y+m, tab, h-2*m, text_flags, s.mid( t+1 ));
}
p->drawText(x+xm, y+m, w-xm-tab+1, h-2*m, text_flags, s, t);
} else if (mi->pixmap()) {
QPixmap *pixmap = mi->pixmap();
if (pixmap->depth() == 1)
p->setBackgroundMode(OpaqueMode);
p->drawPixmap( x+xm, y+motifItemFrame, *pixmap);
if (pixmap->depth() == 1)
p->setBackgroundMode(TransparentMode);
}
if (mi->popup()) {
int dim = (h-2*motifItemFrame) / 2;
if (!dis)
discol = itemg.text();
QColorGroup g2(discol, itemg.highlight(),
white, white,
dis ? discol : white,
discol, white);
drawArrow(p, RightArrow, true,
x+w - motifArrowHMargin - motifItemFrame - dim, y+h/2-dim/2,
dim, dim, itemg, TRUE);
}
}
else
KStyle::drawPopupMenuItem(p, checkable, maxpmw, tab, mi, pal, act,
enabled, x, y, w, h);
}
kdelibs'KStepStyle::drawKProgressBlock() (./kdelibs/kstyles/kstep-highcolor/kstep.cpp:1045)
void KStepStyle::drawKProgressBlock(QPainter *p, int x, int y, int w, int h,
const QColorGroup &g, QBrush *)
{
qDrawShadePanel(p, x, y, w, h, nextGrp, false, 1, &g.brush(QColorGroup::Dark));
}
kdelibs'KStepStyle::drawFocusRect() (./kdelibs/kstyles/kstep-highcolor/kstep.cpp:1051)
void KStepStyle::drawFocusRect(QPainter *p, const QRect &r,
const QColorGroup &, const QColor *,
bool atBorder)
{
if (!atBorder)
qDrawShadePanel(p, r, nextGrp, true, 1);
else
qDrawShadePanel(p, r.x()+1, r.y()+1, r.width()-2, r.height()-2, nextGrp,
true, 1);
}
// no check here, make sure your highcolor beforehand ;-)
kdelibs'KStepStyle::drawVGradient() (./kdelibs/kstyles/kstep-highcolor/kstep.cpp:1063)
void KStepStyle::drawVGradient(QPainter *p, const QBrush &fill, int x, int y,
int w, int h)
{
if(h <= 24){
p->drawTiledPixmap(x, y, w, h, *vSmall);
}
else if(h <= 34){
p->drawTiledPixmap(x, y, w, h, *vMed);
}
else if(h <= 64){
p->drawTiledPixmap(x, y, w, h, *vLarge);
}
else{
p->fillRect(x, y+vLarge->height(), w, h-vLarge->height(), fill);
p->drawTiledPixmap(x, y, w, vLarge->height(), *vLarge);
}
}
kdelibs'KStepStyle::drawHGradient() (./kdelibs/kstyles/kstep-highcolor/kstep.cpp:1081)
void KStepStyle::drawHGradient(QPainter *p, const QBrush &fill, int x, int y,
int w, int h)
{
if(w <= 24){
p->drawTiledPixmap(x, y, w, h, *hSmall);
}
else if(w <= 34){
p->drawTiledPixmap(x, y, w, h, *hMed);
}
else if(w <= 64){
p->drawTiledPixmap(x, y, w, h, *hLarge);
}
else{
p->fillRect(x+hLarge->width(), y, w-hLarge->width(), h, fill);
p->drawTiledPixmap(x, y, hLarge->width(), h, *hLarge);
}
}
kdelibs'KStepStyle::makeWallpaper() (./kdelibs/kstyles/kstep-highcolor/kstep.cpp:1099)
void KStepStyle::makeWallpaper(QPixmap &dest, const QColor &base)
{
static QBitmap paper3(100, 100, paper_3_bits, true);
static QBitmap paper4(100, 100, paper_4_bits, true);
static QBitmap paper6(100, 100, paper_6_bits, true);
static QBitmap paper7(100, 100, paper_7_bits, true);
if(!paper3.mask()){
paper3.setMask(paper3);
paper4.setMask(paper4);
paper6.setMask(paper6);
paper7.setMask(paper7);
}
dest.resize(100, 100);
dest.fill(base); // paper5
QPainter p;
p.begin(&dest);
p.setPen(base.dark(104));
p.drawPixmap(0, 0, paper3);
p.setPen(base.dark(102));
p.drawPixmap(0, 0, paper4);
p.setPen(base.light(102));
p.drawPixmap(0, 0, paper6);
p.setPen(base.light(104));
p.drawPixmap(0, 0, paper7);
p.end();
}
kdelibs'KStepStyle::KStepStyle() (./kdelibs/kstyles/stepplugin/kstep.cpp:44)
KStepStyle::KStepStyle()
:KStyle()
{
setButtonDefaultIndicatorWidth(4);
}
kdelibs'KStepStyle::~KStepStyle() (./kdelibs/kstyles/stepplugin/kstep.cpp:51)
KStepStyle::~KStepStyle()
{
;
}
kdelibs'KStepStyle::polish() (./kdelibs/kstyles/stepplugin/kstep.cpp:56)
void KStepStyle::polish(QApplication *)
{
setScrollBarExtent(18);
}
kdelibs'KStepStyle::polish() (./kdelibs/kstyles/stepplugin/kstep.cpp:61)
void KStepStyle::polish(QPalette &p)
{
nextGrp = p.normal();
nextGrp.setColor(QColorGroup::Dark, Qt::black);
}
kdelibs'KStepStyle::unPolish() (./kdelibs/kstyles/stepplugin/kstep.cpp:67)
void KStepStyle::unPolish(QApplication *)
{
setScrollBarExtent(16);
}
kdelibs'KStepStyle::polish() (./kdelibs/kstyles/stepplugin/kstep.cpp:72)
void KStepStyle::polish(QWidget *w)
{
if(w->inherits("QPopupMenu")){ // force to our colorgroup
oldPopupPal = w->palette();
w->setPalette(QPalette(nextGrp, nextGrp, nextGrp));
}
}
kdelibs'KStepStyle::unPolish() (./kdelibs/kstyles/stepplugin/kstep.cpp:80)
void KStepStyle::unPolish(QWidget *w)
{
if(w->inherits("QPopupMenu"))
w->setPalette(oldPopupPal);
}
kdelibs'KStepStyle::drawButton() (./kdelibs/kstyles/stepplugin/kstep.cpp:86)
void KStepStyle::drawButton(QPainter *p, int x, int y, int w, int h,
const QColorGroup &g, bool sunken,
const QBrush *fill)
{
kDrawNextButton(p, x, y, w, h, g, sunken, fill);
}
kdelibs'KStepStyle::drawPushButton() (./kdelibs/kstyles/stepplugin/kstep.cpp:93)
void KStepStyle::drawPushButton(QPushButton *btn, QPainter *p)
{
QRect r = btn->rect();
if(btn->isDefault() || btn->autoDefault()){
if(btn->isDefault())
kDrawNextButton(p, r, nextGrp, true);
drawButton(p, r.x()+4, r.y()+4, r.width()-8, r.height()-8, nextGrp,
btn->isOn() || btn->isDown());
}
else
drawButton(p, r.x(), r.y(), r.width(), r.height(), nextGrp,
btn->isOn() || btn->isDown());
}
kdelibs'KStepStyle::drawPushButtonLabel() (./kdelibs/kstyles/stepplugin/kstep.cpp:109)
void KStepStyle::drawPushButtonLabel(QPushButton *btn, QPainter *p)
{
int x1, y1, x2, y2;
btn->rect().coords(&x1, &y1, &x2, &y2);
bool act = btn->isOn() || btn->isDown();
static QBitmap arrowLightBmp(15, 9, arrow_light_bits, true);
static QBitmap arrowDarkBmp(15, 9, arrow_dark_bits, true);
static QBitmap arrowMidBmp(15, 9, arrow_mid_bits, true);
if(!arrowLightBmp.mask()){
arrowLightBmp.setMask(arrowLightBmp);
arrowDarkBmp.setMask(arrowDarkBmp);
arrowMidBmp.setMask(arrowMidBmp);
}
if (btn->isDefault()) {
// If this is a default button, we have a 4 pixel border which is
// used to give a frame.
// We need to add the 'return' pixmap in the correct position too.
// We adjust the width available for the label according to how
// much space is left after adding the pixmap at the right edge.
// - rikkus
// Changed to kColorBitmaps (mosfet
kColorBitmaps(p, btn->colorGroup(), btn->width() - 24,
btn->height() / 2 - 4, &arrowLightBmp, &arrowMidBmp,
NULL, &arrowDarkBmp, NULL, NULL);
drawItem(p,
(x1+act?1:0) + 6, y1+act?1:0,
btn->width() - 26, btn->height(),
AlignCenter | ShowPrefix, btn->colorGroup(), btn->isEnabled(),
btn->pixmap(), btn->text(), -1,
act ? &btn->colorGroup().light() : &btn->colorGroup().buttonText());
} else {
drawItem(p, x1+act?1:0, y1+act?1:0, btn->width(), btn->height(),
AlignCenter | ShowPrefix, btn->colorGroup(), btn->isEnabled(),
btn->pixmap(), btn->text(), -1,
act ? &btn->colorGroup().light() : &btn->colorGroup().buttonText());
}
}
kdelibs'KStepStyle::drawBevelButton() (./kdelibs/kstyles/stepplugin/kstep.cpp:155)
void KStepStyle::drawBevelButton(QPainter *p, int x, int y, int w, int h,
const QColorGroup &, bool sunken,
const QBrush *fill)
{
drawButton(p, x, y, w, h, nextGrp, sunken, fill);
}
kdelibs'KStepStyle::buttonRect() (./kdelibs/kstyles/stepplugin/kstep.cpp:162)
QRect KStepStyle::buttonRect(int x, int y, int w, int h)
{
return(QRect(x, y, w, h));
}
kdelibs'KStepStyle::drawComboButton() (./kdelibs/kstyles/stepplugin/kstep.cpp:167)
void KStepStyle::drawComboButton(QPainter *p, int x, int y, int w, int h,
const QColorGroup &g, bool sunken,
bool, bool, const QBrush
*fill)
{
drawButton(p, x, y, w, h, nextGrp, sunken, fill);
int deco_y = (h-6)/2;
drawButton(p, x + w-16, y + deco_y, 10, 6, nextGrp, false, fill);
p->setPen(g.mid());
p->drawLine( x+w-6, y+deco_y+6, x+w-15, y+deco_y+6);
p->drawLine( x+w-6, y+deco_y+1, x+w-6, y+deco_y+6);
}
kdelibs'KStepStyle::comboButtonRect() (./kdelibs/kstyles/stepplugin/kstep.cpp:181)
QRect KStepStyle::comboButtonRect(int x, int y, int w, int h){
return(QRect(x+4, y+4, w-8-16, h-8));
}
kdelibs'KStepStyle::comboButtonFocusRect() (./kdelibs/kstyles/stepplugin/kstep.cpp:185)
QRect KStepStyle::comboButtonFocusRect(int x, int y, int w, int h)
{
return(QRect(x+5, y+5, w-10-16, h-10));
}
kdelibs'KStepStyle::drawScrollBarControls() (./kdelibs/kstyles/stepplugin/kstep.cpp:190)
void KStepStyle::drawScrollBarControls(QPainter *p, const QScrollBar *sb,
int sliderStart, uint controls,
uint activeControl)
{
int sliderMin, sliderMax, sliderLength, buttonDim;
QRect add, sub, addPage, subPage, slider;
int addX, addY, subX, subY;
bool horizontal = sb->orientation() == QScrollBar::Horizontal;
int len = (horizontal) ? sb->width() : sb->height();
int extent = (horizontal) ? sb->height() : sb->width();
QColorGroup g = sb->colorGroup();
scrollBarMetrics(sb, sliderMin, sliderMax, sliderLength, buttonDim);
if(sliderStart > sliderMax)
sliderStart = sliderMax;
int sliderEnd = sliderStart + sliderLength;
if(horizontal){
subY = addY = (extent - buttonDim)/2;
subX = 1;
addX = buttonDim;
sub.setRect(subX, subY, buttonDim, buttonDim);
add.setRect(addX, addY, buttonDim, buttonDim);
subPage.setRect(buttonDim*2, 0, sliderStart-1, extent);
addPage.setRect(sliderEnd, 0, len-sliderEnd, extent);
slider.setRect(sliderStart, 0, sliderLength, extent);
}
else{
subX = addX = (extent - buttonDim)/2;
subY = len - (buttonDim*2);
addY = len - buttonDim-1;
sub.setRect(subX, subY, buttonDim, buttonDim);
add.setRect(addX, addY, buttonDim, buttonDim);
subPage.setRect(0, 1, extent, sliderStart-1);
addPage.setRect(0, sliderEnd, extent, subY-sliderEnd);
slider.setRect(0, sliderStart, extent, sliderLength);
}
if(controls & AddLine){
if(add.isValid()){
p->setPen(g.mid());
p->drawRect(add);
qDrawShadePanel(p, add.x()+1, add.y()+1, add.width()-2,
add.height()-2, nextGrp, activeControl == AddLine, 1,
&nextGrp.brush(QColorGroup::Background));
drawStepBarArrow(p, (horizontal) ? RightArrow : DownArrow,
add.x()+3, add.y()+3, nextGrp);
}
}
if(controls & SubLine){
if(sub.isValid()){
p->setPen(g.mid());
p->drawRect(sub);
qDrawShadePanel(p, sub.x()+1, sub.y()+1, sub.width()-2,
sub.height()-2, nextGrp, activeControl == SubLine, 1,
&nextGrp.brush(QColorGroup::Background));
drawStepBarArrow(p, (horizontal) ? LeftArrow : UpArrow, sub.x()+3,
sub.y()+3, nextGrp);
}
}
if((controls & SubPage)){
drawStepBarGroove(p, subPage, sb, g);
}
if((controls & AddPage)){
drawStepBarGroove(p, addPage, sb, g);
}
if(controls & Slider){
if(slider.isValid() && slider.width() > 1 && slider.height() > 1){
if(horizontal){
p->setPen(Qt::black);
p->drawLine(slider.x(), slider.y(), slider.right(), slider.y());
p->drawLine(slider.x(), slider.bottom(), slider.right(), slider.bottom());
p->setPen(g.mid());
p->drawLine(slider.x(), slider.y()+1, slider.right(), slider.y()+1);
p->drawLine(slider.x(), slider.bottom()-1, slider.right(), slider.bottom()-1);
drawButton(p, slider.x(), slider.y()+2, slider.width(),
slider.height()-4, nextGrp);
}
else{
p->setPen(Qt::black);
p->drawLine(slider.x(), slider.y(), slider.x(), slider.bottom());
p->drawLine(slider.right(), slider.y(), slider.right(), slider.bottom());
p->setPen(g.mid());
p->drawLine(slider.x()+1, slider.y(), slider.x()+1, slider.bottom());
p->drawLine(slider.right()-1, slider.y(), slider.right()-1, slider.bottom());
drawButton(p, slider.x()+2, slider.y(), slider.width()-4,
slider.height(), nextGrp);
}
if(slider.width() > 8 && slider.height() > 8)
drawStepBarCircle(p, slider.x(), slider.y(), slider.width(),
slider.height(), nextGrp);
}
}
}
kdelibs'KStepStyle::drawStepBarGroove() (./kdelibs/kstyles/stepplugin/kstep.cpp:286)
void KStepStyle::drawStepBarGroove(QPainter *p, QRect r, const QWidget *w,
const QColorGroup &g)
{
// dont draw over black lines or it flickers
if(r.left() == 0)
r.setLeft(1);
if(r.top() == 0)
r.setTop(1);
if(r.right() == w->width()-1)
r.setRight(w->width()-2);
if(r.bottom() == w->height()-1)
r.setBottom(w->height()-2);
p->fillRect(r, g.brush(QColorGroup::Mid));
p->setPen(Qt::black);
p->drawRect(0, 0, w->width(), w->height());
}
kdelibs'KStepStyle::scrollBarMetrics() (./kdelibs/kstyles/stepplugin/kstep.cpp:303)
void KStepStyle::scrollBarMetrics(const QScrollBar *sb, int &sliderMin,
int &sliderMax, int &sliderLength,
int &buttonDim)
{
int maxlen;
bool horizontal = sb->orientation() == QScrollBar::Horizontal;
int len = (horizontal) ? sb->width() : sb->height();
int extent = (horizontal) ? sb->height() : sb->width();
if(len > (extent - 1)*2)
buttonDim = extent-2;
else
buttonDim = len/2 - 1;
if(horizontal)
sliderMin = buttonDim*2;
else
sliderMin = 1;
maxlen = len - buttonDim*2 - 1;
sliderLength = (sb->pageStep()*maxlen) / (sb->maxValue() -
sb->minValue() + sb->pageStep());
if(sliderLength < 12)
sliderLength = 12;
if(sliderLength > maxlen)
sliderLength = maxlen;
sliderMax = sliderMin + maxlen - sliderLength;
}
QStyle::ScrollControl KStepStyle::scrollBarPointOver(const QScrollBar *sb,
int sliderStart,
const QPoint &p)
{
if(!sb->rect().contains(p))
return(NoScroll);
int sliderMin, sliderMax, sliderLength, buttonDim;
scrollBarMetrics(sb, sliderMin, sliderMax, sliderLength, buttonDim);
if(sb->orientation() == QScrollBar::Horizontal){
int x = p.x();
if(x <= buttonDim)
return(SubLine);
else if(x <= buttonDim*2)
return(AddLine);
else if(x < sliderStart)
return(SubPage);
else if(x < sliderStart+sliderLength)
return(Slider);
return(AddPage);
}
else{
int y = p.y();
if(y < sliderStart)
return(SubPage);
else if(y < sliderStart+sliderLength)
return(Slider);
else if(y < sliderMax+sliderLength)
return(AddPage);
else if(y < sliderMax+sliderLength+buttonDim)
return(SubLine);
return(AddLine);
}
}
kdelibs'KStepStyle::drawStepBarCircle() (./kdelibs/kstyles/stepplugin/kstep.cpp:370)
void KStepStyle::drawStepBarCircle(QPainter *p, int x, int y, int w,
int h, const QColorGroup &g)
{
static QCOORD circle_dark[] = {2,0, 3,0, 4,0,
1,1,
0,2,
0,3,
0,4
};
static QCOORD circle_mid[] = {1,0,
0,1, 2,1, 3,1, 4,1, 5,1,
1,2, 2,2,
1,3,
1,4,
1,5
};
static QCOORD circle_light[] = { 4,3, 5,3,
3, 4, 4,4, 5,4,
3,5, 4,5
};
QPen oldPen = p->pen();
x = x + w/2 - 3;
y = y + h/2 - 3;
QPointArray a( QCOORDARRLEN(circle_dark), circle_dark );
a.translate( x, y );
p->setPen( g.dark() );
p->drawPoints( a );
a.setPoints( QCOORDARRLEN(circle_light), circle_light );
a.translate( x, y );
p->setPen( g.light() );
p->drawPoints( a );
a.setPoints( QCOORDARRLEN(circle_mid), circle_mid );
a.translate( x, y );
p->setPen( g.mid() );
p->drawPoints( a );
p->setPen(oldPen);
}
kdelibs'KStepStyle::exclusiveIndicatorSize() (./kdelibs/kstyles/stepplugin/kstep.cpp:412)
QSize KStepStyle::exclusiveIndicatorSize() const
{
return(QSize(15,15));
}
kdelibs'KStepStyle::drawExclusiveIndicator() (./kdelibs/kstyles/stepplugin/kstep.cpp:417)
void KStepStyle::drawExclusiveIndicator(QPainter *p, int x, int y, int w,
int h, const QColorGroup &g, bool on,
bool down, bool)
{
static QCOORD circle_dark[] = {5,1, 6,1, 7,1, 8,1, 9,1, 10,1,
3,2, 4,2,
2,3,
2,4,
1,5,
1,6,
1,7,
1,8,
1,9,
2,10
};
static QCOORD circle_mid[] = {5,0, 6,0, 7,0, 8,0, 9,0,
3,1, 4,1, 11,1,
2,2, 10,2, 12,2,
1,3, 3,3,
1,4,
0,5,
0,6,
0,7,
0,8,
0,9,
1,10,
1,11,
2,12
};
static QCOORD circle_light[] = {14,5,
14,6,
14,7,
14,8,
14,9,
13,10,
13,11,
12,12,
4,13, 5,13, 10,13, 11,13,
5,14, 6,14, 7,14, 8,14, 9,14
};
static QCOORD fill_lines[] = {6,3, 9,3, 3,6, 3,9, 12,6, 12,9, 6,12, 9,12};
QPen oldPen = p->pen();
p->fillRect( x, y, w, h, g.brush(QColorGroup::Background));
QPointArray a( QCOORDARRLEN(circle_dark), circle_dark );
a.translate( x, y );
p->setPen(nextGrp.dark() );
p->drawPoints( a );
a.setPoints( QCOORDARRLEN(circle_mid), circle_mid );
a.translate( x, y );
p->setPen(nextGrp.mid() );
p->drawPoints( a );
a.setPoints( QCOORDARRLEN(circle_light), circle_light );
a.translate( x, y );
p->setPen(nextGrp.light() );
p->drawPoints( a );
if(on || down){
if(down)
p->setPen(nextGrp.mid());
a.setPoints(QCOORDARRLEN(fill_lines), fill_lines);
a.translate(x,y);
p->drawLineSegments(a);
p->fillRect(4, 4, 8, 8, (down)? g.brush(QColorGroup::Mid) :
nextGrp.brush(QColorGroup::Light));
}
p->setPen(oldPen);
}
kdelibs'KStepStyle::indicatorSize() (./kdelibs/kstyles/stepplugin/kstep.cpp:488)
QSize KStepStyle::indicatorSize() const
{
return(QSize(16, 16));
}
kdelibs'KStepStyle::drawIndicator() (./kdelibs/kstyles/stepplugin/kstep.cpp:493)
void KStepStyle::drawIndicator(QPainter *p, int x, int y, int w, int h,
const QColorGroup &, int state, bool down, bool)
{
drawButton(p, x, y, w, h, nextGrp, down);
if(state != QButton::Off){
QPen oldPen = p->pen();
p->setPen(nextGrp.light());
p->drawLine(x+5, y+6, x+5, y+10);
p->drawLine(x+5, y+10, x+w-4, y+3);
p->setPen(nextGrp.dark());
p->drawLine(x+5, y+11, x+w-4, y+4);
p->drawLine(x+6, y+6, x+6, y+7);
p->setPen(nextGrp.mid());
p->drawLine(x+6, y+11, x+w-4, y+5);
p->drawLine(x+6, y+8, x+7, y+7);
p->setPen(oldPen);
}
}
kdelibs'KStepStyle::drawStepBarArrow() (./kdelibs/kstyles/stepplugin/kstep.cpp:512)
void KStepStyle::drawStepBarArrow(QPainter *p, Qt::ArrowType type, int x,
int y, const QColorGroup &g)
{
static QBitmap upArrow(9, 9, uparrow_bits, true);
static QBitmap downArrow(9, 9, downarrow_bits, true);
static QBitmap leftArrow(9, 9, leftarrow_bits, true);
static QBitmap rightArrow(9, 9, rightarrow_bits, true);
if(!upArrow.mask()){
upArrow.setMask(upArrow);
downArrow.setMask(downArrow);
leftArrow.setMask(leftArrow);
rightArrow.setMask(rightArrow);
}
p->setPen(g.dark());
switch(type){
case Qt::UpArrow:
p->drawPixmap(x, y, upArrow);
break;
case Qt::DownArrow:
p->drawPixmap(x, y, downArrow);
break;
case Qt::LeftArrow:
p->drawPixmap(x, y, leftArrow);
break;
default:
p->drawPixmap(x, y, rightArrow);
break;
}
}
kdelibs'KStepStyle::drawSliderGroove() (./kdelibs/kstyles/stepplugin/kstep.cpp:545)
void KStepStyle::drawSliderGroove(QPainter *p, int x, int y, int w, int h,
const QColorGroup &g, QCOORD,
Orientation)
{
qDrawShadePanel(p, x, y, w, h, nextGrp, true, 1,
&g.brush(QColorGroup::Dark));
//drawButton(p, x, y, w, h, nextGrp, true);
}
kdelibs'KStepStyle::sliderLength() (./kdelibs/kstyles/stepplugin/kstep.cpp:554)
int KStepStyle::sliderLength() const
{
return(30);
}
kdelibs'KStepStyle::drawSlider() (./kdelibs/kstyles/stepplugin/kstep.cpp:559)
void KStepStyle::drawSlider(QPainter *p, int x, int y, int w, int h,
const QColorGroup &g, Orientation orient,
bool, bool)
{
drawButton(p, x+1, y+1, w-2, h-2, nextGrp, false);
if(orient == Horizontal){
int mid = x+w/2;
qDrawShadeLine(p, mid, y+1, mid, y+h-2, g, true, 1);
}
else{
int mid = y+w/2;
qDrawShadeLine(p, x+1, mid, x+w-2, mid, g, true, 1);
}
}
kdelibs'KStepStyle::drawArrow() (./kdelibs/kstyles/stepplugin/kstep.cpp:574)
void KStepStyle::drawArrow(QPainter *p, Qt::ArrowType type, bool down, int x,
int y, int w, int h, const QColorGroup &g,
bool enabled, const QBrush *)
{
qDrawArrow(p, type, Qt::MotifStyle, down, x, y, w, h, g, enabled);
}
kdelibs'KStepStyle::drawKBarHandle() (./kdelibs/kstyles/stepplugin/kstep.cpp:581)
void KStepStyle::drawKBarHandle(QPainter *p, int x, int y, int w, int h,
const QColorGroup &g, KToolBarPos, QBrush *)
{
drawButton(p, x, y, w, h, g, false, &g.brush(QColorGroup::Mid));
}
kdelibs'KStepStyle::drawKMenuBar() (./kdelibs/kstyles/stepplugin/kstep.cpp:587)
void KStepStyle::drawKMenuBar(QPainter *p, int x, int y, int w, int h,
const QColorGroup &g, bool, QBrush *)
{
drawButton(p, x, y, w, h, nextGrp, false, &g.brush(QColorGroup::Background));
}
kdelibs'KStepStyle::drawKToolBar() (./kdelibs/kstyles/stepplugin/kstep.cpp:593)
void KStepStyle::drawKToolBar(QPainter *p, int x, int y, int w, int h,
const QColorGroup &g, KToolBarPos, QBrush *)
{
// drawButton(p, x, y, w, h, nextGrp, false, &g.brush(QColorGroup::Background));
int x2 = x+w-1;
int y2 = y+h-1;
p->fillRect(x+1, y+1, w-2, h-2, g.brush(QColorGroup::Background));
p->setPen(g.light());
p->drawLine(x, y, x2-1, y);
p->drawLine(x, y, x, y2-1);
p->setPen(Qt::black);
p->drawLine(x, y2, x2, y2);
p->drawLine(x2, y, x2, y2);
}
kdelibs'KStepStyle::drawKToolBarButton() (./kdelibs/kstyles/stepplugin/kstep.cpp:608)
void KStepStyle::drawKToolBarButton(QPainter *p, int x, int y, int w, int h,
const QColorGroup &g, bool sunken,
bool raised, bool enabled, bool popup,
KToolButtonType icontext,
const QString& btext, const QPixmap *pixmap,
QFont *font, QWidget *)
{
int x2 = x+w-1;
int y2 = y+h-1;
if(sunken || raised){
p->setPen(sunken ? g.dark() : g.light());
p->drawLine(x, y, x2, y);
p->drawLine(x, y, x, y2);
p->setPen(sunken ? g.light() : g.dark());
p->drawLine(x2, y, x2, y2);
p->drawLine(x, y2, x2, y2);
p->fillRect(x+1, y+1, w-2, h-2, sunken? g.mid() : g.background());
}
else
p->fillRect(x, y, w, h, g.background());
int dx, dy;
if (icontext == Icon){ // icon only
if (pixmap){
dx = ( w - pixmap->width() ) / 2;
dy = ( h - pixmap->height() ) / 2;
if ( sunken )
{
++dx;
++dy;
}
p->drawPixmap( x+dx, y+dy, *pixmap );
}
}
else if (icontext == IconTextRight){ // icon and text (if any)
if (pixmap){
dx = 1;
dy = ( h - pixmap->height() ) / 2;
if ( sunken ){
++dx;
++dy;
}
p->drawPixmap( x+dx, y+dy, *pixmap );
}
if (!btext.isNull()){
int tf = AlignVCenter|AlignLeft;
if (!enabled)
p->setPen(g.dark());
if (pixmap)
dx= pixmap->width();
else
dx= 1;
dy = 0;
if ( sunken ){
++dx;
++dy;
}
if (font)
p->setFont(*font);
if(raised)
p->setPen(Qt::blue);
p->drawText(x+dx, y+dy, w-dx, h, tf, btext);
}
}
else if (icontext == Text){ // only text, even if there is a icon
if (!btext.isNull()){
int tf = AlignVCenter|AlignLeft;
if (!enabled)
p->setPen(g.dark());
dx= 1;
dy= 0;
if ( sunken ){
++dx;
++dy;
}
if (font)
p->setFont(*font);
if(raised)
p->setPen(Qt::blue);
p->drawText(x+dx, y+dy, w-dx, h, tf, btext);
}
}
else if (icontext == IconTextBottom){
if (pixmap){
dx = (w - pixmap->width()) / 2;
dy = 1;
if ( sunken ){
++dx;
++dy;
}
p->drawPixmap( x+dx, y+dy, *pixmap );
}
if (!btext.isNull()){
int tf = AlignBottom|AlignHCenter;
if (!enabled)
p->setPen(g.dark());
dy= pixmap->height();
dx = 2;
if ( sunken ){
++dx;
++dy;
}
if (font)
p->setFont(*font);
if(raised)
p->setPen(Qt::blue);
p->drawText(x, y, w, h-4, tf, btext);
}
}
if (popup){
if (enabled)
qDrawArrow (p, Qt::DownArrow, Qt::WindowsStyle, false, w-5, h-5, 0, 0,
g, true);
else
qDrawArrow (p, Qt::DownArrow, Qt::WindowsStyle, false, w-5, h-5,
0, 0, g, false);
}
}
kdelibs'KStepStyle::drawKMenuItem() (./kdelibs/kstyles/stepplugin/kstep.cpp:727)
void KStepStyle::drawKMenuItem(QPainter *p, int x, int y, int w, int h,
const QColorGroup &g, bool active, QMenuItem *mi,
QBrush *)
{
QColor btext = active ? g.light() : g.buttonText();
if(active){
int x2 = x+w-1;
int y2 = y+h-1;
p->setPen(g.light());
p->drawLine(x, y, x2, y);
p->drawLine(x, y, x, y2);
p->setPen(g.dark());
p->drawLine(x2, y, x2, y2);
p->drawLine(x, y2, x2, y2);
p->fillRect(x+1, y+1, w-2, h-2, g.mid());
}
QApplication::style().drawItem(p, x, y, w, h,
AlignCenter|ShowPrefix|DontClip|SingleLine,
g, mi->isEnabled(), mi->pixmap(), mi->text(),
-1, &btext );
}
kdelibs'KStepStyle::drawPopupMenuItem() (./kdelibs/kstyles/stepplugin/kstep.cpp:749)
void KStepStyle::drawPopupMenuItem( QPainter* p, bool checkable, int maxpmw,
int tab, QMenuItem* mi,
const QPalette& pal, bool act,
bool enabled, int x, int y, int w, int h)
{
static const int motifItemFrame = 2;
static const int motifItemHMargin = 3;
static const int motifItemVMargin = 2;
static const int motifArrowHMargin = 6;
static const int windowsRightBorder = 12;
if(act){
bool dis = !enabled;
QColorGroup itemg = dis ? pal.disabled() : pal.active();
if (checkable)
maxpmw = QMAX( maxpmw, 12 );
int checkcol = maxpmw;
int x2 = x+w-1;
int y2 = y+h-1;
p->setPen(itemg.light());
p->drawLine(x, y, x2, y);
p->drawLine(x, y, x, y2);
p->setPen(itemg.dark());
p->drawLine(x2, y, x2, y2);
p->drawLine(x, y2, x2, y2);
p->fillRect(x+1, y+1, w-2, h-2, itemg.mid());
if ( mi->iconSet() ) {
QIconSet::Mode mode = dis? QIconSet::Disabled : QIconSet::Normal;
if (!dis)
mode = QIconSet::Active;
QPixmap pixmap = mi->iconSet()->pixmap(QIconSet::Small, mode);
int pixw = pixmap.width();
int pixh = pixmap.height();
QRect cr(x, y, checkcol, h);
QRect pmr(0, 0, pixw, pixh);
pmr.moveCenter( cr.center() );
p->setPen(itemg.text());
p->drawPixmap(pmr.topLeft(), pixmap );
}
else if(checkable) {
int mw = checkcol + motifItemFrame;
int mh = h - 2*motifItemFrame;
if (mi->isChecked()){
drawCheckMark( p, x + motifItemFrame,
y+motifItemFrame, mw, mh, itemg, act, dis );
}
}
p->setPen(itemg.light());
QColor discol;
if (dis) {
discol = itemg.text();
p->setPen(discol);
}
int xm = motifItemFrame + checkcol + motifItemHMargin;
QString s = mi->text();
if (!s.isNull()) {
int t = s.find( '\t' );
int m = motifItemVMargin;
const int text_flags = AlignVCenter|ShowPrefix | DontClip | SingleLine;
if (t >= 0) {
p->drawText(x+w-tab-windowsRightBorder-motifItemHMargin-motifItemFrame,
y+m, tab, h-2*m, text_flags, s.mid( t+1 ));
}
p->drawText(x+xm, y+m, w-xm-tab+1, h-2*m, text_flags, s, t);
} else if (mi->pixmap()) {
QPixmap *pixmap = mi->pixmap();
if (pixmap->depth() == 1)
p->setBackgroundMode(OpaqueMode);
p->drawPixmap( x+xm, y+motifItemFrame, *pixmap);
if (pixmap->depth() == 1)
p->setBackgroundMode(TransparentMode);
}
if (mi->popup()) {
int dim = (h-2*motifItemFrame) / 2;
if (!dis)
discol = itemg.text();
QColorGroup g2(discol, itemg.highlight(),
white, white,
dis ? discol : white,
discol, white);
drawArrow(p, RightArrow, true,
x+w - motifArrowHMargin - motifItemFrame - dim, y+h/2-dim/2,
dim, dim, itemg, TRUE);
}
}
else
KStyle::drawPopupMenuItem(p, checkable, maxpmw, tab, mi, pal, act,
enabled, x, y, w, h);
}
kdelibs'KStepStyle::drawKProgressBlock() (./kdelibs/kstyles/stepplugin/kstep.cpp:841)
void KStepStyle::drawKProgressBlock(QPainter *p, int x, int y, int w, int h,
const QColorGroup &g, QBrush *)
{
qDrawShadePanel(p, x, y, w, h, nextGrp, false, 1, &g.brush(QColorGroup::Dark));
}
kdelibs'KStepStyle::drawFocusRect() (./kdelibs/kstyles/stepplugin/kstep.cpp:847)
void KStepStyle::drawFocusRect(QPainter *p, const QRect &r,
const QColorGroup &, const QColor *,
bool atBorder)
{
if (!atBorder)
qDrawShadePanel(p, r, nextGrp, true, 1);
else
qDrawShadePanel(p, r.x()+1, r.y()+1, r.width()-2, r.height()-2, nextGrp,
true, 1);
}