Enable showing mini icon in border part (suggested by Don Harrop).
SVN revision: 43124
This commit is contained in:
parent
06ad39dc25
commit
2aa7e385e2
|
@ -31,6 +31,7 @@
|
|||
#include "grabs.h"
|
||||
#include "hints.h"
|
||||
#include "iclass.h"
|
||||
#include "icons.h"
|
||||
#include "snaps.h"
|
||||
#include "tclass.h"
|
||||
#include "timers.h"
|
||||
|
@ -78,6 +79,7 @@ BorderWinpartITclassApply(EWin * ewin, int i, int force)
|
|||
ImageState *is;
|
||||
TextState *ts;
|
||||
const char *txt;
|
||||
int flags;
|
||||
|
||||
if (ewb->win == None)
|
||||
return;
|
||||
|
@ -93,6 +95,7 @@ BorderWinpartITclassApply(EWin * ewin, int i, int force)
|
|||
|
||||
ts = NULL;
|
||||
txt = NULL;
|
||||
flags = 0;
|
||||
switch (ewin->border->part[i].flags)
|
||||
{
|
||||
case FLAG_TITLE:
|
||||
|
@ -100,8 +103,10 @@ BorderWinpartITclassApply(EWin * ewin, int i, int force)
|
|||
if (txt && ewin->border->part[i].tclass)
|
||||
ts = TextclassGetTextState(ewin->border->part[i].tclass, ewb->state,
|
||||
ewin->state.active, EoIsSticky(ewin));
|
||||
flags = ITA_BGPMAP;
|
||||
break;
|
||||
case FLAG_MINIICON:
|
||||
flags = ITA_BGPMAP;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
@ -114,7 +119,38 @@ BorderWinpartITclassApply(EWin * ewin, int i, int force)
|
|||
|
||||
ITApply(ewb->win, ewin->border->part[i].iclass, is,
|
||||
ewb->state, ewin->state.active, EoIsSticky(ewin),
|
||||
ST_BORDER, ewin->border->part[i].tclass, ts, txt, 1);
|
||||
ST_BORDER, ewin->border->part[i].tclass, ts, txt, flags);
|
||||
|
||||
if (ewin->border->part[i].flags == FLAG_MINIICON)
|
||||
{
|
||||
EImage *im;
|
||||
|
||||
im = EwinIconImageGet(ewin, 16, Conf.warplist.icon_mode);
|
||||
if (im)
|
||||
{
|
||||
Pixmap pmap;
|
||||
EImageBorder *pad;
|
||||
int x, y, w, h;
|
||||
|
||||
x = y = 0;
|
||||
w = WinGetW(ewb->win);
|
||||
h = WinGetH(ewb->win);
|
||||
pad = ImageclassGetPadding(ewin->border->part[i].iclass);
|
||||
if (pad)
|
||||
{
|
||||
x += pad->left;
|
||||
y += pad->top;
|
||||
w -= pad->right;
|
||||
h -= pad->bottom;
|
||||
}
|
||||
pmap = EGetWindowBackgroundPixmap(ewb->win);
|
||||
EImageRenderOnDrawable(im, ewb->win, pmap,
|
||||
EIMAGE_BLEND | EIMAGE_ANTI_ALIAS,
|
||||
x, y, w, h);
|
||||
EImageFree(im);
|
||||
EClearWindow(ewb->win);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
|
@ -1132,7 +1132,8 @@ ITApply(Win win, ImageClass * ic, ImageState * is,
|
|||
{
|
||||
Pixmap pmap = pmm.pmap;
|
||||
|
||||
if ((ts && text) || (is->bevelstyle != BEVEL_NONE))
|
||||
if ((ts && text) || (is->bevelstyle != BEVEL_NONE) ||
|
||||
(flags & ITA_BGPMAP))
|
||||
{
|
||||
if (pmm.type != 0)
|
||||
{
|
||||
|
@ -1152,7 +1153,8 @@ ITApply(Win win, ImageClass * ic, ImageState * is,
|
|||
if (ts && text)
|
||||
TextstateTextDraw(ts, win, pmap, text, 0, 0, w, h,
|
||||
&(ic->padding), 0,
|
||||
TextclassGetJustification(tc), flags);
|
||||
TextclassGetJustification(tc),
|
||||
flags & ITA_JUSTV);
|
||||
}
|
||||
|
||||
/* Set window pixmap */
|
||||
|
@ -1193,7 +1195,8 @@ ITApply(Win win, ImageClass * ic, ImageState * is,
|
|||
if (ts && text)
|
||||
TextstateTextDraw(ts, win, pmap, text, 0, 0, w, h,
|
||||
&(ic->padding), 0,
|
||||
TextclassGetJustification(tc), flags);
|
||||
TextclassGetJustification(tc),
|
||||
flags & ITA_JUSTV);
|
||||
}
|
||||
}
|
||||
EClearWindow(win);
|
||||
|
|
|
@ -69,6 +69,10 @@
|
|||
#define IC_FLAG_MAKE_MASK 0x02 /* Make mask */
|
||||
#define IC_FLAG_FULL_SIZE 0x04 /* Make full size pixmaps */
|
||||
|
||||
/* ITApply flags */
|
||||
#define ITA_JUSTV 0x01 /* Justify text vertically */
|
||||
#define ITA_BGPMAP 0x02 /* Create window background pixmap */
|
||||
|
||||
/* iclass.c */
|
||||
int ImageclassConfigLoad(FILE * fs);
|
||||
|
||||
|
|
Loading…
Reference in New Issue