mirror of
https://github.com/gryf/wmaker.git
synced 2026-01-03 12:24:17 +01:00
style file updates, gradiented clip arrows
This commit is contained in:
@@ -200,15 +200,14 @@ static int updateUsableArea();
|
||||
#define REFRESH_MENU_TITLE_COLOR (1<<6)
|
||||
#define REFRESH_WINDOW_TITLE_COLOR (1<<7)
|
||||
#define REFRESH_WINDOW_FONT (1<<8)
|
||||
#define REFRESH_FORE_COLOR (1<<9)
|
||||
#define REFRESH_ICON_TILE (1<<10)
|
||||
#define REFRESH_ICON_FONT (1<<11)
|
||||
#define REFRESH_WORKSPACE_BACK (1<<12)
|
||||
#define REFRESH_ICON_TILE (1<<9)
|
||||
#define REFRESH_ICON_FONT (1<<10)
|
||||
#define REFRESH_WORKSPACE_BACK (1<<11)
|
||||
|
||||
#define REFRESH_BUTTON_IMAGES (1<<13)
|
||||
#define REFRESH_BUTTON_IMAGES (1<<12)
|
||||
|
||||
#define REFRESH_ICON_TITLE_COLOR (1<<14)
|
||||
#define REFRESH_ICON_TITLE_BACK (1<<15)
|
||||
#define REFRESH_ICON_TITLE_COLOR (1<<13)
|
||||
#define REFRESH_ICON_TITLE_BACK (1<<14)
|
||||
|
||||
|
||||
|
||||
@@ -2106,8 +2105,7 @@ static int
|
||||
getColor(WScreen *scr, WDefaultEntry *entry, proplist_t value, void *addr,
|
||||
void **ret)
|
||||
{
|
||||
static unsigned long pixel;
|
||||
XColor color;
|
||||
static XColor color;
|
||||
char *val;
|
||||
int second_pass=0;
|
||||
|
||||
@@ -2127,14 +2125,15 @@ again:
|
||||
}
|
||||
return False;
|
||||
}
|
||||
|
||||
pixel = color.pixel;
|
||||
|
||||
|
||||
if (ret)
|
||||
*ret = &pixel;
|
||||
*ret = &color;
|
||||
|
||||
assert(addr==NULL);
|
||||
/*
|
||||
if (addr)
|
||||
*(unsigned long*)addr = pixel;
|
||||
*/
|
||||
|
||||
return True;
|
||||
}
|
||||
@@ -2281,7 +2280,7 @@ getRImages(WScreen *scr, WDefaultEntry *entry, proplist_t value,
|
||||
static int
|
||||
setJustify(WScreen *scr, WDefaultEntry *entry, WTexture **texture, void *foo)
|
||||
{
|
||||
return REFRESH_FORE_COLOR;
|
||||
return REFRESH_WINDOW_TITLE_COLOR;
|
||||
}
|
||||
|
||||
|
||||
@@ -2515,7 +2514,7 @@ setHightlight(WScreen *scr, WDefaultEntry *entry, XColor *color, void *foo)
|
||||
|
||||
scr->select_pixel = color->pixel;
|
||||
|
||||
return REFRESH_FORE_COLOR;
|
||||
return REFRESH_MENU_COLOR;
|
||||
}
|
||||
|
||||
|
||||
@@ -2529,7 +2528,7 @@ setHightlightText(WScreen *scr, WDefaultEntry *entry, XColor *color, void *foo)
|
||||
|
||||
scr->select_text_pixel = color->pixel;
|
||||
|
||||
return REFRESH_FORE_COLOR;
|
||||
return REFRESH_MENU_COLOR;
|
||||
}
|
||||
|
||||
|
||||
@@ -2540,10 +2539,29 @@ setClipTitleColor(WScreen *scr, WDefaultEntry *entry, XColor *color, long index)
|
||||
scr->clip_title_pixel[index]!=scr->black_pixel) {
|
||||
wFreeColor(scr, scr->clip_title_pixel[index]);
|
||||
}
|
||||
|
||||
scr->clip_title_pixel[index] = color->pixel;
|
||||
|
||||
return REFRESH_FORE_COLOR;
|
||||
if (index == CLIP_NORMAL) {
|
||||
RImage *image;
|
||||
RColor color1, color2;
|
||||
int pt = CLIP_BUTTON_SIZE*wPreferences.icon_size/64;
|
||||
int as = pt - 15; /* 15 = 5+5+5 */
|
||||
|
||||
FREE_PIXMAP(scr->clip_arrow_gradient);
|
||||
|
||||
color1.red = (color->red >> 8)*6/10;
|
||||
color1.green = (color->green >> 8)*6/10;
|
||||
color1.blue = (color->blue >> 8)*6/10;
|
||||
|
||||
color2.red = WMIN((color->red >> 8)*20/10, 255);
|
||||
color2.green = WMIN((color->green >> 8)*20/10, 255);
|
||||
color2.blue = WMIN((color->blue >> 8)*20/10, 255);
|
||||
|
||||
image = RRenderGradient(as+1, as+1, &color1, &color2, RDiagonalGradient);
|
||||
RConvertImage(scr->rcontext, image, &scr->clip_arrow_gradient);
|
||||
RDestroyImage(image);
|
||||
}
|
||||
return REFRESH_ICON_TITLE_COLOR;
|
||||
}
|
||||
|
||||
|
||||
@@ -2650,7 +2668,7 @@ setMenuDisabledColor(WScreen *scr, WDefaultEntry *entry, XColor *color, void *fo
|
||||
}
|
||||
XChangeGC(dpy, scr->disabled_menu_entry_gc, gcm, &gcv);
|
||||
|
||||
return REFRESH_FORE_COLOR;
|
||||
return REFRESH_MENU_COLOR;
|
||||
#undef gcm
|
||||
}
|
||||
|
||||
|
||||
29
src/dock.c
29
src/dock.c
@@ -65,8 +65,6 @@
|
||||
#define CLIP_IDLE 0
|
||||
#define CLIP_FORWARD 2
|
||||
|
||||
#define CLIP_BUTTON_SIZE 23
|
||||
|
||||
|
||||
/**** Global variables ****/
|
||||
|
||||
@@ -319,7 +317,8 @@ paintClipButtons(WAppIcon *clipIcon, Bool lpushed, Bool rpushed)
|
||||
int pt = CLIP_BUTTON_SIZE*ICON_SIZE/64;
|
||||
int tp = ICON_SIZE - pt;
|
||||
int as = pt - 15; /* 15 = 5+5+5 */
|
||||
|
||||
GC gc;
|
||||
Bool collapsed = clipIcon->dock->collapsed;
|
||||
|
||||
if (rpushed) {
|
||||
p[0].x = tp+1;
|
||||
@@ -341,6 +340,14 @@ paintClipButtons(WAppIcon *clipIcon, Bool lpushed, Bool rpushed)
|
||||
XFillPolygon(dpy, win, scr->draw_gc, p, 3, Convex, CoordModeOrigin);
|
||||
XSetForeground(dpy, scr->draw_gc, scr->black_pixel);
|
||||
}
|
||||
if (collapsed) {
|
||||
gc = scr->clip_title_gc;
|
||||
} else {
|
||||
XSetFillStyle(dpy, scr->copy_gc, FillTiled);
|
||||
XSetTile(dpy, scr->copy_gc, scr->clip_arrow_gradient);
|
||||
XSetClipMask(dpy, scr->copy_gc, None);
|
||||
gc = scr->copy_gc;
|
||||
}
|
||||
|
||||
p[0].x = p[3].x = ICON_SIZE-6-as;
|
||||
p[0].y = p[3].y = 5;
|
||||
@@ -352,8 +359,11 @@ paintClipButtons(WAppIcon *clipIcon, Bool lpushed, Bool rpushed)
|
||||
XFillPolygon(dpy, win, scr->draw_gc, p, 3, Convex, CoordModeOrigin);
|
||||
XDrawLines(dpy, win, scr->draw_gc, p, 4, CoordModeOrigin);
|
||||
} else {
|
||||
XFillPolygon(dpy, win, scr->clip_title_gc, p,3,Convex,CoordModeOrigin);
|
||||
XDrawLines(dpy, win, scr->clip_title_gc, p,4,CoordModeOrigin);
|
||||
if (!collapsed)
|
||||
XSetTSOrigin(dpy, gc, ICON_SIZE-6-as, 5);
|
||||
|
||||
XFillPolygon(dpy, win, gc, p,3,Convex,CoordModeOrigin);
|
||||
XDrawLines(dpy, win, gc, p,4,CoordModeOrigin);
|
||||
}
|
||||
|
||||
p[0].x = p[3].x = 5;
|
||||
@@ -366,9 +376,14 @@ paintClipButtons(WAppIcon *clipIcon, Bool lpushed, Bool rpushed)
|
||||
XFillPolygon(dpy, win, scr->draw_gc, p, 3, Convex, CoordModeOrigin);
|
||||
XDrawLines(dpy, win, scr->draw_gc, p, 4, CoordModeOrigin);
|
||||
} else {
|
||||
XFillPolygon(dpy, win, scr->clip_title_gc, p,3,Convex,CoordModeOrigin);
|
||||
XDrawLines(dpy, win, scr->clip_title_gc, p,4,CoordModeOrigin);
|
||||
if (!collapsed)
|
||||
XSetTSOrigin(dpy, gc, 5, ICON_SIZE-6-as);
|
||||
|
||||
XFillPolygon(dpy, win, gc, p,3,Convex,CoordModeOrigin);
|
||||
XDrawLines(dpy, win, gc, p,4,CoordModeOrigin);
|
||||
}
|
||||
if (!collapsed)
|
||||
XSetFillStyle(dpy, scr->copy_gc, FillSolid);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -576,13 +576,13 @@ renderResizebarTexture(WScreen *scr, WTexture *texture, int width, int height,
|
||||
ROperateLine(img, RSubtractOperation, 0, 0, width-1, 0, &dark);
|
||||
ROperateLine(img, RAddOperation, 0, 1, width-1, 1, &light);
|
||||
|
||||
ROperateLine(img, RSubtractOperation, cwidth, 2, cwidth, height, &dark);
|
||||
ROperateLine(img, RAddOperation, cwidth+1, 2, cwidth+1, height, &light);
|
||||
ROperateLine(img, RSubtractOperation, cwidth, 2, cwidth, height-1, &dark);
|
||||
ROperateLine(img, RAddOperation, cwidth+1, 2, cwidth+1, height-1, &light);
|
||||
|
||||
ROperateLine(img, RSubtractOperation, width-cwidth-2, 2, width-cwidth-2,
|
||||
height, &dark);
|
||||
height-1, &dark);
|
||||
ROperateLine(img, RAddOperation, width-cwidth-1, 2, width-cwidth-1,
|
||||
height, &light);
|
||||
height-1, &light);
|
||||
|
||||
if (!RConvertImage(scr->rcontext, img, pmap)) {
|
||||
wwarning(_("error rendering image: %s"), RMessageForError(RErrorCode));
|
||||
|
||||
@@ -80,7 +80,8 @@ appearanceObserver(void *self, WMNotification *notif)
|
||||
|
||||
/* so that the appicon expose handlers will paint the appicon specific
|
||||
* stuff */
|
||||
XClearArea(dpy, icon->core->window, 0, 0, 1, 1, True);
|
||||
XClearArea(dpy, icon->core->window, 0, 0, icon->core->width,
|
||||
icon->core->height, True);
|
||||
}
|
||||
|
||||
|
||||
@@ -237,6 +238,8 @@ wIconCreateWithIconFile(WScreen *scr, char *iconfile, int tile)
|
||||
|
||||
wIconUpdate(icon);
|
||||
|
||||
WMAddNotificationObserver(appearanceObserver, icon,
|
||||
WNIconAppearanceSettingsChanged, icon);
|
||||
WMAddNotificationObserver(tileObserver, icon,
|
||||
WNIconTileSettingsChanged, icon);
|
||||
|
||||
|
||||
@@ -236,8 +236,10 @@ typedef struct _WScreen {
|
||||
unsigned int geometry_display_width;
|
||||
unsigned int geometry_display_height;
|
||||
int keymove_tick;
|
||||
|
||||
struct RContext *rcontext;
|
||||
|
||||
Pixmap clip_arrow_gradient;
|
||||
|
||||
struct RContext *rcontext; /* wrlib context */
|
||||
|
||||
WMScreen *wmscreen; /* for widget library */
|
||||
|
||||
|
||||
@@ -72,8 +72,11 @@ DoKaboom(WScreen *scr, Window win, int x, int y)
|
||||
RImage *image;
|
||||
Pixmap pixmap;
|
||||
XImage *ximage;
|
||||
GC gc;
|
||||
XGCValues gcv;
|
||||
int i;
|
||||
int w, h;
|
||||
int run;
|
||||
|
||||
h = w = wPreferences.icon_size;
|
||||
if (x < 0 || x + w > scr->scr_width || y < 0 || y + h > scr->scr_height)
|
||||
@@ -83,6 +86,7 @@ DoKaboom(WScreen *scr, Window win, int x, int y)
|
||||
if (!icon)
|
||||
return;
|
||||
|
||||
XGrabServer(dpy);
|
||||
XUnmapWindow(dpy, win);
|
||||
XSync(dpy, False);
|
||||
|
||||
@@ -94,27 +98,43 @@ DoKaboom(WScreen *scr, Window win, int x, int y)
|
||||
return;
|
||||
}
|
||||
|
||||
XSetClipMask(dpy, scr->copy_gc, None);
|
||||
gcv.foreground = scr->white_pixel;
|
||||
gcv.background = scr->black_pixel;
|
||||
gcv.graphics_exposures = False;
|
||||
gcv.subwindow_mode = IncludeInferiors;
|
||||
gc = XCreateGC(dpy, scr->w_win, GCForeground|GCBackground|GCSubwindowMode
|
||||
|GCGraphicsExposures, &gcv);
|
||||
|
||||
for (i=0; i<DEMATERIALIZE_STEPS; i++) {
|
||||
/*
|
||||
XSetClipMask(dpy, scr->copy_gc, None);
|
||||
*/
|
||||
|
||||
for (i=0,run=0; i<DEMATERIALIZE_STEPS; i++) {
|
||||
XEvent foo;
|
||||
if (XCheckTypedEvent(dpy, ButtonPress, &foo)) {
|
||||
if (!run && XCheckTypedEvent(dpy, ButtonPress, &foo)) {
|
||||
run=1;
|
||||
XPutBackEvent(dpy, &foo);
|
||||
XClearWindow(dpy, scr->root_win);
|
||||
break;
|
||||
/*
|
||||
XClearWindow(dpy, scr->root_win);
|
||||
break;
|
||||
*/
|
||||
}
|
||||
image = RCloneImage(back);
|
||||
RCombineImagesWithOpaqueness(image, icon,
|
||||
(DEMATERIALIZE_STEPS-1-i)*256/(DEMATERIALIZE_STEPS+2));
|
||||
RConvertImage(scr->rcontext, image, &pixmap);
|
||||
XCopyArea(dpy, pixmap, scr->root_win, scr->copy_gc, 0, 0, w, h, x, y);
|
||||
XCopyArea(dpy, pixmap, scr->root_win, gc, 0, 0, w, h, x, y);
|
||||
XFreePixmap(dpy, pixmap);
|
||||
XFlush(dpy);
|
||||
wusleep(1000);
|
||||
if(!run) wusleep(1000);
|
||||
}
|
||||
/*
|
||||
XClearArea(dpy, scr->root_win, x, y, w, h, False);
|
||||
*/
|
||||
XFlush(dpy);
|
||||
|
||||
XUngrabServer(dpy);
|
||||
XFreeGC(dpy, gc);
|
||||
RDestroyImage(icon);
|
||||
RDestroyImage(back);
|
||||
}
|
||||
|
||||
@@ -48,8 +48,9 @@
|
||||
/*
|
||||
* #define to enable WindozeCycling. Set WindozeCycling = YES in
|
||||
* your WindowMaker config file
|
||||
* WARNING: this still has some bugs
|
||||
*/
|
||||
#define WEENDOZE_CYCLE
|
||||
#undef WEENDOZE_CYCLE
|
||||
|
||||
|
||||
/* undefine ANIMATIONS if you don't want animations for iconification,
|
||||
@@ -423,6 +424,9 @@
|
||||
/* Vicinity in which an icon can be attached to the clip */
|
||||
#define CLIP_ATTACH_VICINITY 1
|
||||
|
||||
#define CLIP_BUTTON_SIZE 23
|
||||
|
||||
|
||||
/* The amount of space (in multiples of the icon size)
|
||||
* a docked icon must be dragged out to detach it */
|
||||
#define DOCK_DETTACH_THRESHOLD 3
|
||||
|
||||
@@ -137,7 +137,7 @@ appearanceObserver(void *self, WMNotification *notif)
|
||||
WWindow *wwin = (WWindow*)self;
|
||||
int flags = (int)WMGetNotificationClientData(notif);
|
||||
|
||||
if (!wwin->frame || !wwin->frame->titlebar)
|
||||
if (!wwin->frame || (!wwin->frame->titlebar && !wwin->frame->resizebar))
|
||||
return;
|
||||
|
||||
if (flags & WFontSettings) {
|
||||
@@ -147,6 +147,9 @@ appearanceObserver(void *self, WMNotification *notif)
|
||||
wwin->frame->flags.need_texture_remake = 1;
|
||||
}
|
||||
if (flags & (WTextureSettings | WColorSettings)) {
|
||||
if (wwin->frame->titlebar)
|
||||
XClearWindow(dpy, wwin->frame->titlebar->window);
|
||||
|
||||
wFrameWindowPaint(wwin->frame);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user