Putting the pixmaps into an array, which was TODO from the beginning ;-)
svn path=/trunk/kdebase/kwin/; revision=102784icc-effect-5.14.5
parent
7c239c69ba
commit
10af9bc3a2
|
@ -15,22 +15,25 @@
|
||||||
|
|
||||||
using namespace KWinInternal;
|
using namespace KWinInternal;
|
||||||
|
|
||||||
|
#define P_CLOSE 0
|
||||||
|
#define P_MAX 1
|
||||||
|
#define P_NORMALIZE 2
|
||||||
|
#define P_ICONIFY 3
|
||||||
|
#define P_PINUP 4
|
||||||
|
#define P_MENU 5
|
||||||
|
#define P_HELP 6
|
||||||
|
#define NUM_PIXMAPS ((P_HELP + 1) * 4)
|
||||||
|
|
||||||
// TODO: stick all these in an array
|
static KPixmap *pixmap[NUM_PIXMAPS];
|
||||||
static KPixmap *aClosePix, *aClosePixDown;
|
|
||||||
static KPixmap *iClosePix, *iClosePixDown;
|
//active
|
||||||
static KPixmap *aMaxPix, *aMaxPixDown;
|
#define PIXMAP_A(i) (pixmap[(i)*4])
|
||||||
static KPixmap *iMaxPix, *iMaxPixDown;
|
//active, down
|
||||||
static KPixmap *aNormalizePix, *aNormalizePixDown;
|
#define PIXMAP_AD(i) (pixmap[(i)*4 +1])
|
||||||
static KPixmap *iNormalizePix, *iNormalizePixDown;
|
//inactive
|
||||||
static KPixmap *aIconifyPix, *aIconifyPixDown;
|
#define PIXMAP_I(i) (pixmap[(i)*4 +2])
|
||||||
static KPixmap *iIconifyPix, *iIconifyPixDown;
|
//inactive, down
|
||||||
static KPixmap *aPinupPix, *aPinupPixDown;
|
#define PIXMAP_ID(i) (pixmap[(i)*4 +3])
|
||||||
static KPixmap *iPinupPix, *iPinupPixDown;
|
|
||||||
static KPixmap *aMenuPix, *aMenuPixDown;
|
|
||||||
static KPixmap *iMenuPix, *iMenuPixDown;
|
|
||||||
static KPixmap *aHelpPix, *aHelpPixDown;
|
|
||||||
static KPixmap *iHelpPix, *iHelpPixDown;
|
|
||||||
|
|
||||||
static bool pixmaps_created = false;
|
static bool pixmaps_created = false;
|
||||||
|
|
||||||
|
@ -70,7 +73,7 @@ static void redraw_pixmaps();
|
||||||
QPixmap* kwin_get_menu_pix_hack()
|
QPixmap* kwin_get_menu_pix_hack()
|
||||||
{
|
{
|
||||||
//return menu_pix; FIXME
|
//return menu_pix; FIXME
|
||||||
return aMenuPix;
|
return PIXMAP_A(P_MENU);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void create_pixmaps()
|
static void create_pixmaps()
|
||||||
|
@ -79,138 +82,47 @@ static void create_pixmaps()
|
||||||
return;
|
return;
|
||||||
pixmaps_created = true;
|
pixmaps_created = true;
|
||||||
|
|
||||||
// TODO: Stick all these in an array
|
int i;
|
||||||
aClosePix = new KPixmap;
|
for (i = 0; i < NUM_PIXMAPS; i++) {
|
||||||
aClosePix->resize(16, 16);
|
pixmap[i] = new KPixmap;
|
||||||
aClosePixDown = new KPixmap;
|
switch (i / 4) {
|
||||||
aClosePixDown->resize(16, 16);
|
case P_MAX : break; // will be initialized by copying P_CLOSE
|
||||||
|
case P_ICONIFY : pixmap[i]->resize(10,10); break;
|
||||||
iClosePix = new KPixmap;
|
default : pixmap[i]->resize(16, 16); break;
|
||||||
iClosePix->resize(16, 16);
|
}
|
||||||
iClosePixDown = new KPixmap;
|
}
|
||||||
iClosePixDown->resize(16, 16);
|
|
||||||
|
|
||||||
aMaxPix = new KPixmap;
|
|
||||||
aMaxPixDown = new KPixmap;
|
|
||||||
iMaxPix = new KPixmap;
|
|
||||||
iMaxPixDown = new KPixmap;
|
|
||||||
|
|
||||||
aNormalizePix = new KPixmap();
|
|
||||||
aNormalizePix->resize(16, 16);
|
|
||||||
aNormalizePixDown = new KPixmap();
|
|
||||||
aNormalizePixDown->resize(16, 16);
|
|
||||||
|
|
||||||
aIconifyPix = new KPixmap;
|
|
||||||
aIconifyPix->resize(10, 10);
|
|
||||||
aIconifyPixDown = new KPixmap;
|
|
||||||
aIconifyPixDown->resize(10, 10);
|
|
||||||
|
|
||||||
iNormalizePix = new KPixmap();
|
|
||||||
iNormalizePix->resize(16, 16);
|
|
||||||
iNormalizePixDown = new KPixmap();
|
|
||||||
iNormalizePixDown->resize(16, 16);
|
|
||||||
|
|
||||||
iIconifyPix = new KPixmap;
|
|
||||||
iIconifyPix->resize(10, 10);
|
|
||||||
iIconifyPixDown = new KPixmap;
|
|
||||||
iIconifyPixDown->resize(10, 10);
|
|
||||||
|
|
||||||
aPinupPix = new KPixmap;
|
|
||||||
aPinupPix->resize(16, 16);
|
|
||||||
aPinupPixDown = new KPixmap;
|
|
||||||
aPinupPixDown->resize(16, 16);
|
|
||||||
|
|
||||||
iPinupPix = new KPixmap;
|
|
||||||
iPinupPix->resize(16, 16);
|
|
||||||
iPinupPixDown = new KPixmap;
|
|
||||||
iPinupPixDown->resize(16, 16);
|
|
||||||
|
|
||||||
aMenuPix = new KPixmap;
|
|
||||||
aMenuPix->resize(16, 16);
|
|
||||||
aMenuPixDown = new KPixmap;
|
|
||||||
aMenuPixDown->resize(16, 16);
|
|
||||||
|
|
||||||
iMenuPix = new KPixmap;
|
|
||||||
iMenuPix->resize(16, 16);
|
|
||||||
iMenuPixDown = new KPixmap;
|
|
||||||
iMenuPixDown->resize(16, 16);
|
|
||||||
|
|
||||||
aHelpPix = new KPixmap;
|
|
||||||
aHelpPix->resize(16, 16);
|
|
||||||
aHelpPixDown = new KPixmap;
|
|
||||||
aHelpPixDown->resize(16, 16);
|
|
||||||
iHelpPix = new KPixmap;
|
|
||||||
iHelpPix->resize(16, 16);
|
|
||||||
iHelpPixDown = new KPixmap;
|
|
||||||
iHelpPixDown->resize(16, 16);
|
|
||||||
|
|
||||||
// there seems to be no way to load X bitmaps from data properly, so
|
// there seems to be no way to load X bitmaps from data properly, so
|
||||||
// we need to create new ones for each mask :P
|
// we need to create new ones for each mask :P
|
||||||
QBitmap pinupMask(16, 16, pinup_mask_bits, true);
|
QBitmap pinupMask(16, 16, pinup_mask_bits, true);
|
||||||
aPinupPix->setMask(pinupMask);
|
PIXMAP_A(P_PINUP)->setMask(pinupMask);
|
||||||
iPinupPix->setMask(pinupMask);
|
PIXMAP_I(P_PINUP)->setMask(pinupMask);
|
||||||
QBitmap pindownMask(16, 16, pindown_mask_bits, true);
|
QBitmap pindownMask(16, 16, pindown_mask_bits, true);
|
||||||
aPinupPixDown->setMask(pindownMask);
|
PIXMAP_AD(P_PINUP)->setMask(pindownMask);
|
||||||
iPinupPixDown->setMask(pindownMask);
|
PIXMAP_ID(P_PINUP)->setMask(pindownMask);
|
||||||
|
|
||||||
QBitmap menuMask(16, 16, menu_mask_bits, true);
|
QBitmap menuMask(16, 16, menu_mask_bits, true);
|
||||||
aMenuPix->setMask(menuMask);
|
for (i = 0; i < 4; i++) pixmap[P_MENU * 4 + i]->setMask(menuMask);
|
||||||
iMenuPix->setMask(menuMask);
|
|
||||||
aMenuPixDown->setMask(menuMask);
|
|
||||||
iMenuPixDown->setMask(menuMask);
|
|
||||||
|
|
||||||
QBitmap helpMask(16, 16, help_mask_bits, true);
|
QBitmap helpMask(16, 16, help_mask_bits, true);
|
||||||
aHelpPix->setMask(helpMask);
|
for (i = 0; i < 4; i++) pixmap[P_HELP * 4 + i]->setMask(helpMask);
|
||||||
iHelpPix->setMask(helpMask);
|
|
||||||
aHelpPixDown->setMask(helpMask);
|
|
||||||
iHelpPixDown->setMask(helpMask);
|
|
||||||
redraw_pixmaps();
|
redraw_pixmaps();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void delete_pixmaps()
|
static void delete_pixmaps()
|
||||||
{
|
{
|
||||||
delete aClosePix;
|
for (int i = 0; i < NUM_PIXMAPS; i++)
|
||||||
delete aClosePixDown;
|
delete pixmap[i];
|
||||||
delete iClosePix;
|
|
||||||
delete iClosePixDown;
|
|
||||||
delete aMaxPix;
|
|
||||||
delete aMaxPixDown;
|
|
||||||
delete iMaxPix;
|
|
||||||
delete iMaxPixDown;
|
|
||||||
delete aNormalizePix;
|
|
||||||
delete aNormalizePixDown;
|
|
||||||
delete iNormalizePix;
|
|
||||||
delete iNormalizePixDown;
|
|
||||||
delete aIconifyPix;
|
|
||||||
delete aIconifyPixDown;
|
|
||||||
delete iIconifyPix;
|
|
||||||
delete iIconifyPixDown;
|
|
||||||
delete aPinupPix;
|
|
||||||
delete aPinupPixDown;
|
|
||||||
delete iPinupPix;
|
|
||||||
delete iPinupPixDown;
|
|
||||||
delete aMenuPix;
|
|
||||||
delete aMenuPixDown;
|
|
||||||
delete iMenuPix;
|
|
||||||
delete iMenuPixDown;
|
|
||||||
delete aHelpPix;
|
|
||||||
delete aHelpPixDown;
|
|
||||||
delete iHelpPix;
|
|
||||||
delete iHelpPixDown;
|
|
||||||
|
|
||||||
pixmaps_created = false;
|
pixmaps_created = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
B2Button::B2Button(KPixmap *pix, KPixmap *pixDown, KPixmap *iPix,
|
B2Button::B2Button(KPixmap *pix, KPixmap *pixDown, KPixmap *iPix,
|
||||||
KPixmap *iPixDown, Client *_client, QWidget *parent,
|
KPixmap *iPixDown, Client *_client, QWidget *parent,
|
||||||
const char *name)
|
const char *name)
|
||||||
: QButton(parent, name)
|
: QButton(parent, name),
|
||||||
|
pNorm(pix), pDown(pixDown), iNorm(iPix), iDown(iPixDown),
|
||||||
|
client(_client)
|
||||||
{
|
{
|
||||||
client = _client;
|
|
||||||
pNorm = pix;
|
|
||||||
pDown = pixDown;
|
|
||||||
iNorm = iPix;
|
|
||||||
iDown = iPixDown;
|
|
||||||
setFixedSize(16, 16);
|
setFixedSize(16, 16);
|
||||||
setFocusPolicy(NoFocus);
|
setFocusPolicy(NoFocus);
|
||||||
resize(16, 16);
|
resize(16, 16);
|
||||||
|
@ -265,6 +177,13 @@ void B2Button::setPixmaps(KPixmap *pix, KPixmap *pixDown, KPixmap *iPix,
|
||||||
repaint(false);
|
repaint(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void B2Button::setPixmaps(int button_id)
|
||||||
|
{
|
||||||
|
button_id *= 4;
|
||||||
|
setPixmaps(::pixmap[button_id], ::pixmap[button_id+1],
|
||||||
|
::pixmap[button_id+2], ::pixmap[button_id+3]);
|
||||||
|
}
|
||||||
|
|
||||||
void B2Button::mousePressEvent( QMouseEvent* e )
|
void B2Button::mousePressEvent( QMouseEvent* e )
|
||||||
{
|
{
|
||||||
last_button = e->button();
|
last_button = e->button();
|
||||||
|
@ -279,12 +198,10 @@ void B2Button::mouseReleaseEvent( QMouseEvent* e )
|
||||||
}
|
}
|
||||||
|
|
||||||
B2Titlebar::B2Titlebar(B2Client *parent)
|
B2Titlebar::B2Titlebar(B2Client *parent)
|
||||||
: QWidget(parent)
|
: QWidget(parent),
|
||||||
|
set_x11mask(false), isfullyobscured(false), shift_move(false),
|
||||||
|
client(parent)
|
||||||
{
|
{
|
||||||
set_x11mask = false;
|
|
||||||
isfullyobscured = false;
|
|
||||||
shift_move = false;
|
|
||||||
client = parent;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool B2Titlebar::x11Event(XEvent *e)
|
bool B2Titlebar::x11Event(XEvent *e)
|
||||||
|
@ -457,11 +374,9 @@ void B2Client::maxButtonClicked( )
|
||||||
|
|
||||||
B2Client::B2Client( Workspace *ws, WId w, QWidget *parent,
|
B2Client::B2Client( Workspace *ws, WId w, QWidget *parent,
|
||||||
const char *name )
|
const char *name )
|
||||||
: Client( ws, w, parent, name, WResizeNoErase )
|
: Client( ws, w, parent, name, WResizeNoErase ),
|
||||||
|
bar_x_ofs(0), in_unobs(0)
|
||||||
{
|
{
|
||||||
bar_x_ofs = 0;
|
|
||||||
in_unobs = 0;
|
|
||||||
|
|
||||||
g = new QGridLayout( this, 0, 0);
|
g = new QGridLayout( this, 0, 0);
|
||||||
g->addMultiCellWidget(windowWrapper(), 1, 1, 1, 2);
|
g->addMultiCellWidget(windowWrapper(), 1, 1, 1, 2);
|
||||||
|
|
||||||
|
@ -482,7 +397,7 @@ B2Client::B2Client( Workspace *ws, WId w, QWidget *parent,
|
||||||
titlebar->setMinimumWidth(16);
|
titlebar->setMinimumWidth(16);
|
||||||
titlebar->setFixedHeight(20);
|
titlebar->setFixedHeight(20);
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
for(i=0; i < 6; ++i){
|
for(i=0; i < 6; ++i){
|
||||||
button[i] = new B2Button(this, titlebar/*this*/);
|
button[i] = new B2Button(this, titlebar/*this*/);
|
||||||
button[i]->setFixedSize(16, 16);
|
button[i]->setFixedSize(16, 16);
|
||||||
|
@ -508,23 +423,16 @@ B2Client::B2Client( Workspace *ws, WId w, QWidget *parent,
|
||||||
if(!providesContextHelp())
|
if(!providesContextHelp())
|
||||||
button[BtnHelp]->hide();
|
button[BtnHelp]->hide();
|
||||||
|
|
||||||
button[BtnMenu]->setPixmaps(aMenuPix, aMenuPixDown, iMenuPix,
|
button[BtnMenu]->setPixmaps(P_MENU);
|
||||||
iMenuPixDown);
|
button[BtnSticky]->setPixmaps(P_PINUP);
|
||||||
button[BtnSticky]->setPixmaps(aPinupPix, aPinupPixDown, iPinupPix,
|
button[BtnIconify]->setPixmaps(P_ICONIFY);
|
||||||
iPinupPixDown);
|
button[BtnClose]->setPixmaps(P_CLOSE);
|
||||||
button[BtnIconify]->setPixmaps(aIconifyPix, aIconifyPixDown,
|
button[BtnHelp]->setPixmaps(P_HELP);
|
||||||
iIconifyPix, iIconifyPixDown);
|
|
||||||
button[BtnClose]->setPixmaps(aClosePix, aClosePixDown, iClosePix,
|
|
||||||
iClosePixDown);
|
|
||||||
button[BtnHelp]->setPixmaps(aHelpPix, aHelpPixDown, iHelpPix,
|
|
||||||
iHelpPixDown);
|
|
||||||
|
|
||||||
if(isMaximized())
|
if(isMaximized())
|
||||||
button[BtnMax]->setPixmaps(aNormalizePix, aNormalizePixDown,
|
button[BtnMax]->setPixmaps(P_NORMALIZE);
|
||||||
iNormalizePix, iNormalizePixDown);
|
|
||||||
else
|
else
|
||||||
button[BtnMax]->setPixmaps(aMaxPix, aMaxPixDown, iMaxPix,
|
button[BtnMax]->setPixmaps(P_MAX);
|
||||||
iMaxPixDown);
|
|
||||||
|
|
||||||
QColor c = options->colorGroup(Options::TitleBar, isActive()).
|
QColor c = options->colorGroup(Options::TitleBar, isActive()).
|
||||||
color(QColorGroup::Button);
|
color(QColorGroup::Button);
|
||||||
|
@ -795,18 +703,16 @@ void B2Client::titleMoveRel(int xdiff)
|
||||||
|
|
||||||
void B2Client::stickyChange(bool on)
|
void B2Client::stickyChange(bool on)
|
||||||
{
|
{
|
||||||
button[1]->setDown(on);
|
button[BtnSticky]->setDown(on);
|
||||||
}
|
}
|
||||||
|
|
||||||
void B2Client::maximizeChange(bool m)
|
void B2Client::maximizeChange(bool m)
|
||||||
{
|
{
|
||||||
if(m){
|
if(m){
|
||||||
button[BtnMax]->setPixmaps(aNormalizePix, aNormalizePixDown,
|
button[BtnMax]->setPixmaps(P_NORMALIZE);
|
||||||
iNormalizePix, iNormalizePixDown);
|
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
button[BtnMax]->setPixmaps(aMaxPix, aMaxPixDown, iMaxPix,
|
button[BtnMax]->setPixmaps(P_MAX);
|
||||||
iMaxPixDown);
|
|
||||||
}
|
}
|
||||||
button[BtnMax]->repaint();
|
button[BtnMax]->repaint();
|
||||||
}
|
}
|
||||||
|
@ -896,132 +802,73 @@ static void redraw_pixmaps()
|
||||||
QColorGroup iGrp = options->colorGroup(Options::ButtonBg, false);
|
QColorGroup iGrp = options->colorGroup(Options::ButtonBg, false);
|
||||||
|
|
||||||
// close
|
// close
|
||||||
drawB2Rect(aClosePix, aGrp.button(), false);
|
drawB2Rect(PIXMAP_A(P_CLOSE), aGrp.button(), false);
|
||||||
drawB2Rect(aClosePixDown, aGrp.button(), true);
|
drawB2Rect(PIXMAP_AD(P_CLOSE), aGrp.button(), true);
|
||||||
|
|
||||||
drawB2Rect(iClosePix, iGrp.button(), false);
|
drawB2Rect(PIXMAP_I(P_CLOSE), iGrp.button(), false);
|
||||||
drawB2Rect(iClosePixDown, iGrp.button(), true);
|
drawB2Rect(PIXMAP_ID(P_CLOSE), iGrp.button(), true);
|
||||||
|
|
||||||
// maximize
|
// maximize
|
||||||
*aMaxPix = *aClosePix;
|
int i;
|
||||||
aMaxPix->detach();
|
for (i = 0; i < 4; i++) {
|
||||||
*aMaxPixDown = *aClosePixDown;
|
*pixmap[P_MAX*4 + i] = *pixmap[P_CLOSE*4 + i];
|
||||||
aMaxPixDown->detach();
|
pixmap[P_MAX*4 + i]->detach();
|
||||||
*iMaxPix = *iClosePix;
|
}
|
||||||
iMaxPix->detach();
|
|
||||||
*iMaxPixDown = *iClosePixDown;
|
|
||||||
iMaxPixDown->detach();
|
|
||||||
|
|
||||||
// normalize
|
// normalize + iconify
|
||||||
KPixmap smallBox;
|
KPixmap smallBox;
|
||||||
smallBox.resize(10, 10);
|
smallBox.resize(10, 10);
|
||||||
KPixmap largeBox;
|
KPixmap largeBox;
|
||||||
largeBox.resize(12, 12);
|
largeBox.resize(12, 12);
|
||||||
|
|
||||||
drawB2Rect(&smallBox, aGrp.button(), false);
|
for (i = 0; i < 4; i++) {
|
||||||
drawB2Rect(&largeBox, aGrp.button(), false);
|
bool is_act = (i < 2);
|
||||||
aNormalizePix->fill(options->color(Options::TitleBar, true));
|
bool is_down = ((i & 1) == 1);
|
||||||
bitBlt(aNormalizePix, 3, 3, &largeBox, 0, 0, 12, 12, Qt::CopyROP, true);
|
KPixmap *pix = pixmap[P_NORMALIZE*4 + i];
|
||||||
bitBlt(aNormalizePix, 0, 0, &smallBox, 0, 0, 10, 10, Qt::CopyROP, true);
|
drawB2Rect(&smallBox, aGrp.button(), is_down);
|
||||||
|
drawB2Rect(&largeBox, aGrp.button(), is_down);
|
||||||
|
pix->fill(options->color(Options::TitleBar, is_act));
|
||||||
|
bitBlt(pix, 3, 3, &largeBox, 0, 0, 12, 12, Qt::CopyROP, true);
|
||||||
|
bitBlt(pix, 0, 0, &smallBox, 0, 0, 10, 10, Qt::CopyROP, true);
|
||||||
|
|
||||||
bitBlt(aIconifyPix, 0, 0, &smallBox, 0, 0, 10, 10, Qt::CopyROP, true);
|
bitBlt(pixmap[P_ICONIFY*4 + i],
|
||||||
|
0, 0, &smallBox, 0, 0, 10, 10, Qt::CopyROP, true);
|
||||||
drawB2Rect(&smallBox, aGrp.button(), true);
|
}
|
||||||
drawB2Rect(&largeBox, aGrp.button(), true);
|
|
||||||
aNormalizePixDown->fill(options->color(Options::TitleBar, true));
|
|
||||||
bitBlt(aNormalizePixDown, 3, 3, &largeBox, 0, 0, 12, 12, Qt::CopyROP, true);
|
|
||||||
bitBlt(aNormalizePixDown, 0, 0, &smallBox, 0, 0, 10, 10, Qt::CopyROP, true);
|
|
||||||
|
|
||||||
bitBlt(aIconifyPixDown, 0, 0, &smallBox, 0, 0, 10, 10, Qt::CopyROP, true);
|
|
||||||
|
|
||||||
drawB2Rect(&smallBox, iGrp.button(), false);
|
|
||||||
drawB2Rect(&largeBox, iGrp.button(), false);
|
|
||||||
iNormalizePix->fill(options->color(Options::TitleBar, false));
|
|
||||||
bitBlt(iNormalizePix, 3, 3, &largeBox, 0, 0, 12, 12, Qt::CopyROP, true);
|
|
||||||
bitBlt(iNormalizePix, 0, 0, &smallBox, 0, 0, 10, 10, Qt::CopyROP, true);
|
|
||||||
|
|
||||||
bitBlt(iIconifyPix, 0, 0, &smallBox, 0, 0, 10, 10, Qt::CopyROP, true);
|
|
||||||
|
|
||||||
drawB2Rect(&smallBox, iGrp.button(), true);
|
|
||||||
drawB2Rect(&largeBox, iGrp.button(), true);
|
|
||||||
iNormalizePixDown->fill(options->color(Options::TitleBar, false));
|
|
||||||
bitBlt(iNormalizePixDown, 3, 3, &largeBox, 0, 0, 12, 12, Qt::CopyROP, true);
|
|
||||||
bitBlt(iNormalizePixDown, 0, 0, &smallBox, 0, 0, 10, 10, Qt::CopyROP, true);
|
|
||||||
|
|
||||||
bitBlt(iIconifyPixDown, 0, 0, &smallBox, 0, 0, 10, 10, Qt::CopyROP, true);
|
|
||||||
|
|
||||||
QPainter p;
|
QPainter p;
|
||||||
// x for close
|
// x for close + menu + help
|
||||||
p.begin(aClosePix);
|
for (int j = 0; j < 3; j++) {
|
||||||
kColorBitmaps(&p, aGrp, 0, 0, 16, 16, true, close_white_bits,
|
int pix;
|
||||||
NULL, NULL, close_dgray_bits, NULL, NULL);
|
unsigned char *light, *dark;
|
||||||
p.end();
|
switch (j) {
|
||||||
p.begin(aClosePixDown);
|
case 0 :
|
||||||
kColorBitmaps(&p, aGrp, 0, 0, 16, 16, true, close_white_bits,
|
pix = P_CLOSE; light = close_white_bits; dark = close_dgray_bits;
|
||||||
NULL, NULL, close_dgray_bits, NULL, NULL);
|
break;
|
||||||
p.end();
|
case 1 :
|
||||||
p.begin(iClosePix);
|
pix = P_MENU; light = menu_white_bits; dark = menu_dgray_bits;
|
||||||
kColorBitmaps(&p, iGrp, 0, 0, 16, 16, true, close_white_bits,
|
break;
|
||||||
NULL, NULL, close_dgray_bits, NULL, NULL);
|
case 2 :
|
||||||
p.end();
|
pix = P_HELP; light = help_light_bits; dark = help_dark_bits;
|
||||||
p.begin(iClosePixDown);
|
break;
|
||||||
kColorBitmaps(&p, iGrp, 0, 0, 16, 16, true, close_white_bits,
|
}
|
||||||
NULL, NULL, close_dgray_bits, NULL, NULL);
|
for (i = 0; i < 4; i++) {
|
||||||
p.end();
|
p.begin(pixmap[pix*4 + i]);
|
||||||
|
kColorBitmaps(&p, (i<2)?aGrp:iGrp, 0, 0, 16, 16, true,
|
||||||
|
light, NULL, NULL, dark, NULL, NULL);
|
||||||
|
p.end();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// pin
|
// pin
|
||||||
p.begin(aPinupPix);
|
for (i = 0; i < 4; i++) {
|
||||||
kColorBitmaps(&p, aGrp, 0, 0, 16, 16, true, pinup_white_bits,
|
unsigned char *white = (i&1) ? pindown_white_bits : pinup_white_bits;
|
||||||
pinup_gray_bits, NULL, pinup_dgray_bits, NULL, NULL);
|
unsigned char *gray = (i&1) ? pindown_gray_bits : pinup_gray_bits;
|
||||||
p.end();
|
unsigned char *dgray = (i&1) ? pindown_dgray_bits : pinup_dgray_bits;
|
||||||
p.begin(aPinupPixDown);
|
p.begin(pixmap[P_PINUP*4 + i]);
|
||||||
kColorBitmaps(&p, aGrp, 0, 0, 16, 16, true, pindown_white_bits,
|
kColorBitmaps(&p, (i<2)?aGrp:iGrp, 0, 0, 16, 16, true, white,
|
||||||
pindown_gray_bits, NULL, pindown_dgray_bits, NULL, NULL);
|
gray, NULL, dgray, NULL, NULL);
|
||||||
p.end();
|
p.end();
|
||||||
p.begin(iPinupPix);
|
}
|
||||||
kColorBitmaps(&p, iGrp, 0, 0, 16, 16, true, pinup_white_bits,
|
|
||||||
pinup_gray_bits, NULL, pinup_dgray_bits, NULL, NULL);
|
|
||||||
p.end();
|
|
||||||
p.begin(iPinupPixDown);
|
|
||||||
kColorBitmaps(&p, iGrp, 0, 0, 16, 16, true, pindown_white_bits,
|
|
||||||
pindown_gray_bits, NULL, pindown_dgray_bits, NULL, NULL);
|
|
||||||
p.end();
|
|
||||||
|
|
||||||
// menu
|
|
||||||
p.begin(aMenuPix);
|
|
||||||
kColorBitmaps(&p, aGrp, 0, 0, 16, 16, true, menu_white_bits,
|
|
||||||
NULL, NULL, menu_dgray_bits, NULL, NULL);
|
|
||||||
p.end();
|
|
||||||
p.begin(aMenuPixDown);
|
|
||||||
kColorBitmaps(&p, aGrp, 0, 0, 16, 16, true, menu_white_bits,
|
|
||||||
NULL, NULL, menu_dgray_bits, NULL, NULL);
|
|
||||||
p.end();
|
|
||||||
p.begin(iMenuPix);
|
|
||||||
kColorBitmaps(&p, iGrp, 0, 0, 16, 16, true, menu_white_bits,
|
|
||||||
NULL, NULL, menu_dgray_bits, NULL, NULL);
|
|
||||||
p.end();
|
|
||||||
p.begin(iMenuPixDown);
|
|
||||||
kColorBitmaps(&p, iGrp, 0, 0, 16, 16, true, menu_white_bits,
|
|
||||||
NULL, NULL, menu_dgray_bits, NULL, NULL);
|
|
||||||
p.end();
|
|
||||||
|
|
||||||
// help
|
|
||||||
p.begin(aHelpPix);
|
|
||||||
kColorBitmaps(&p, aGrp, 0, 0, 16, 16, true, help_light_bits,
|
|
||||||
NULL, NULL, help_dark_bits, NULL, NULL);
|
|
||||||
p.end();
|
|
||||||
p.begin(aHelpPixDown);
|
|
||||||
kColorBitmaps(&p, aGrp, 0, 0, 16, 16, true, help_light_bits,
|
|
||||||
NULL, NULL, help_dark_bits, NULL, NULL);
|
|
||||||
p.end();
|
|
||||||
p.begin(iHelpPix);
|
|
||||||
kColorBitmaps(&p, aGrp, 0, 0, 16, 16, true, help_light_bits,
|
|
||||||
NULL, NULL, help_dark_bits, NULL, NULL);
|
|
||||||
p.end();
|
|
||||||
p.begin(iHelpPixDown);
|
|
||||||
kColorBitmaps(&p, aGrp, 0, 0, 16, 16, true, help_light_bits,
|
|
||||||
NULL, NULL, help_dark_bits, NULL, NULL);
|
|
||||||
p.end();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void B2Client::positionButtons()
|
void B2Client::positionButtons()
|
||||||
|
|
|
@ -23,6 +23,7 @@ public:
|
||||||
void setBg(const QColor &c){bg = c;}
|
void setBg(const QColor &c){bg = c;}
|
||||||
void setPixmaps(KPixmap *pix, KPixmap *pixDown, KPixmap *iPix,
|
void setPixmaps(KPixmap *pix, KPixmap *pixDown, KPixmap *iPix,
|
||||||
KPixmap *iPixDown);
|
KPixmap *iPixDown);
|
||||||
|
void setPixmaps(int button_id);
|
||||||
void setToggle(){setToggleType(Toggle);}
|
void setToggle(){setToggleType(Toggle);}
|
||||||
void setActive(bool on){setOn(on);}
|
void setActive(bool on){setOn(on);}
|
||||||
void setUseMiniIcon(){useMiniIcon = true;}
|
void setUseMiniIcon(){useMiniIcon = true;}
|
||||||
|
|
Loading…
Reference in New Issue