mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-24 15:12:32 +01:00
New titlebar button style
This patch adds new titlebar button style. Original-patch-by: Carlos Torres <vlaadbrain@operamail.com> Signed-off-by: Alexey I. Froloff <raorn@altlinux.org>
This commit is contained in:
committed by
Carlos R. Mafra
parent
cc629f342c
commit
17cc7c3c77
@@ -228,6 +228,10 @@ typedef enum {
|
||||
#define WD_BOTTOMLEFT 6
|
||||
#define WD_BOTTOMRIGHT 7
|
||||
|
||||
/* titlebar style */
|
||||
#define TS_NEW 0
|
||||
#define TS_OLD 1
|
||||
#define TS_NEXT 2
|
||||
|
||||
/* workspace border position */
|
||||
#define WB_NONE 0
|
||||
|
||||
@@ -97,6 +97,272 @@ static char *PRED_ICONIFY_XPM[] = {
|
||||
".........."
|
||||
};
|
||||
|
||||
static char *NEXT_CLOSE_XPM[] = {
|
||||
"10 10 69 1",
|
||||
" c None",
|
||||
". c #FBFBFB",
|
||||
"+ c #F9F9F9",
|
||||
"@ c #F7F7F7",
|
||||
"# c #F4F4F4",
|
||||
"$ c #F0F0F0",
|
||||
"% c #EDEDED",
|
||||
"& c #E8E8E8",
|
||||
"* c #AFAFAF",
|
||||
"= c #FCFCFC",
|
||||
"- c #8B8B8B",
|
||||
"; c #DEDEDE",
|
||||
"> c #E0E0E0",
|
||||
", c #C7C7C7",
|
||||
"' c #999999",
|
||||
") c #2B2B2B",
|
||||
"! c #878787",
|
||||
"~ c #F1F1F1",
|
||||
"{ c #222222",
|
||||
"] c #C2C2C2",
|
||||
"^ c #EBEBEB",
|
||||
"/ c #DCDCDC",
|
||||
"( c #9F9F9F",
|
||||
"_ c #363636",
|
||||
": c #FEFEFE",
|
||||
"< c #C1C1C1",
|
||||
"[ c #232323",
|
||||
"} c #CFCFCF",
|
||||
"| c #282828",
|
||||
"1 c #D5D5D5",
|
||||
"2 c #FAFAFA",
|
||||
"3 c #F6F6F6",
|
||||
"4 c #D3D3D3",
|
||||
"5 c #121212",
|
||||
"6 c #BEBEBE",
|
||||
"7 c #898989",
|
||||
"8 c #838383",
|
||||
"9 c #EEEEEE",
|
||||
"0 c #E9E9E9",
|
||||
"a c #CDCDCD",
|
||||
"b c #080808",
|
||||
"c c #131313",
|
||||
"d c #A1A1A1",
|
||||
"e c #7F7F7F",
|
||||
"f c #808080",
|
||||
"g c #D9D9D9",
|
||||
"h c #8D8D8D",
|
||||
"i c #1D1D1D",
|
||||
"j c #C9C9C9",
|
||||
"k c #B4B4B4",
|
||||
"l c #191919",
|
||||
"m c #6A6A6A",
|
||||
"n c #6C6C6C",
|
||||
"o c #7A7A7A",
|
||||
"p c #B1B1B1",
|
||||
"q c #202020",
|
||||
"r c #BBBBBB",
|
||||
"s c #D4D4D4",
|
||||
"t c #151515",
|
||||
"u c #515151",
|
||||
"v c #747474",
|
||||
"w c #3A3A3A",
|
||||
"x c #CCCCCC",
|
||||
"y c #B3B3B3",
|
||||
"z c #939393",
|
||||
"A c #A3A3A3",
|
||||
"B c #919191",
|
||||
"C c #858585",
|
||||
"D c #7C7C7C",
|
||||
"...+@#$%&*",
|
||||
"=-;#%>,')!",
|
||||
"=~{]^/(_!!",
|
||||
"=:<[}*|1(!",
|
||||
"2@345[>678",
|
||||
"@90abc6def",
|
||||
"#ghijklmno",
|
||||
"~pqrgs(tuv",
|
||||
"%wxx'-p8tn",
|
||||
"yzAB7C8enD"};
|
||||
|
||||
|
||||
static char *NEXT_BROKEN_CLOSE_XPM[] = {
|
||||
"10 10 8 1",
|
||||
" c None",
|
||||
". c #E0E0E0",
|
||||
"+ c #7D7D7D",
|
||||
"@ c #DBDBDB",
|
||||
"# c #BDBDBD",
|
||||
"$ c #080808",
|
||||
"% c #363636",
|
||||
"& c #D4D4D4",
|
||||
".........+",
|
||||
".+@...#+$+",
|
||||
"..$#.@+%++",
|
||||
"..###++&++",
|
||||
"...&...#++",
|
||||
"...&..#+++",
|
||||
".@+##+%%%+",
|
||||
".+$#@&+$%%",
|
||||
".%##++++$%",
|
||||
"++++++++%+"};
|
||||
|
||||
static char *NEXT_KILL_XPM[] = {
|
||||
"10 10 64 1",
|
||||
" c None",
|
||||
". c #FBFBFB",
|
||||
"+ c #FAFAFA",
|
||||
"@ c #F7F7F7",
|
||||
"# c #F5F5F5",
|
||||
"$ c #F6F6F6",
|
||||
"% c #EEEEEE",
|
||||
"& c #B3B3B3",
|
||||
"* c #FCFCFC",
|
||||
"= c #8B8B8B",
|
||||
"- c #E3E3E3",
|
||||
"; c #F4F4F4",
|
||||
"> c #ECECEC",
|
||||
", c #EAEAEA",
|
||||
"' c #BFBFBF",
|
||||
") c #474747",
|
||||
"! c #A5A5A5",
|
||||
"~ c #EFEFEF",
|
||||
"{ c #262626",
|
||||
"] c #B6B6B6",
|
||||
"^ c #B4B4B4",
|
||||
"/ c #282828",
|
||||
"( c #A3A3A3",
|
||||
"_ c #FEFEFE",
|
||||
": c #E0E0E0",
|
||||
"< c #B8B8B8",
|
||||
"[ c #C5C5C5",
|
||||
"} c #DCDCDC",
|
||||
"| c #D3D3D3",
|
||||
"1 c #E4E4E4",
|
||||
"2 c #B1B1B1",
|
||||
"3 c #878787",
|
||||
"4 c #D5D5D5",
|
||||
"5 c #202020",
|
||||
"6 c #222222",
|
||||
"7 c #F1F1F1",
|
||||
"8 c #959595",
|
||||
"9 c #838383",
|
||||
"0 c #DBDBDB",
|
||||
"a c #252525",
|
||||
"b c #E9E9E9",
|
||||
"c c #F0F0F0",
|
||||
"d c #999999",
|
||||
"e c #808080",
|
||||
"f c #9B9B9B",
|
||||
"g c #C2C2C2",
|
||||
"h c #7C7C7C",
|
||||
"i c #7A7A7A",
|
||||
"j c #232323",
|
||||
"k c #CCCCCC",
|
||||
"l c #C1C1C1",
|
||||
"m c #181818",
|
||||
"n c #404040",
|
||||
"o c #747474",
|
||||
"p c #E7E7E7",
|
||||
"q c #303030",
|
||||
"r c #C9C9C9",
|
||||
"s c #ACACAC",
|
||||
"t c #787878",
|
||||
"u c #141414",
|
||||
"v c #6C6C6C",
|
||||
"w c #8F8F8F",
|
||||
"x c #858585",
|
||||
"y c #7F7F7F",
|
||||
"...+@#$$%&",
|
||||
"*=-+;>,')!",
|
||||
"*~{];#^/((",
|
||||
"*_:<[}|123",
|
||||
"+@+456;789",
|
||||
"@~706abcde",
|
||||
"#0fg#$3ehi",
|
||||
"c=jk>%lmno",
|
||||
"pqr}s(^tuv",
|
||||
"2w!d=x9yvh"};
|
||||
|
||||
static char *NEXT_ICONIFY_XPM[] = {
|
||||
"10 10 72 1",
|
||||
" c None",
|
||||
". c #FCFCFC",
|
||||
"+ c #FAFAFA",
|
||||
"@ c #F8F8F8",
|
||||
"# c #F6F6F6",
|
||||
"$ c #F2F2F2",
|
||||
"% c #EFEFEF",
|
||||
"& c #EAEAEA",
|
||||
"* c #A6A6A6",
|
||||
"= c #FEFEFE",
|
||||
"- c #FDFDFD",
|
||||
"; c #F9F9F9",
|
||||
"> c #E2E2E2",
|
||||
", c #CBCBCB",
|
||||
"' c #AFAFAF",
|
||||
") c #808080",
|
||||
"! c #717171",
|
||||
"~ c #FFFFFF",
|
||||
"{ c #FBFBFB",
|
||||
"] c #F1F1F1",
|
||||
"^ c #E5E5E5",
|
||||
"/ c #CCCCCC",
|
||||
"( c #838383",
|
||||
"_ c #A0A0A0",
|
||||
": c #989898",
|
||||
"< c #8B8B8B",
|
||||
"[ c #7F7F7F",
|
||||
"} c #E8E8E8",
|
||||
"| c #ADADAD",
|
||||
"1 c #181818",
|
||||
"2 c #171717",
|
||||
"3 c #161616",
|
||||
"4 c #141414",
|
||||
"5 c #0A0A0A",
|
||||
"6 c #000000",
|
||||
"7 c #A2A2A2",
|
||||
"8 c #747474",
|
||||
"9 c #6C6C6C",
|
||||
"0 c #F0F0F0",
|
||||
"a c #B9B9B9",
|
||||
"b c #B7B7B7",
|
||||
"c c #B1B1B1",
|
||||
"d c #868686",
|
||||
"e c #020202",
|
||||
"f c #EDEDED",
|
||||
"g c #939393",
|
||||
"h c #676767",
|
||||
"i c #696969",
|
||||
"j c #8E8E8E",
|
||||
"k c #787878",
|
||||
"l c #757575",
|
||||
"m c #777777",
|
||||
"n c #767676",
|
||||
"o c #EBEBEB",
|
||||
"p c #525252",
|
||||
"q c #626262",
|
||||
"r c #F3F3F3",
|
||||
"s c #E1E1E1",
|
||||
"t c #B5B5B5",
|
||||
"u c #5F5F5F",
|
||||
"v c #424242",
|
||||
"w c #5B5B5B",
|
||||
"x c #9D9D9D",
|
||||
"y c #969696",
|
||||
"z c #E4E4E4",
|
||||
"A c #444444",
|
||||
"B c #2E2E2E",
|
||||
"C c #A9A9A9",
|
||||
"D c #7C7C7C",
|
||||
"E c #797979",
|
||||
"F c #5D5D5D",
|
||||
"G c #646464",
|
||||
"...+@#$%&*",
|
||||
".=-;%>,')!",
|
||||
"-~={]^/'(!",
|
||||
"_'*:<[}|)!",
|
||||
"123456%789",
|
||||
"0abcdefghi",
|
||||
"jklmneonpq",
|
||||
"rs^>te}uvw",
|
||||
"f_xy9ezABp",
|
||||
"CDDEue7FpG"};
|
||||
|
||||
#ifdef XKB_BUTTON_HINT
|
||||
#include "extend_pixmaps.h"
|
||||
#endif /* XKB_BUTTON_HINT */
|
||||
|
||||
@@ -185,6 +185,11 @@ static WOptionEnumeration seFocusModes[] = {
|
||||
{NULL, 0, 0}
|
||||
};
|
||||
|
||||
static WOptionEnumeration seTitlebarModes[] = {
|
||||
{"new", TS_NEW, 0}, {"old", TS_OLD, 0},
|
||||
{"next", TS_NEXT, 0}, {NULL, 0, 0}
|
||||
};
|
||||
|
||||
static WOptionEnumeration seColormapModes[] = {
|
||||
{"Manual", WCM_CLICK, 0}, {"ClickToFocus", WCM_CLICK, 1},
|
||||
{"Auto", WCM_POINTER, 0}, {"FocusFollowMouse", WCM_POINTER, 1},
|
||||
@@ -311,8 +316,8 @@ WDefaultEntry staticOptionList[] = {
|
||||
&wPreferences.disable_root_mouse, getBool, NULL, NULL, NULL},
|
||||
{"FocusMode", "manual", seFocusModes, /* have a problem when switching from */
|
||||
&wPreferences.focus_mode, getEnum, NULL, NULL, NULL}, /* manual to sloppy without restart */
|
||||
{"NewStyle", "NO", NULL,
|
||||
&wPreferences.new_style, getBool, NULL, NULL, NULL},
|
||||
{"NewStyle", "new", seTitlebarModes,
|
||||
&wPreferences.new_style, getEnum, NULL, NULL, NULL},
|
||||
{"DisableDock", "NO", (void *)WM_DOCK,
|
||||
NULL, getBool, setIfDockPresent, NULL, NULL},
|
||||
{"DisableClip", "NO", (void *)WM_CLIP,
|
||||
|
||||
@@ -113,5 +113,79 @@ static char *PRED_XKBGROUP4_XPM[] = {
|
||||
};
|
||||
|
||||
|
||||
static char *NEXT_XKBGROUP1_XPM[] = {
|
||||
"10 10 6 1",
|
||||
" c None",
|
||||
". c #E0E0E0",
|
||||
"+ c #7D7D7D",
|
||||
"@ c #363636",
|
||||
"# c #080808",
|
||||
"$ c #BDBDBD",
|
||||
".........+",
|
||||
"..@@@@@@++",
|
||||
"..@####+++",
|
||||
"..#+$$$$++",
|
||||
"..###+.$++",
|
||||
"..#++..$++",
|
||||
"..#$.$$$++",
|
||||
"..#@@@@+++",
|
||||
".$+#####@@",
|
||||
"+++++++@@@"};
|
||||
|
||||
static char *NEXT_XKBGROUP2_XPM[] = {
|
||||
"10 10 6 1",
|
||||
" c None",
|
||||
". c #E0E0E0",
|
||||
"+ c #7D7D7D",
|
||||
"@ c #BDBDBD",
|
||||
"# c #080808",
|
||||
"$ c #363636",
|
||||
".........+",
|
||||
".@##@@$#++",
|
||||
".#.+#+###+",
|
||||
".#+######+",
|
||||
".########+",
|
||||
"..######++",
|
||||
"..@####+++",
|
||||
".@@@#$++++",
|
||||
".@++#$++$$",
|
||||
"+++++++$$$"};
|
||||
|
||||
static char *NEXT_XKBGROUP3_XPM[] = {
|
||||
"10 10 6 1",
|
||||
" c None",
|
||||
". c #E0E0E0",
|
||||
"+ c #7D7D7D",
|
||||
"@ c #BDBDBD",
|
||||
"# c #080808",
|
||||
"$ c #363636",
|
||||
".........+",
|
||||
"..@####.++",
|
||||
".@######.+",
|
||||
".#.+##.+#+",
|
||||
".#++##++#+",
|
||||
".########+",
|
||||
".##@##@##+",
|
||||
".+##@@##$+",
|
||||
".@+####$$$",
|
||||
"+++++++$$$"};
|
||||
|
||||
static char *NEXT_XKBGROUP4_XPM[] = {
|
||||
"10 10 6 1",
|
||||
" c None",
|
||||
". c #E0E0E0",
|
||||
"+ c #7D7D7D",
|
||||
"@ c #BDBDBD",
|
||||
"# c #080808",
|
||||
"$ c #363636",
|
||||
".........+",
|
||||
"..@####.++",
|
||||
".@#@@@@#.+",
|
||||
".##$@@#$#+",
|
||||
".#$$@@$$#+",
|
||||
".#@@@@++#+",
|
||||
".#+#++#.#+",
|
||||
".+#+##$#$+",
|
||||
".@+####$$$",
|
||||
"+++++++$$$"};
|
||||
|
||||
|
||||
100
src/framewin.c
100
src/framewin.c
@@ -127,10 +127,12 @@ void wFrameWindowUpdateBorders(WFrameWindow * fwin, int flags)
|
||||
else
|
||||
theight = 0;
|
||||
|
||||
if (wPreferences.new_style) {
|
||||
if (wPreferences.new_style == TS_NEW) {
|
||||
bsize = theight;
|
||||
} else {
|
||||
} else if (wPreferences.new_style == TS_OLD) {
|
||||
bsize = theight - 7;
|
||||
} else {
|
||||
bsize = theight - 8;
|
||||
}
|
||||
|
||||
if (fwin->titlebar) {
|
||||
@@ -141,7 +143,7 @@ void wFrameWindowUpdateBorders(WFrameWindow * fwin, int flags)
|
||||
|
||||
fwin->flags.need_texture_remake = 1;
|
||||
|
||||
if (wPreferences.new_style) {
|
||||
if (wPreferences.new_style == TS_NEW) {
|
||||
if (fwin->left_button) {
|
||||
wCoreConfigure(fwin->left_button, 0, 0, bsize, bsize);
|
||||
}
|
||||
@@ -180,7 +182,7 @@ void wFrameWindowUpdateBorders(WFrameWindow * fwin, int flags)
|
||||
/* we had a titlebar, but now we don't need it anymore */
|
||||
for (i = 0; i < (fwin->flags.single_texture ? 1 : 3); i++) {
|
||||
FREE_PIXMAP(fwin->title_back[i]);
|
||||
if (wPreferences.new_style) {
|
||||
if (wPreferences.new_style == TS_NEW) {
|
||||
FREE_PIXMAP(fwin->lbutton_back[i]);
|
||||
FREE_PIXMAP(fwin->rbutton_back[i]);
|
||||
#ifdef XKB_BUTTON_HINT
|
||||
@@ -218,14 +220,14 @@ void wFrameWindowUpdateBorders(WFrameWindow * fwin, int flags)
|
||||
|
||||
if (flags & WFF_LEFT_BUTTON) {
|
||||
fwin->flags.left_button = 1;
|
||||
if (wPreferences.new_style) {
|
||||
if (wPreferences.new_style == TS_NEW) {
|
||||
fwin->left_button = wCoreCreate(fwin->core, 0, 0, bsize, bsize);
|
||||
if (width < theight * 4) {
|
||||
fwin->flags.lbutton_dont_fit = 1;
|
||||
} else {
|
||||
XMapRaised(dpy, fwin->left_button->window);
|
||||
}
|
||||
} else {
|
||||
} else if (wPreferences.new_style == TS_OLD) {
|
||||
fwin->left_button =
|
||||
wCoreCreate(fwin->titlebar, 3, (theight - bsize) / 2, bsize, bsize);
|
||||
|
||||
@@ -237,12 +239,25 @@ void wFrameWindowUpdateBorders(WFrameWindow * fwin, int flags)
|
||||
} else {
|
||||
XMapRaised(dpy, fwin->left_button->window);
|
||||
}
|
||||
} else {
|
||||
fwin->left_button =
|
||||
wCoreCreate(fwin->titlebar, 3, (theight-bsize)/2,
|
||||
bsize, bsize);
|
||||
|
||||
XSetWindowBackground(dpy, fwin->left_button->window,
|
||||
scr->widget_texture->dark.pixel);
|
||||
|
||||
if (width < theight*3) {
|
||||
fwin->flags.lbutton_dont_fit = 1;
|
||||
} else {
|
||||
XMapRaised(dpy, fwin->left_button->window);
|
||||
}
|
||||
}
|
||||
}
|
||||
#ifdef XKB_BUTTON_HINT
|
||||
if (flags & WFF_LANGUAGE_BUTTON) {
|
||||
fwin->flags.language_button = 1;
|
||||
if (wPreferences.new_style) {
|
||||
if (wPreferences.new_style == TS_NEW) {
|
||||
fwin->language_button = wCoreCreate(fwin->core, bsize, 0, bsize, bsize);
|
||||
|
||||
if (width < theight * 4) {
|
||||
@@ -269,15 +284,21 @@ void wFrameWindowUpdateBorders(WFrameWindow * fwin, int flags)
|
||||
|
||||
if (flags & WFF_RIGHT_BUTTON) {
|
||||
fwin->flags.right_button = 1;
|
||||
if (wPreferences.new_style) {
|
||||
if (wPreferences.new_style == TS_NEW) {
|
||||
fwin->right_button =
|
||||
wCoreCreate(fwin->core, width - bsize + 1, 0, bsize, bsize);
|
||||
} else {
|
||||
} else if (wPreferences.new_style == TS_OLD) {
|
||||
fwin->right_button =
|
||||
wCoreCreate(fwin->titlebar, width - bsize - 3,
|
||||
(theight - bsize) / 2, bsize, bsize);
|
||||
XSetWindowBackground(dpy, fwin->right_button->window,
|
||||
scr->widget_texture->normal.pixel);
|
||||
} else {
|
||||
fwin->right_button =
|
||||
wCoreCreate(fwin->titlebar, width-bsize-3,
|
||||
(theight-bsize)/2, bsize, bsize);
|
||||
XSetWindowBackground(dpy, fwin->right_button->window,
|
||||
scr->widget_texture->dark.pixel);
|
||||
}
|
||||
|
||||
if (width < theight * 2) {
|
||||
@@ -287,7 +308,7 @@ void wFrameWindowUpdateBorders(WFrameWindow * fwin, int flags)
|
||||
}
|
||||
}
|
||||
|
||||
if (wPreferences.new_style)
|
||||
if (wPreferences.new_style == TS_NEW)
|
||||
updateTitlebar(fwin);
|
||||
|
||||
XMapRaised(dpy, fwin->titlebar->window);
|
||||
@@ -412,7 +433,7 @@ void wFrameWindowDestroy(WFrameWindow * fwin)
|
||||
|
||||
for (i = 0; i < (fwin->flags.single_texture ? 1 : 3); i++) {
|
||||
FREE_PIXMAP(fwin->title_back[i]);
|
||||
if (wPreferences.new_style) {
|
||||
if (wPreferences.new_style == TS_NEW) {
|
||||
FREE_PIXMAP(fwin->lbutton_back[i]);
|
||||
#ifdef XKB_BUTTON_HINT
|
||||
FREE_PIXMAP(fwin->languagebutton_back[i]);
|
||||
@@ -445,7 +466,7 @@ static void updateTitlebar(WFrameWindow * fwin)
|
||||
x = 0;
|
||||
w = fwin->core->width + 1;
|
||||
|
||||
if (wPreferences.new_style) {
|
||||
if (wPreferences.new_style == TS_NEW) {
|
||||
if (fwin->flags.hide_left_button || !fwin->left_button || fwin->flags.lbutton_dont_fit) {
|
||||
x = 0;
|
||||
#ifdef XKB_BUTTON_HINT
|
||||
@@ -487,13 +508,13 @@ static void updateTitlebar(WFrameWindow * fwin)
|
||||
}
|
||||
#endif
|
||||
|
||||
if (wPreferences.new_style) {
|
||||
if (wPreferences.new_style == TS_NEW) {
|
||||
if (!fwin->flags.hide_right_button && fwin->right_button && !fwin->flags.rbutton_dont_fit) {
|
||||
w -= fwin->right_button->width;
|
||||
}
|
||||
}
|
||||
|
||||
if (wPreferences.new_style || fwin->titlebar->width != w)
|
||||
if (wPreferences.new_style == TS_NEW || fwin->titlebar->width != w)
|
||||
fwin->flags.need_texture_remake = 1;
|
||||
|
||||
wCoreConfigure(fwin->titlebar, x, 0, w, theight);
|
||||
@@ -518,7 +539,7 @@ void wFrameWindowHideButton(WFrameWindow * fwin, int flags)
|
||||
#endif
|
||||
|
||||
if (fwin->titlebar) {
|
||||
if (wPreferences.new_style) {
|
||||
if (wPreferences.new_style == TS_NEW) {
|
||||
updateTitlebar(fwin);
|
||||
} else {
|
||||
#ifdef XKB_BUTTON_HINT
|
||||
@@ -560,7 +581,7 @@ void wFrameWindowShowButton(WFrameWindow * fwin, int flags)
|
||||
}
|
||||
|
||||
if (fwin->titlebar) {
|
||||
if (wPreferences.new_style) {
|
||||
if (wPreferences.new_style == TS_NEW) {
|
||||
updateTitlebar(fwin);
|
||||
} else {
|
||||
XClearWindow(dpy, fwin->titlebar->window);
|
||||
@@ -600,7 +621,7 @@ renderTexture(WScreen * scr, WTexture * texture, int width, int height,
|
||||
return;
|
||||
}
|
||||
|
||||
if (wPreferences.new_style) {
|
||||
if (wPreferences.new_style == TS_NEW) {
|
||||
if (left) {
|
||||
limg = RGetSubImage(img, 0, 0, bwidth, bheight);
|
||||
} else
|
||||
@@ -731,7 +752,7 @@ static void updateTexture(WFrameWindow * fwin)
|
||||
if (fwin->titlebar) {
|
||||
if (fwin->title_texture[i]->any.type != WTEX_SOLID) {
|
||||
XSetWindowBackgroundPixmap(dpy, fwin->titlebar->window, fwin->title_back[i]);
|
||||
if (wPreferences.new_style) {
|
||||
if (wPreferences.new_style == TS_NEW) {
|
||||
if (fwin->left_button && fwin->lbutton_back[i])
|
||||
XSetWindowBackgroundPixmap(dpy, fwin->left_button->window,
|
||||
fwin->lbutton_back[i]);
|
||||
@@ -750,7 +771,7 @@ static void updateTexture(WFrameWindow * fwin)
|
||||
} else {
|
||||
pixel = fwin->title_texture[i]->solid.normal.pixel;
|
||||
XSetWindowBackground(dpy, fwin->titlebar->window, pixel);
|
||||
if (wPreferences.new_style) {
|
||||
if (wPreferences.new_style == TS_NEW) {
|
||||
if (fwin->left_button)
|
||||
XSetWindowBackground(dpy, fwin->left_button->window, pixel);
|
||||
#ifdef XKB_BUTTON_HINT
|
||||
@@ -789,7 +810,7 @@ static void remakeTexture(WFrameWindow * fwin, int state)
|
||||
|
||||
if (fwin->title_texture[state] && fwin->titlebar) {
|
||||
FREE_PIXMAP(fwin->title_back[state]);
|
||||
if (wPreferences.new_style) {
|
||||
if (wPreferences.new_style == TS_NEW) {
|
||||
FREE_PIXMAP(fwin->lbutton_back[state]);
|
||||
FREE_PIXMAP(fwin->rbutton_back[state]);
|
||||
#ifdef XKB_BUTTON_HINT
|
||||
@@ -828,7 +849,7 @@ static void remakeTexture(WFrameWindow * fwin, int state)
|
||||
#endif
|
||||
|
||||
fwin->title_back[state] = pmap;
|
||||
if (wPreferences.new_style) {
|
||||
if (wPreferences.new_style == TS_NEW) {
|
||||
fwin->lbutton_back[state] = lpmap;
|
||||
fwin->rbutton_back[state] = rpmap;
|
||||
#ifdef XKB_BUTTON_HINT
|
||||
@@ -947,7 +968,7 @@ void wFrameWindowPaint(WFrameWindow * fwin)
|
||||
int titlelen;
|
||||
int allButtons = 1;
|
||||
|
||||
if (!wPreferences.new_style) {
|
||||
if (!wPreferences.new_style == TS_NEW) {
|
||||
if (fwin->left_button && !fwin->flags.hide_left_button && !fwin->flags.lbutton_dont_fit)
|
||||
lofs += fwin->left_button->width + 3;
|
||||
else
|
||||
@@ -1041,7 +1062,7 @@ void wFrameWindowPaint(WFrameWindow * fwin)
|
||||
|
||||
static void reconfigure(WFrameWindow * fwin, int x, int y, int width, int height, Bool dontMove)
|
||||
{
|
||||
int k = (wPreferences.new_style ? 4 : 3);
|
||||
int k = (wPreferences.new_style == TS_NEW ? 4 : 3);
|
||||
int resizedHorizontally = 0;
|
||||
|
||||
if (dontMove)
|
||||
@@ -1115,7 +1136,7 @@ static void reconfigure(WFrameWindow * fwin, int x, int y, int width, int height
|
||||
}
|
||||
}
|
||||
|
||||
if (wPreferences.new_style) {
|
||||
if (wPreferences.new_style == TS_NEW) {
|
||||
if (fwin->right_button)
|
||||
XMoveWindow(dpy, fwin->right_button->window,
|
||||
width - fwin->right_button->width + 1, 0);
|
||||
@@ -1217,7 +1238,7 @@ static void checkTitleSize(WFrameWindow * fwin)
|
||||
width = fwin->titlebar->width - 6 - 6;
|
||||
}
|
||||
|
||||
if (!wPreferences.new_style) {
|
||||
if (!wPreferences.new_style == TS_NEW) {
|
||||
if (fwin->left_button && !fwin->flags.hide_left_button && !fwin->flags.lbutton_dont_fit)
|
||||
width -= fwin->left_button->width + 3;
|
||||
|
||||
@@ -1257,16 +1278,24 @@ static void paintButton(WCoreWindow * button, WTexture * texture, unsigned long
|
||||
}
|
||||
}
|
||||
XSetClipMask(dpy, copy_gc, None);
|
||||
XSetForeground(dpy, copy_gc, scr->white_pixel);
|
||||
if (wPreferences.new_style == TS_NEXT) {
|
||||
XSetForeground(dpy, copy_gc, scr->black_pixel);
|
||||
} else {
|
||||
XSetForeground(dpy, copy_gc, scr->white_pixel);
|
||||
}
|
||||
d = 1;
|
||||
if (wPreferences.new_style) {
|
||||
if (wPreferences.new_style == TS_NEW) {
|
||||
XFillRectangle(dpy, button->window, copy_gc, 0, 0, button->width - 1, button->height - 1);
|
||||
XSetForeground(dpy, copy_gc, scr->black_pixel);
|
||||
XDrawRectangle(dpy, button->window, copy_gc, 0, 0, button->width - 1, button->height - 1);
|
||||
} else {
|
||||
} else if (wPreferences.new_style == TS_OLD) {
|
||||
XFillRectangle(dpy, button->window, copy_gc, 0, 0, button->width, button->height);
|
||||
XSetForeground(dpy, copy_gc, scr->black_pixel);
|
||||
XDrawRectangle(dpy, button->window, copy_gc, 0, 0, button->width, button->height);
|
||||
} else {
|
||||
XFillRectangle(dpy, button->window, copy_gc, 0, 0, button->width-3, button->height-3);
|
||||
XSetForeground(dpy, copy_gc, scr->black_pixel);
|
||||
XDrawRectangle(dpy, button->window, copy_gc, 0, 0, button->width-3, button->height-3);
|
||||
}
|
||||
} else {
|
||||
XClearWindow(dpy, button->window);
|
||||
@@ -1279,7 +1308,7 @@ static void paintButton(WCoreWindow * button, WTexture * texture, unsigned long
|
||||
}
|
||||
d = 0;
|
||||
|
||||
if (wPreferences.new_style) {
|
||||
if (wPreferences.new_style == TS_NEW) {
|
||||
if (texture->any.type == WTEX_SOLID || pushed) {
|
||||
wDrawBevel(button->window, button->width, button->height,
|
||||
(WTexSolid *) texture, WREL_RAISED);
|
||||
@@ -1296,7 +1325,7 @@ static void paintButton(WCoreWindow * button, WTexture * texture, unsigned long
|
||||
x = (button->width - width) / 2 + d;
|
||||
y = (button->height - image->height) / 2 + d;
|
||||
XSetClipOrigin(dpy, copy_gc, x - left, y);
|
||||
if (!wPreferences.new_style) {
|
||||
if (!wPreferences.new_style == TS_NEW) {
|
||||
XSetForeground(dpy, copy_gc, scr->black_pixel);
|
||||
if (!pushed) {
|
||||
if (image->depth == 1)
|
||||
@@ -1306,8 +1335,15 @@ static void paintButton(WCoreWindow * button, WTexture * texture, unsigned long
|
||||
XCopyArea(dpy, image->image, button->window, copy_gc,
|
||||
left, 0, width, image->height, x, y);
|
||||
} else {
|
||||
XSetForeground(dpy, copy_gc, scr->dark_pixel);
|
||||
XFillRectangle(dpy, button->window, copy_gc, 0, 0, button->width, button->height);
|
||||
if (wPreferences.new_style == TS_OLD) {
|
||||
XSetForeground(dpy, copy_gc, scr->dark_pixel);
|
||||
XFillRectangle(dpy, button->window, copy_gc, 0, 0,
|
||||
button->width, button->height);
|
||||
} else {
|
||||
XSetForeground(dpy, copy_gc, scr->black_pixel);
|
||||
XCopyArea(dpy, image->image, button->window, copy_gc,
|
||||
left, 0, width, image->height, x, y);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (pushed) {
|
||||
|
||||
@@ -491,7 +491,7 @@ void wMenuRealize(WMenu * menu)
|
||||
if (menu->flags.titled) {
|
||||
twidth = WMWidthOfString(scr->menu_title_font, menu->frame->title, strlen(menu->frame->title));
|
||||
theight = menu->frame->top_width;
|
||||
twidth += theight + (wPreferences.new_style ? 16 : 8);
|
||||
twidth += theight + (wPreferences.new_style == TS_NEW ? 16 : 8);
|
||||
} else {
|
||||
twidth = 0;
|
||||
theight = 0;
|
||||
|
||||
48
src/screen.c
48
src/screen.c
@@ -148,40 +148,72 @@ static void allocButtonPixmaps(WScreen * scr)
|
||||
WPixmap *pix;
|
||||
|
||||
/* create predefined pixmaps */
|
||||
pix = wPixmapCreateFromXPMData(scr, PRED_CLOSE_XPM);
|
||||
if (wPreferences.new_style == TS_NEXT) {
|
||||
pix = wPixmapCreateFromXPMData(scr, NEXT_CLOSE_XPM);
|
||||
} else {
|
||||
pix = wPixmapCreateFromXPMData(scr, PRED_CLOSE_XPM);
|
||||
}
|
||||
if (pix)
|
||||
pix->shared = 1;
|
||||
scr->b_pixmaps[WBUT_CLOSE] = pix;
|
||||
|
||||
pix = wPixmapCreateFromXPMData(scr, PRED_BROKEN_CLOSE_XPM);
|
||||
if (wPreferences.new_style == TS_NEXT) {
|
||||
pix = wPixmapCreateFromXPMData(scr, NEXT_BROKEN_CLOSE_XPM);
|
||||
} else {
|
||||
pix = wPixmapCreateFromXPMData(scr, PRED_BROKEN_CLOSE_XPM);
|
||||
}
|
||||
if (pix)
|
||||
pix->shared = 1;
|
||||
scr->b_pixmaps[WBUT_BROKENCLOSE] = pix;
|
||||
|
||||
pix = wPixmapCreateFromXPMData(scr, PRED_ICONIFY_XPM);
|
||||
if (wPreferences.new_style == TS_NEXT) {
|
||||
pix = wPixmapCreateFromXPMData(scr, NEXT_ICONIFY_XPM);
|
||||
} else {
|
||||
pix = wPixmapCreateFromXPMData(scr, PRED_ICONIFY_XPM);
|
||||
}
|
||||
if (pix)
|
||||
pix->shared = 1;
|
||||
scr->b_pixmaps[WBUT_ICONIFY] = pix;
|
||||
#ifdef XKB_BUTTON_HINT
|
||||
pix = wPixmapCreateFromXPMData(scr, PRED_XKBGROUP1_XPM);
|
||||
if (wPreferences.new_style == TS_NEXT) {
|
||||
pix = wPixmapCreateFromXPMData(scr, NEXT_XKBGROUP1_XPM);
|
||||
} else {
|
||||
pix = wPixmapCreateFromXPMData(scr, PRED_XKBGROUP1_XPM);
|
||||
}
|
||||
if (pix)
|
||||
pix->shared = 1;
|
||||
scr->b_pixmaps[WBUT_XKBGROUP1] = pix;
|
||||
pix = wPixmapCreateFromXPMData(scr, PRED_XKBGROUP2_XPM);
|
||||
if (wPreferences.new_style == TS_NEXT) {
|
||||
pix = wPixmapCreateFromXPMData(scr, NEXT_XKBGROUP2_XPM);
|
||||
} else {
|
||||
pix = wPixmapCreateFromXPMData(scr, PRED_XKBGROUP2_XPM);
|
||||
}
|
||||
if (pix)
|
||||
pix->shared = 1;
|
||||
scr->b_pixmaps[WBUT_XKBGROUP2] = pix;
|
||||
pix = wPixmapCreateFromXPMData(scr, PRED_XKBGROUP3_XPM);
|
||||
if (wPreferences.new_style == TS_NEXT) {
|
||||
pix = wPixmapCreateFromXPMData(scr, NEXT_XKBGROUP3_XPM);
|
||||
} else {
|
||||
pix = wPixmapCreateFromXPMData(scr, PRED_XKBGROUP3_XPM);
|
||||
}
|
||||
if (pix)
|
||||
pix->shared = 1;
|
||||
scr->b_pixmaps[WBUT_XKBGROUP3] = pix;
|
||||
pix = wPixmapCreateFromXPMData(scr, PRED_XKBGROUP4_XPM);
|
||||
if (wPreferences.new_style == TS_NEXT) {
|
||||
pix = wPixmapCreateFromXPMData(scr, NEXT_XKBGROUP4_XPM);
|
||||
} else {
|
||||
pix = wPixmapCreateFromXPMData(scr, PRED_XKBGROUP4_XPM);
|
||||
}
|
||||
if (pix)
|
||||
pix->shared = 1;
|
||||
scr->b_pixmaps[WBUT_XKBGROUP4] = pix;
|
||||
#endif
|
||||
|
||||
pix = wPixmapCreateFromXPMData(scr, PRED_KILL_XPM);
|
||||
if (wPreferences.new_style == TS_NEXT) {
|
||||
pix = wPixmapCreateFromXPMData(scr, NEXT_KILL_XPM);
|
||||
} else {
|
||||
pix = wPixmapCreateFromXPMData(scr, PRED_KILL_XPM);
|
||||
}
|
||||
if (pix)
|
||||
pix->shared = 1;
|
||||
scr->b_pixmaps[WBUT_KILL] = pix;
|
||||
|
||||
@@ -553,20 +553,32 @@ void wDrawBevel(Drawable d, unsigned width, unsigned height, WTexSolid * texture
|
||||
segs[1].y1 = 1;
|
||||
segs[1].x2 = width - 2;
|
||||
segs[1].y2 = height - 2;
|
||||
XDrawSegments(dpy, d, dim, segs, 2);
|
||||
if (wPreferences.new_style == TS_NEXT) {
|
||||
XDrawSegments(dpy, d, dark, segs, 2);
|
||||
} else {
|
||||
XDrawSegments(dpy, d, dim, segs, 2);
|
||||
}
|
||||
segs[0].x1 = 0;
|
||||
segs[0].x2 = width - 1;
|
||||
segs[0].y2 = segs[0].y1 = height - 1;
|
||||
segs[1].x1 = segs[1].x2 = width - 1;
|
||||
segs[1].y1 = 0;
|
||||
segs[1].y2 = height - 1;
|
||||
XDrawSegments(dpy, d, dark, segs, 2);
|
||||
if (wPreferences.new_style == TS_NEXT) {
|
||||
XDrawSegments(dpy, d, light, segs, 2);
|
||||
} else {
|
||||
XDrawSegments(dpy, d, dark, segs, 2);
|
||||
}
|
||||
segs[0].x1 = segs[0].y1 = segs[0].y2 = 0;
|
||||
segs[0].x2 = width - 2;
|
||||
segs[1].x1 = segs[1].y1 = 0;
|
||||
segs[1].x2 = 0;
|
||||
segs[1].y2 = height - 2;
|
||||
XDrawSegments(dpy, d, light, segs, 2);
|
||||
if (wPreferences.new_style == TS_NEXT) {
|
||||
XDrawSegments(dpy, d, dark, segs, 2);
|
||||
} else {
|
||||
XDrawSegments(dpy, d, light, segs, 2);
|
||||
}
|
||||
if (relief == WREL_ICON) {
|
||||
segs[0].x1 = segs[0].y1 = segs[0].y2 = 1;
|
||||
segs[0].x2 = width - 2;
|
||||
|
||||
Reference in New Issue
Block a user