mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-20 04:48:06 +01:00
added color editing and title justification to appearance section
This commit is contained in:
@@ -67,10 +67,11 @@ typedef struct _Panel {
|
|||||||
WMFrame *colF;
|
WMFrame *colF;
|
||||||
|
|
||||||
WMPopUpButton *colP;
|
WMPopUpButton *colP;
|
||||||
|
WMColor *colors[14];
|
||||||
|
|
||||||
WMColorWell *colW;
|
WMColorWell *colW;
|
||||||
|
|
||||||
WMColorWell *sampW[15];
|
WMColorWell *sampW[24];
|
||||||
|
|
||||||
/* options */
|
/* options */
|
||||||
WMFrame *optF;
|
WMFrame *optF;
|
||||||
@@ -78,6 +79,9 @@ typedef struct _Panel {
|
|||||||
WMFrame *mstyF;
|
WMFrame *mstyF;
|
||||||
WMButton *mstyB[3];
|
WMButton *mstyB[3];
|
||||||
|
|
||||||
|
WMFrame *taliF;
|
||||||
|
WMButton *taliB[3];
|
||||||
|
|
||||||
/* */
|
/* */
|
||||||
|
|
||||||
int textureIndex[8];
|
int textureIndex[8];
|
||||||
@@ -93,9 +97,14 @@ typedef struct _Panel {
|
|||||||
WMPixmap *hand;
|
WMPixmap *hand;
|
||||||
|
|
||||||
int oldsection;
|
int oldsection;
|
||||||
|
int oldcsection;
|
||||||
|
|
||||||
|
char oldTabItem;
|
||||||
|
|
||||||
char menuStyle;
|
char menuStyle;
|
||||||
|
|
||||||
|
char titleAlignment;
|
||||||
|
|
||||||
Pixmap preview;
|
Pixmap preview;
|
||||||
|
|
||||||
char *fprefix;
|
char *fprefix;
|
||||||
@@ -115,13 +124,32 @@ typedef struct {
|
|||||||
unsigned ispixmap:1;
|
unsigned ispixmap:1;
|
||||||
} TextureListItem;
|
} TextureListItem;
|
||||||
|
|
||||||
|
static void updateColorPreviewBox(_Panel *panel, int elements);
|
||||||
|
|
||||||
static void showData(_Panel *panel);
|
static void showData(_Panel *panel);
|
||||||
|
|
||||||
static void changePage(WMWidget *w, void *data);
|
static void changePage(WMWidget *w, void *data);
|
||||||
|
|
||||||
|
static void changeColorPage(WMWidget *w, void *data);
|
||||||
|
|
||||||
static void OpenExtractPanelFor(_Panel *panel, char *path);
|
static void OpenExtractPanelFor(_Panel *panel, char *path);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
static void changedTabItem(struct WMTabViewDelegate *self, WMTabView *tabView,
|
||||||
|
WMTabViewItem *item);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
static WMTabViewDelegate tabviewDelegate = {
|
||||||
|
NULL,
|
||||||
|
NULL, /* didChangeNumberOfItems */
|
||||||
|
changedTabItem, /* didSelectItem */
|
||||||
|
NULL, /* shouldSelectItem */
|
||||||
|
NULL /* willSelectItem */
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
#define ICON_FILE "appearance"
|
#define ICON_FILE "appearance"
|
||||||
|
|
||||||
#define TNEW_FILE "tnew"
|
#define TNEW_FILE "tnew"
|
||||||
@@ -241,16 +269,15 @@ static char * hand_xpm[] = {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
static char *textureOptions[] = {
|
||||||
#define FTITLE (1<<0)
|
"FTitleBack", "(solid, black)", "[Focused]",
|
||||||
#define UTITLE (1<<1)
|
"UTitleBack", "(solid, gray)", "[Unfocused]",
|
||||||
#define OTITLE (1<<2)
|
"PTitleBack", "(solid, \"#616161\")", "[Owner of Focused]",
|
||||||
#define RESIZEBAR (1<<3)
|
"ResizebarBack", "(solid, gray)", "[Resizebar]",
|
||||||
#define MTITLE (1<<4)
|
"MenuTitleBack", "(solid, black)", "[Menu Title]",
|
||||||
#define MITEM (1<<5)
|
"MenuTextBack", "(solid, gray)", "[Menu Item]",
|
||||||
#define ICON (1<<6)
|
"IconBack", "(solid, gray)", "[Icon]"
|
||||||
#define BACK (1<<7)
|
};
|
||||||
#define EVERYTHING 0xff
|
|
||||||
|
|
||||||
|
|
||||||
#define RESIZEBAR_BEVEL -1
|
#define RESIZEBAR_BEVEL -1
|
||||||
@@ -265,6 +292,72 @@ static char * hand_xpm[] = {
|
|||||||
#define MSTYLE_FLAT 2
|
#define MSTYLE_FLAT 2
|
||||||
|
|
||||||
|
|
||||||
|
#define FTITLE_COL (1<<0)
|
||||||
|
#define UTITLE_COL (1<<1)
|
||||||
|
#define OTITLE_COL (1<<2)
|
||||||
|
#define MTITLE_COL (1<<3)
|
||||||
|
#define MITEM_COL (1<<4)
|
||||||
|
#define MDISAB_COL (1<<5)
|
||||||
|
#define MHIGH_COL (1<<6)
|
||||||
|
#define MHIGHT_COL (1<<7)
|
||||||
|
#define ICONT_COL (1<<8)
|
||||||
|
#define ICONB_COL (1<<9)
|
||||||
|
#define CLIP_COL (1<<10)
|
||||||
|
#define CCLIP_COL (1<<11)
|
||||||
|
|
||||||
|
|
||||||
|
static char *colorOptions[] = {
|
||||||
|
"FTitleColor", "white",
|
||||||
|
"UTitleColor", "black",
|
||||||
|
"PTitleColor", "white",
|
||||||
|
"MenuTitleColor", "white",
|
||||||
|
"MenuTextColor", "black",
|
||||||
|
"MenuDisabledColor", "#616161",
|
||||||
|
"HighlightColor", "white",
|
||||||
|
"HighlightTextColor", "black",
|
||||||
|
"IconTitleColor", "white",
|
||||||
|
"IconTitleBack", "black",
|
||||||
|
"ClipTitleColor", "black",
|
||||||
|
"CClipTitleColor", "#454045"
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
static WMRect previewPositions[] = {
|
||||||
|
#define PFOCUSED 0
|
||||||
|
{{30,10},{190, 20}},
|
||||||
|
#define PUNFOCUSED 1
|
||||||
|
{{30,40},{190,20}},
|
||||||
|
#define POWNER 2
|
||||||
|
{{30,70},{190,20}},
|
||||||
|
#define PRESIZEBAR 3
|
||||||
|
{{30,100},{190,9}},
|
||||||
|
#define PMTITLE 4
|
||||||
|
{{30,120},{90,20}},
|
||||||
|
#define PMITEM 5
|
||||||
|
{{30,140},{90,18*4}},
|
||||||
|
#define PICON 6
|
||||||
|
{{155,130},{64,64}}
|
||||||
|
};
|
||||||
|
#define EVERYTHING 0xff
|
||||||
|
|
||||||
|
|
||||||
|
static WMRect previewColorPositions[] = {
|
||||||
|
{{30,10},{190, 20}},
|
||||||
|
{{30,40},{190,20}},
|
||||||
|
{{30,70},{190,20}},
|
||||||
|
{{30,120},{90,20}},
|
||||||
|
{{30,140},{90,18}},
|
||||||
|
{{30,158},{90,18}},
|
||||||
|
{{30,176},{90,18}},
|
||||||
|
{{30,194},{90,18}},
|
||||||
|
{{155,130},{64,64}},
|
||||||
|
{{155,130},{64,64}},
|
||||||
|
{{155,130},{64,64}},
|
||||||
|
{{155,130},{64,64}}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -281,7 +374,6 @@ str2rcolor(RContext *rc, char *name, RColor *color)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
dumpRImage(char *path, RImage *image)
|
dumpRImage(char *path, RImage *image)
|
||||||
{
|
{
|
||||||
@@ -323,6 +415,8 @@ isPixmap(proplist_t prop)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**********************************************************************/
|
||||||
|
|
||||||
static void
|
static void
|
||||||
drawResizebarBevel(RImage *img)
|
drawResizebarBevel(RImage *img)
|
||||||
{
|
{
|
||||||
@@ -612,6 +706,32 @@ renderMenu(_Panel *panel, proplist_t texture, int width, int iheight)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void
|
||||||
|
renderPreview(_Panel *panel, GC gc, int part, int relief)
|
||||||
|
{
|
||||||
|
WMListItem *item;
|
||||||
|
TextureListItem *titem;
|
||||||
|
Pixmap pix;
|
||||||
|
WMScreen *scr = WMWidgetScreen(panel->frame);
|
||||||
|
|
||||||
|
item = WMGetListItem(panel->texLs, panel->textureIndex[part]);
|
||||||
|
titem = (TextureListItem*)item->clientData;
|
||||||
|
|
||||||
|
pix = renderTexture(scr, titem->prop,
|
||||||
|
previewPositions[part].size.width,
|
||||||
|
previewPositions[part].size.height,
|
||||||
|
NULL, relief);
|
||||||
|
|
||||||
|
XCopyArea(WMScreenDisplay(scr), pix, panel->preview, gc, 0, 0,
|
||||||
|
previewPositions[part].size.width,
|
||||||
|
previewPositions[part].size.height,
|
||||||
|
previewPositions[part].pos.x,
|
||||||
|
previewPositions[part].pos.y);
|
||||||
|
|
||||||
|
XFreePixmap(WMScreenDisplay(scr), pix);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
updatePreviewBox(_Panel *panel, int elements)
|
updatePreviewBox(_Panel *panel, int elements)
|
||||||
{
|
{
|
||||||
@@ -623,11 +743,12 @@ updatePreviewBox(_Panel *panel, int elements)
|
|||||||
GC gc;
|
GC gc;
|
||||||
WMListItem *item;
|
WMListItem *item;
|
||||||
TextureListItem *titem;
|
TextureListItem *titem;
|
||||||
|
int colorUpdate = 0;
|
||||||
|
|
||||||
gc = XCreateGC(dpy, WMWidgetXID(panel->win), 0, NULL);
|
gc = XCreateGC(dpy, WMWidgetXID(panel->win), 0, NULL);
|
||||||
|
|
||||||
|
|
||||||
if (!panel->preview) {
|
if (panel->preview == None) {
|
||||||
WMColor *color;
|
WMColor *color;
|
||||||
|
|
||||||
panel->preview = XCreatePixmap(dpy, WMWidgetXID(panel->win),
|
panel->preview = XCreatePixmap(dpy, WMWidgetXID(panel->win),
|
||||||
@@ -641,91 +762,69 @@ updatePreviewBox(_Panel *panel, int elements)
|
|||||||
refresh = -1;
|
refresh = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (elements & FTITLE) {
|
|
||||||
item = WMGetListItem(panel->texLs, panel->textureIndex[0]);
|
|
||||||
titem = (TextureListItem*)item->clientData;
|
|
||||||
|
|
||||||
pix = renderTexture(scr, titem->prop, 190, 20, NULL, RBEV_RAISED2);
|
if (elements & (1<<PFOCUSED)) {
|
||||||
|
renderPreview(panel, gc, PFOCUSED, RBEV_RAISED2);
|
||||||
XCopyArea(dpy, pix, panel->preview, gc, 0, 0, 210, 20, 30, 10);
|
colorUpdate |= FTITLE_COL;
|
||||||
|
|
||||||
XFreePixmap(dpy, pix);
|
|
||||||
}
|
}
|
||||||
if (elements & UTITLE) {
|
if (elements & (1<<PUNFOCUSED)) {
|
||||||
item = WMGetListItem(panel->texLs, panel->textureIndex[1]);
|
renderPreview(panel, gc, PUNFOCUSED, RBEV_RAISED2);
|
||||||
titem = (TextureListItem*)item->clientData;
|
colorUpdate |= UTITLE_COL;
|
||||||
|
|
||||||
pix = renderTexture(scr, titem->prop, 190, 20, NULL, RBEV_RAISED2);
|
|
||||||
|
|
||||||
XCopyArea(dpy, pix, panel->preview, gc, 0, 0, 210, 20, 30, 40);
|
|
||||||
|
|
||||||
XFreePixmap(dpy, pix);
|
|
||||||
}
|
}
|
||||||
if (elements & OTITLE) {
|
if (elements & (1<<POWNER)) {
|
||||||
item = WMGetListItem(panel->texLs, panel->textureIndex[2]);
|
renderPreview(panel, gc, POWNER, RBEV_RAISED2);
|
||||||
titem = (TextureListItem*)item->clientData;
|
colorUpdate |= OTITLE_COL;
|
||||||
|
|
||||||
pix = renderTexture(scr, titem->prop, 190, 20, NULL, RBEV_RAISED2);
|
|
||||||
|
|
||||||
XCopyArea(dpy, pix, panel->preview, gc, 0, 0, 210, 20, 30, 70);
|
|
||||||
|
|
||||||
XFreePixmap(dpy, pix);
|
|
||||||
}
|
}
|
||||||
if (elements & RESIZEBAR) {
|
if (elements & (1<<PRESIZEBAR)) {
|
||||||
item = WMGetListItem(panel->texLs, panel->textureIndex[3]);
|
renderPreview(panel, gc, PRESIZEBAR, RESIZEBAR_BEVEL);
|
||||||
titem = (TextureListItem*)item->clientData;
|
|
||||||
|
|
||||||
pix = renderTexture(scr, titem->prop, 190, 9, NULL, RESIZEBAR_BEVEL);
|
|
||||||
|
|
||||||
XCopyArea(dpy, pix, panel->preview, gc, 0, 0, 210, 20, 30, 100);
|
|
||||||
|
|
||||||
XFreePixmap(dpy, pix);
|
|
||||||
}
|
}
|
||||||
if (elements & MTITLE) {
|
if (elements & (1<<PMTITLE)) {
|
||||||
item = WMGetListItem(panel->texLs, panel->textureIndex[4]);
|
renderPreview(panel, gc, PMTITLE, RBEV_RAISED2);
|
||||||
titem = (TextureListItem*)item->clientData;
|
colorUpdate |= MTITLE_COL;
|
||||||
|
|
||||||
pix = renderTexture(scr, titem->prop, 90, 20, NULL, RBEV_RAISED2);
|
|
||||||
|
|
||||||
XCopyArea(dpy, pix, panel->preview, gc, 0, 0, 90, 20, 30, 120);
|
|
||||||
|
|
||||||
XFreePixmap(dpy, pix);
|
|
||||||
}
|
}
|
||||||
if (elements & MITEM) {
|
if (elements & (1<<PMITEM)) {
|
||||||
item = WMGetListItem(panel->texLs, panel->textureIndex[5]);
|
item = WMGetListItem(panel->texLs, panel->textureIndex[5]);
|
||||||
titem = (TextureListItem*)item->clientData;
|
titem = (TextureListItem*)item->clientData;
|
||||||
|
|
||||||
pix = renderMenu(panel, titem->prop, 90, 18);
|
pix = renderMenu(panel, titem->prop,
|
||||||
|
previewPositions[PMITEM].size.width,
|
||||||
|
previewPositions[PMITEM].size.height/4);
|
||||||
|
|
||||||
XCopyArea(dpy, pix, panel->preview, gc, 0, 0, 90, 18*4, 30, 140);
|
XCopyArea(dpy, pix, panel->preview, gc, 0, 0,
|
||||||
|
previewPositions[PMITEM].size.width,
|
||||||
|
previewPositions[PMITEM].size.height,
|
||||||
|
previewPositions[PMITEM].pos.x,
|
||||||
|
previewPositions[PMITEM].pos.y);
|
||||||
|
|
||||||
XFreePixmap(dpy, pix);
|
XFreePixmap(dpy, pix);
|
||||||
|
|
||||||
|
colorUpdate |= MITEM_COL|MDISAB_COL|MHIGH_COL|MHIGHT_COL;
|
||||||
}
|
}
|
||||||
if (elements & (MITEM|MTITLE)) {
|
if (elements & (1<<PMITEM|1<<PMTITLE)) {
|
||||||
XDrawLine(dpy, panel->preview, gc, 29, 120, 29, 120+18*4+20);
|
XDrawLine(dpy, panel->preview, gc, 29, 120, 29, 120+18*4+20);
|
||||||
XDrawLine(dpy, panel->preview, gc, 29, 119, 119, 119);
|
XDrawLine(dpy, panel->preview, gc, 29, 119, 119, 119);
|
||||||
}
|
}
|
||||||
|
if (elements & (1<<PICON)) {
|
||||||
if (elements & ICON) {
|
renderPreview(panel, gc, PICON,
|
||||||
item = WMGetListItem(panel->texLs, panel->textureIndex[6]);
|
|
||||||
titem = (TextureListItem*)item->clientData;
|
|
||||||
|
|
||||||
pix = renderTexture(scr, titem->prop, 64, 64, NULL,
|
|
||||||
titem->ispixmap ? 0 : RBEV_RAISED3);
|
titem->ispixmap ? 0 : RBEV_RAISED3);
|
||||||
|
|
||||||
XCopyArea(dpy, pix, panel->preview, gc, 0, 0, 64, 64, 155, 130);
|
colorUpdate |= ICONT_COL|ICONB_COL|CLIP_COL|CCLIP_COL;
|
||||||
|
|
||||||
XFreePixmap(dpy, pix);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (refresh < 0) {
|
if (refresh < 0) {
|
||||||
WMPixmap *p;
|
WMPixmap *p;
|
||||||
|
|
||||||
p = WMCreatePixmapFromXPixmaps(scr, panel->preview, None,
|
p = WMCreatePixmapFromXPixmaps(scr, panel->preview, None,
|
||||||
240-4, 215-4, WMScreenDepth(scr));
|
240-4, 215-4, WMScreenDepth(scr));
|
||||||
|
|
||||||
WMSetLabelImage(panel->prevL, p);
|
WMSetLabelImage(panel->prevL, p);
|
||||||
WMReleasePixmap(p);
|
WMReleasePixmap(p);
|
||||||
|
|
||||||
|
if (colorUpdate)
|
||||||
|
updateColorPreviewBox(panel, colorUpdate);
|
||||||
} else {
|
} else {
|
||||||
|
if (colorUpdate)
|
||||||
|
updateColorPreviewBox(panel, colorUpdate);
|
||||||
|
else
|
||||||
WMRedisplayWidget(panel->prevL);
|
WMRedisplayWidget(panel->prevL);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -970,7 +1069,7 @@ changePage(WMWidget *w, void *data)
|
|||||||
int section;
|
int section;
|
||||||
WMListItem *item;
|
WMListItem *item;
|
||||||
TextureListItem *titem;
|
TextureListItem *titem;
|
||||||
WMScreen *scr = WMWidgetScreen(w);
|
WMScreen *scr = WMWidgetScreen(panel->frame);
|
||||||
RContext *rc = WMScreenRContext(scr);
|
RContext *rc = WMScreenRContext(scr);
|
||||||
static WMPoint positions[] = {
|
static WMPoint positions[] = {
|
||||||
{5, 10},
|
{5, 10},
|
||||||
@@ -982,6 +1081,7 @@ changePage(WMWidget *w, void *data)
|
|||||||
{130, 150}
|
{130, 150}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (w) {
|
||||||
section = WMGetPopUpButtonSelectedItem(panel->secP);
|
section = WMGetPopUpButtonSelectedItem(panel->secP);
|
||||||
|
|
||||||
WMSelectListItem(panel->texLs, panel->textureIndex[section]);
|
WMSelectListItem(panel->texLs, panel->textureIndex[section]);
|
||||||
@@ -991,7 +1091,7 @@ changePage(WMWidget *w, void *data)
|
|||||||
item = WMGetListItem(panel->texLs, panel->textureIndex[section]);
|
item = WMGetListItem(panel->texLs, panel->textureIndex[section]);
|
||||||
|
|
||||||
titem = (TextureListItem*)item->clientData;
|
titem = (TextureListItem*)item->clientData;
|
||||||
|
}
|
||||||
{
|
{
|
||||||
WMColor *color;
|
WMColor *color;
|
||||||
|
|
||||||
@@ -1001,10 +1101,11 @@ changePage(WMWidget *w, void *data)
|
|||||||
positions[panel->oldsection].y, 22, 22);
|
positions[panel->oldsection].y, 22, 22);
|
||||||
WMReleaseColor(color);
|
WMReleaseColor(color);
|
||||||
}
|
}
|
||||||
|
if (w) {
|
||||||
panel->oldsection = section;
|
panel->oldsection = section;
|
||||||
WMDrawPixmap(panel->hand, panel->preview, positions[section].x,
|
WMDrawPixmap(panel->hand, panel->preview, positions[section].x,
|
||||||
positions[section].y);
|
positions[section].y);
|
||||||
|
}
|
||||||
WMRedisplayWidget(panel->prevL);
|
WMRedisplayWidget(panel->prevL);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1015,27 +1116,43 @@ previewClick(XEvent *event, void *clientData)
|
|||||||
{
|
{
|
||||||
_Panel *panel = (_Panel*)clientData;
|
_Panel *panel = (_Panel*)clientData;
|
||||||
int i;
|
int i;
|
||||||
static WMRect parts[] = {
|
|
||||||
{{30,10},{190, 20}},
|
|
||||||
{{30,40},{190,20}},
|
|
||||||
{{30,70},{190,20}},
|
|
||||||
{{30,100},{190,9}},
|
|
||||||
{{30,120},{90,20}},
|
|
||||||
{{30,140},{90,18*4}},
|
|
||||||
{{155,130},{64,64}}
|
|
||||||
};
|
|
||||||
|
|
||||||
for (i = 0; i < 7; i++) {
|
switch (panel->oldTabItem) {
|
||||||
if (event->xbutton.x >= parts[i].pos.x
|
case 0:
|
||||||
&& event->xbutton.y >= parts[i].pos.y
|
for (i = 0; i < sizeof(previewPositions)/sizeof(WMRect); i++) {
|
||||||
&& event->xbutton.x < parts[i].pos.x + parts[i].size.width
|
if (event->xbutton.x >= previewPositions[i].pos.x
|
||||||
&& event->xbutton.y < parts[i].pos.y + parts[i].size.height) {
|
&& event->xbutton.y >= previewPositions[i].pos.y
|
||||||
|
&& event->xbutton.x < previewPositions[i].pos.x
|
||||||
|
+ previewPositions[i].size.width
|
||||||
|
&& event->xbutton.y < previewPositions[i].pos.y
|
||||||
|
+ previewPositions[i].size.height) {
|
||||||
|
|
||||||
WMSetPopUpButtonSelectedItem(panel->secP, i);
|
WMSetPopUpButtonSelectedItem(panel->secP, i);
|
||||||
changePage(panel->secP, panel);
|
changePage(panel->secP, panel);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
for (i = 0; i < WMGetPopUpButtonNumberOfItems(panel->colP); i++) {
|
||||||
|
if (event->xbutton.x >= previewColorPositions[i].pos.x
|
||||||
|
&& event->xbutton.y >= previewColorPositions[i].pos.y
|
||||||
|
&& event->xbutton.x < previewColorPositions[i].pos.x
|
||||||
|
+ previewColorPositions[i].size.width
|
||||||
|
&& event->xbutton.y < previewColorPositions[i].pos.y
|
||||||
|
+ previewColorPositions[i].size.height) {
|
||||||
|
|
||||||
|
/* yuck kluge */
|
||||||
|
if (i == 7)
|
||||||
|
i = 4;
|
||||||
|
|
||||||
|
WMSetPopUpButtonSelectedItem(panel->colP, i);
|
||||||
|
changeColorPage(panel->colP, panel);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1095,7 +1212,6 @@ textureDoubleClick(WMWidget *w, void *data)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
paintListItem(WMList *lPtr, int index, Drawable d, char *text, int state,
|
paintListItem(WMList *lPtr, int index, Drawable d, char *text, int state,
|
||||||
WMRect *rect)
|
WMRect *rect)
|
||||||
@@ -1181,9 +1297,9 @@ fillTextureList(WMList *lPtr)
|
|||||||
proplist_t textureList;
|
proplist_t textureList;
|
||||||
proplist_t texture;
|
proplist_t texture;
|
||||||
WMUserDefaults *udb = WMGetStandardUserDefaults();
|
WMUserDefaults *udb = WMGetStandardUserDefaults();
|
||||||
int i;
|
|
||||||
TextureListItem *titem;
|
TextureListItem *titem;
|
||||||
WMScreen *scr = WMWidgetScreen(lPtr);
|
WMScreen *scr = WMWidgetScreen(lPtr);
|
||||||
|
int i;
|
||||||
|
|
||||||
textureList = WMGetUDObjectForKey(udb, "TextureList");
|
textureList = WMGetUDObjectForKey(udb, "TextureList");
|
||||||
if (!textureList)
|
if (!textureList)
|
||||||
@@ -1214,6 +1330,204 @@ fillTextureList(WMList *lPtr)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
|
static void
|
||||||
|
changeColorPage(WMWidget *w, void *data)
|
||||||
|
{
|
||||||
|
_Panel *panel = (_Panel*)data;
|
||||||
|
int section;
|
||||||
|
WMScreen *scr = WMWidgetScreen(panel->frame);
|
||||||
|
RContext *rc = WMScreenRContext(scr);
|
||||||
|
static WMPoint positions[] = {
|
||||||
|
{5, 10},
|
||||||
|
{5, 40},
|
||||||
|
{5, 70},
|
||||||
|
{5, 120},
|
||||||
|
{5, 140},
|
||||||
|
{5, 158},
|
||||||
|
{5, 176},
|
||||||
|
{5, 176},
|
||||||
|
{130, 140},
|
||||||
|
{130, 140},
|
||||||
|
{130, 140},
|
||||||
|
{130, 140}
|
||||||
|
};
|
||||||
|
|
||||||
|
if (panel->preview) {
|
||||||
|
WMColor *color;
|
||||||
|
|
||||||
|
color = WMGrayColor(scr);
|
||||||
|
XFillRectangle(rc->dpy, panel->preview, WMColorGC(color),
|
||||||
|
positions[panel->oldcsection].x,
|
||||||
|
positions[panel->oldcsection].y, 22, 22);
|
||||||
|
WMReleaseColor(color);
|
||||||
|
}
|
||||||
|
if (w) {
|
||||||
|
section = WMGetPopUpButtonSelectedItem(panel->colP);
|
||||||
|
|
||||||
|
panel->oldcsection = section;
|
||||||
|
if (panel->preview)
|
||||||
|
WMDrawPixmap(panel->hand, panel->preview, positions[section].x,
|
||||||
|
positions[section].y);
|
||||||
|
|
||||||
|
section = WMGetPopUpButtonSelectedItem(panel->colP);
|
||||||
|
|
||||||
|
WMSetColorWellColor(panel->colW, panel->colors[section]);
|
||||||
|
}
|
||||||
|
WMRedisplayWidget(panel->prevL);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void
|
||||||
|
paintText(WMScreen *scr, Drawable d, WMColor *color, WMFont *font,
|
||||||
|
int x, int y, int w, int h, WMAlignment align, char *text)
|
||||||
|
{
|
||||||
|
int l = strlen(text);
|
||||||
|
|
||||||
|
switch (align) {
|
||||||
|
case WALeft:
|
||||||
|
x += 5;
|
||||||
|
break;
|
||||||
|
case WARight:
|
||||||
|
x += w - 5 - WMWidthOfString(font, text, l);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
case WACenter:
|
||||||
|
x += (w - WMWidthOfString(font, text, l))/2;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
WMDrawString(scr, d, WMColorGC(color), font, x,
|
||||||
|
y + (h - WMFontHeight(font))/2, text, l);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
static void
|
||||||
|
updateColorPreviewBox(_Panel *panel, int elements)
|
||||||
|
{
|
||||||
|
WMScreen *scr = WMWidgetScreen(panel->frame);
|
||||||
|
WMPixmap *pixmap;
|
||||||
|
Pixmap d;
|
||||||
|
|
||||||
|
pixmap = WMGetLabelImage(panel->prevL);
|
||||||
|
d = WMGetPixmapXID(pixmap);
|
||||||
|
|
||||||
|
if (elements & FTITLE_COL) {
|
||||||
|
paintText(scr, d, panel->colors[0], panel->boldFont, 30, 10, 190, 20,
|
||||||
|
panel->titleAlignment, _("Focused Window"));
|
||||||
|
}
|
||||||
|
if (elements & UTITLE_COL) {
|
||||||
|
paintText(scr, d, panel->colors[1], panel->boldFont, 30, 40, 190, 20,
|
||||||
|
panel->titleAlignment, _("Unfocused Window"));
|
||||||
|
}
|
||||||
|
if (elements & OTITLE_COL) {
|
||||||
|
paintText(scr, d, panel->colors[2], panel->boldFont, 30, 70, 190, 20,
|
||||||
|
panel->titleAlignment, _("Owner of Focused Window"));
|
||||||
|
}
|
||||||
|
if (elements & MTITLE_COL) {
|
||||||
|
paintText(scr, d, panel->colors[3], panel->boldFont, 30, 120, 90, 20,
|
||||||
|
WALeft, _("Menu Title"));
|
||||||
|
}
|
||||||
|
if (elements & MITEM_COL) {
|
||||||
|
paintText(scr, d, panel->colors[4], panel->normalFont, 30, 140, 90, 18,
|
||||||
|
WALeft, _("Normal Item"));
|
||||||
|
paintText(scr, d, panel->colors[4], panel->normalFont, 30, 194, 90, 18,
|
||||||
|
WALeft, _("Normal Item"));
|
||||||
|
}
|
||||||
|
if (elements & MDISAB_COL) {
|
||||||
|
paintText(scr, d, panel->colors[5], panel->normalFont, 30, 158, 90, 18,
|
||||||
|
WALeft, _("Disabled Item"));
|
||||||
|
}
|
||||||
|
if (elements & MHIGH_COL) {
|
||||||
|
XFillRectangle(WMScreenDisplay(scr), d, WMColorGC(panel->colors[6]),
|
||||||
|
31, 177, 87, 15);
|
||||||
|
elements |= MHIGHT_COL;
|
||||||
|
}
|
||||||
|
if (elements & MHIGHT_COL) {
|
||||||
|
paintText(scr, d, panel->colors[7], panel->normalFont, 30, 176, 90, 18,
|
||||||
|
WALeft, _("Highlighted"));
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
if (elements & ICONT_COL) {
|
||||||
|
WRITE(_("Focused Window"), panel->colors[8], panel->boldFont,
|
||||||
|
155, 130, 64);
|
||||||
|
}
|
||||||
|
if (elements & ICONB_COL) {
|
||||||
|
WRITE(_("Focused Window"), panel->colors[9], panel->boldFont,
|
||||||
|
0, 0, 30);
|
||||||
|
}
|
||||||
|
if (elements & CLIP_COL) {
|
||||||
|
WRITE(_("Focused Window"), panel->colors[10], panel->boldFont,
|
||||||
|
0, 0, 30);
|
||||||
|
}
|
||||||
|
if (elements & CCLIP_COL) {
|
||||||
|
WRITE(_("Focused Window"), panel->colors[11], panel->boldFont,
|
||||||
|
0, 0, 30);
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
WMRedisplayWidget(panel->prevL);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void
|
||||||
|
colorWellObserver(void *self, WMNotification *n)
|
||||||
|
{
|
||||||
|
_Panel *panel = (_Panel*)self;
|
||||||
|
int p;
|
||||||
|
|
||||||
|
p = WMGetPopUpButtonSelectedItem(panel->colP);
|
||||||
|
|
||||||
|
panel->colors[p] = WMGetColorWellColor(panel->colW);
|
||||||
|
|
||||||
|
updateColorPreviewBox(panel, 1<<p);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void
|
||||||
|
changedTabItem(struct WMTabViewDelegate *self, WMTabView *tabView,
|
||||||
|
WMTabViewItem *item)
|
||||||
|
{
|
||||||
|
_Panel *panel = self->data;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
i = WMGetTabViewItemIdentifier(item);
|
||||||
|
switch (i) {
|
||||||
|
case 0:
|
||||||
|
switch (panel->oldTabItem) {
|
||||||
|
case 1:
|
||||||
|
changeColorPage(NULL, panel);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
changePage(panel->secP, panel);
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
switch (panel->oldTabItem) {
|
||||||
|
case 0:
|
||||||
|
changePage(NULL, panel);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
changeColorPage(panel->colP, panel);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
switch (panel->oldTabItem) {
|
||||||
|
case 0:
|
||||||
|
changePage(NULL, panel);
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
changeColorPage(NULL, panel);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
panel->oldTabItem = i;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*************************************************************************/
|
||||||
|
|
||||||
static void
|
static void
|
||||||
menuStyleCallback(WMWidget *self, void *data)
|
menuStyleCallback(WMWidget *self, void *data)
|
||||||
{
|
{
|
||||||
@@ -1221,15 +1535,35 @@ menuStyleCallback(WMWidget *self, void *data)
|
|||||||
|
|
||||||
if (self == panel->mstyB[0]) {
|
if (self == panel->mstyB[0]) {
|
||||||
panel->menuStyle = MSTYLE_NORMAL;
|
panel->menuStyle = MSTYLE_NORMAL;
|
||||||
updatePreviewBox(panel, MITEM);
|
updatePreviewBox(panel, 1<<PMITEM);
|
||||||
|
|
||||||
} else if (self == panel->mstyB[1]) {
|
} else if (self == panel->mstyB[1]) {
|
||||||
panel->menuStyle = MSTYLE_SINGLE;
|
panel->menuStyle = MSTYLE_SINGLE;
|
||||||
updatePreviewBox(panel, MITEM);
|
updatePreviewBox(panel, 1<<PMITEM);
|
||||||
|
|
||||||
} else if (self == panel->mstyB[2]) {
|
} else if (self == panel->mstyB[2]) {
|
||||||
panel->menuStyle = MSTYLE_FLAT;
|
panel->menuStyle = MSTYLE_FLAT;
|
||||||
updatePreviewBox(panel, MITEM);
|
updatePreviewBox(panel, 1<<PMITEM);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void
|
||||||
|
titleAlignCallback(WMWidget *self, void *data)
|
||||||
|
{
|
||||||
|
_Panel *panel = (_Panel*)data;
|
||||||
|
|
||||||
|
if (self == panel->taliB[0]) {
|
||||||
|
panel->titleAlignment = WALeft;
|
||||||
|
updatePreviewBox(panel, 1<<PFOCUSED|1<<PUNFOCUSED|1<<POWNER);
|
||||||
|
|
||||||
|
} else if (self == panel->taliB[1]) {
|
||||||
|
panel->titleAlignment = WACenter;
|
||||||
|
updatePreviewBox(panel, 1<<PFOCUSED|1<<PUNFOCUSED|1<<POWNER);
|
||||||
|
|
||||||
|
} else if (self == panel->taliB[2]) {
|
||||||
|
panel->titleAlignment = WARight;
|
||||||
|
updatePreviewBox(panel, 1<<PFOCUSED|1<<PUNFOCUSED|1<<POWNER);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1289,9 +1623,12 @@ createPanel(Panel *p)
|
|||||||
|
|
||||||
/* tabview */
|
/* tabview */
|
||||||
|
|
||||||
|
tabviewDelegate.data = panel;
|
||||||
|
|
||||||
panel->tabv = WMCreateTabView(panel->frame);
|
panel->tabv = WMCreateTabView(panel->frame);
|
||||||
WMResizeWidget(panel->tabv, 245, FRAME_HEIGHT - 20);
|
WMResizeWidget(panel->tabv, 245, FRAME_HEIGHT - 20);
|
||||||
WMMoveWidget(panel->tabv, 265, 10);
|
WMMoveWidget(panel->tabv, 265, 10);
|
||||||
|
WMSetTabViewDelegate(panel->tabv, &tabviewDelegate);
|
||||||
|
|
||||||
/*** texture list ***/
|
/*** texture list ***/
|
||||||
|
|
||||||
@@ -1401,27 +1738,42 @@ createPanel(Panel *p)
|
|||||||
|
|
||||||
WMAddItemInTabView(panel->tabv, item);
|
WMAddItemInTabView(panel->tabv, item);
|
||||||
|
|
||||||
|
|
||||||
panel->colP = WMCreatePopUpButton(panel->colF);
|
panel->colP = WMCreatePopUpButton(panel->colF);
|
||||||
WMResizeWidget(panel->colP, 228, 20);
|
WMResizeWidget(panel->colP, 228, 20);
|
||||||
WMMoveWidget(panel->colP, 7, 7);
|
WMMoveWidget(panel->colP, 7, 7);
|
||||||
WMSetPopUpButtonSelectedItem(panel->colP, 0);
|
WMSetPopUpButtonSelectedItem(panel->colP, 0);
|
||||||
WMAddPopUpButtonItem(panel->colP, _("Focused Window Title"));
|
WMAddPopUpButtonItem(panel->colP, _("Focused Window Title"));
|
||||||
WMAddPopUpButtonItem(panel->colP, _("Unfocused Window Title"));
|
WMAddPopUpButtonItem(panel->colP, _("Unfocused Window Title"));
|
||||||
|
WMAddPopUpButtonItem(panel->colP, _("Owner of Focused Window Title"));
|
||||||
/* WMSetPopUpButtonAction(panel->colP, changePage, panel);
|
WMAddPopUpButtonItem(panel->colP, _("Menu Title"));
|
||||||
|
WMAddPopUpButtonItem(panel->colP, _("Menu Item Text"));
|
||||||
|
WMAddPopUpButtonItem(panel->colP, _("Disabled Menu Item Text"));
|
||||||
|
WMAddPopUpButtonItem(panel->colP, _("Menu Highlight Color"));
|
||||||
|
WMAddPopUpButtonItem(panel->colP, _("Highlighted Menu Text Color"));
|
||||||
|
/*
|
||||||
|
WMAddPopUpButtonItem(panel->colP, _("Miniwindow Title"));
|
||||||
|
WMAddPopUpButtonItem(panel->colP, _("Miniwindow Title Back"));
|
||||||
|
WMAddPopUpButtonItem(panel->colP, _("Clip Title"));
|
||||||
|
WMAddPopUpButtonItem(panel->colP, _("Collapsed Clip Title"));
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
WMSetPopUpButtonSelectedItem(panel->colP, 0);
|
||||||
|
|
||||||
|
WMSetPopUpButtonAction(panel->colP, changeColorPage, panel);
|
||||||
|
|
||||||
|
|
||||||
panel->colW = WMCreateColorWell(panel->colF);
|
panel->colW = WMCreateColorWell(panel->colF);
|
||||||
WMResizeWidget(panel->colW, 65, 50);
|
WMResizeWidget(panel->colW, 65, 50);
|
||||||
WMMoveWidget(panel->colW, 40, 75);
|
WMMoveWidget(panel->colW, 30, 75);
|
||||||
|
WMAddNotificationObserver(colorWellObserver, panel,
|
||||||
|
WMColorWellDidChangeNotification, panel->colW);
|
||||||
|
|
||||||
for (i = 0; i < 3; i++) {
|
for (i = 0; i < 4; i++) {
|
||||||
int j;
|
int j;
|
||||||
for (j = 0; j < 5; j++) {
|
for (j = 0; j < 6; j++) {
|
||||||
panel->sampW[i] = WMCreateColorWell(panel->colF);
|
panel->sampW[i] = WMCreateColorWell(panel->colF);
|
||||||
WMResizeWidget(panel->sampW[i], 28, 28);
|
WMResizeWidget(panel->sampW[i], 22, 22);
|
||||||
WMMoveWidget(panel->sampW[i], 140 + i*28, 40 + j*28);
|
WMMoveWidget(panel->sampW[i], 130 + i*22, 40 + j*22);
|
||||||
WSetColorWellBordered(panel->sampW[i], False);
|
WSetColorWellBordered(panel->sampW[i], False);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1479,6 +1831,34 @@ createPanel(Panel *p)
|
|||||||
|
|
||||||
WMMapSubwidgets(panel->mstyF);
|
WMMapSubwidgets(panel->mstyF);
|
||||||
|
|
||||||
|
|
||||||
|
panel->taliF = WMCreateFrame(panel->optF);
|
||||||
|
WMResizeWidget(panel->taliF, 110, 80);
|
||||||
|
WMMoveWidget(panel->taliF, 15, 100);
|
||||||
|
WMSetFrameTitle(panel->taliF, _("Title Alignment"));
|
||||||
|
|
||||||
|
for (i = 0; i < 3; i++) {
|
||||||
|
panel->taliB[i] = WMCreateRadioButton(panel->taliF);
|
||||||
|
WMSetButtonAction(panel->taliB[i], titleAlignCallback, panel);
|
||||||
|
switch (i) {
|
||||||
|
case 0:
|
||||||
|
WMSetButtonText(panel->taliB[i], _("Left"));
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
WMSetButtonText(panel->taliB[i], _("Center"));
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
WMSetButtonText(panel->taliB[i], _("Right"));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
WMResizeWidget(panel->taliB[i], 90, 18);
|
||||||
|
WMMoveWidget(panel->taliB[i], 10, 15 + 20*i);
|
||||||
|
}
|
||||||
|
WMGroupButtons(panel->taliB[0], panel->taliB[1]);
|
||||||
|
WMGroupButtons(panel->taliB[0], panel->taliB[2]);
|
||||||
|
|
||||||
|
WMMapSubwidgets(panel->taliB);
|
||||||
|
|
||||||
WMMapSubwidgets(panel->optF);
|
WMMapSubwidgets(panel->optF);
|
||||||
|
|
||||||
/**/
|
/**/
|
||||||
@@ -1534,7 +1914,7 @@ setupTextureFor(WMList *list, char *key, char *defValue, char *title,
|
|||||||
static void
|
static void
|
||||||
showData(_Panel *panel)
|
showData(_Panel *panel)
|
||||||
{
|
{
|
||||||
int i = 0;
|
int i;
|
||||||
char *str;
|
char *str;
|
||||||
|
|
||||||
str = GetStringForKey("MenuStyle");
|
str = GetStringForKey("MenuStyle");
|
||||||
@@ -1546,42 +1926,39 @@ showData(_Panel *panel)
|
|||||||
panel->menuStyle = MSTYLE_NORMAL;
|
panel->menuStyle = MSTYLE_NORMAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
setupTextureFor(panel->texLs, "FTitleBack", "(solid, black)",
|
str = GetStringForKey("TitleJustify");
|
||||||
"[Focused]", i);
|
if (str && strcasecmp(str, "left")==0) {
|
||||||
panel->textureIndex[i] = i++;
|
panel->titleAlignment = WALeft;
|
||||||
|
} else if (str && strcasecmp(str, "right")==0) {
|
||||||
|
panel->titleAlignment = WARight;
|
||||||
|
} else {
|
||||||
|
panel->titleAlignment = WACenter;
|
||||||
|
}
|
||||||
|
|
||||||
setupTextureFor(panel->texLs, "UTitleBack", "(solid, gray)",
|
for (i = 0; i < sizeof(colorOptions)/(2*sizeof(char*)); i++) {
|
||||||
"[Unfocused]", i);
|
WMColor *color;
|
||||||
panel->textureIndex[i] = i++;
|
|
||||||
|
|
||||||
setupTextureFor(panel->texLs, "PTitleBack", "(solid, \"#616161\")",
|
str = GetStringForKey(colorOptions[i*2]);
|
||||||
"[Owner of Focused]", i);
|
if (!str)
|
||||||
panel->textureIndex[i] = i++;
|
str = colorOptions[i*2+1];
|
||||||
|
|
||||||
setupTextureFor(panel->texLs, "ResizebarBack", "(solid, gray)",
|
color = WMCreateNamedColor(WMWidgetScreen(panel->frame), str, False);
|
||||||
"[Resizebar]", i);
|
|
||||||
panel->textureIndex[i] = i++;
|
|
||||||
|
|
||||||
setupTextureFor(panel->texLs, "MenuTitleBack", "(solid, black)",
|
panel->colors[i] = color;
|
||||||
"[Menu Title]", i);
|
}
|
||||||
panel->textureIndex[i] = i++;
|
changeColorPage(panel->colP, panel);
|
||||||
|
|
||||||
setupTextureFor(panel->texLs, "MenuTextBack", "(solid, gray)",
|
|
||||||
"[Menu Item]", i);
|
|
||||||
panel->textureIndex[i] = i++;
|
|
||||||
|
|
||||||
setupTextureFor(panel->texLs, "IconBack", "(solid, gray)", "[Icon]", i);
|
|
||||||
panel->textureIndex[i] = i++;
|
|
||||||
/*
|
|
||||||
setupTextureFor(panel->texLs, "WorkspaceBack", "(solid, black)",
|
|
||||||
"[Workspace]", i);
|
|
||||||
panel->textureIndex[i] = i++;
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
for (i = 0; i < sizeof(textureOptions)/(3*sizeof(char*)); i++) {
|
||||||
|
setupTextureFor(panel->texLs, textureOptions[i*3],
|
||||||
|
textureOptions[i*3+1], textureOptions[i*3+2], i);
|
||||||
|
panel->textureIndex[i] = i;
|
||||||
|
}
|
||||||
updatePreviewBox(panel, EVERYTHING);
|
updatePreviewBox(panel, EVERYTHING);
|
||||||
|
|
||||||
|
|
||||||
for (i = 0; i < 3; i++) {
|
for (i = 0; i < 3; i++) {
|
||||||
WMSetButtonSelected(panel->mstyB[i], i==panel->menuStyle);
|
WMSetButtonSelected(panel->mstyB[i], i==panel->menuStyle);
|
||||||
|
WMSetButtonSelected(panel->taliB[i], i==panel->titleAlignment);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1592,34 +1969,18 @@ storeData(_Panel *panel)
|
|||||||
{
|
{
|
||||||
TextureListItem *titem;
|
TextureListItem *titem;
|
||||||
WMListItem *item;
|
WMListItem *item;
|
||||||
|
int i;
|
||||||
|
|
||||||
item = WMGetListItem(panel->texLs, panel->textureIndex[0]);
|
for (i = 0; i < sizeof(textureOptions)/(sizeof(char*)*3); i++) {
|
||||||
|
item = WMGetListItem(panel->texLs, panel->textureIndex[i]);
|
||||||
titem = (TextureListItem*)item->clientData;
|
titem = (TextureListItem*)item->clientData;
|
||||||
SetObjectForKey(titem->prop, "FTitleBack");
|
SetObjectForKey(titem->prop, textureOptions[i*3]);
|
||||||
|
}
|
||||||
|
|
||||||
item = WMGetListItem(panel->texLs, panel->textureIndex[1]);
|
for (i = 0; i < 8; i++) {
|
||||||
titem = (TextureListItem*)item->clientData;
|
SetStringForKey(WMGetColorRGBDescription(panel->colors[i]),
|
||||||
SetObjectForKey(titem->prop, "UTitleBack");
|
colorOptions[i]);
|
||||||
|
}
|
||||||
item = WMGetListItem(panel->texLs, panel->textureIndex[2]);
|
|
||||||
titem = (TextureListItem*)item->clientData;
|
|
||||||
SetObjectForKey(titem->prop, "PTitleBack");
|
|
||||||
|
|
||||||
item = WMGetListItem(panel->texLs, panel->textureIndex[3]);
|
|
||||||
titem = (TextureListItem*)item->clientData;
|
|
||||||
SetObjectForKey(titem->prop, "ResizebarBack");
|
|
||||||
|
|
||||||
item = WMGetListItem(panel->texLs, panel->textureIndex[4]);
|
|
||||||
titem = (TextureListItem*)item->clientData;
|
|
||||||
SetObjectForKey(titem->prop, "MenuTitleBack");
|
|
||||||
|
|
||||||
item = WMGetListItem(panel->texLs, panel->textureIndex[5]);
|
|
||||||
titem = (TextureListItem*)item->clientData;
|
|
||||||
SetObjectForKey(titem->prop, "MenuTextBack");
|
|
||||||
|
|
||||||
item = WMGetListItem(panel->texLs, panel->textureIndex[6]);
|
|
||||||
titem = (TextureListItem*)item->clientData;
|
|
||||||
SetObjectForKey(titem->prop, "IconBack");
|
|
||||||
|
|
||||||
switch (panel->menuStyle) {
|
switch (panel->menuStyle) {
|
||||||
case MSTYLE_SINGLE:
|
case MSTYLE_SINGLE:
|
||||||
@@ -1633,6 +1994,18 @@ storeData(_Panel *panel)
|
|||||||
SetStringForKey("normal", "MenuStyle");
|
SetStringForKey("normal", "MenuStyle");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
switch (panel->titleAlignment) {
|
||||||
|
case WALeft:
|
||||||
|
SetStringForKey("left", "TitleJustify");
|
||||||
|
break;
|
||||||
|
case WARight:
|
||||||
|
SetStringForKey("right", "TitleJustify");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
case WACenter:
|
||||||
|
SetStringForKey("center", "TitleJustify");
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user