updated on Thu Jan 12 08:01:00 UTC 2012
[aur-mirror.git] / fvwm+ / 13-FvwmIconMan.patch
blobbfb606b5e013a8505047b741da86be04acb6439c
1 Seulement dans modules/FvwmButtons: FvwmButtons.c.orig
2 Seulement dans modules/FvwmButtons: FvwmButtons.h.orig
3 Seulement dans modules/FvwmButtons: parse.c.orig
4 diff -U3 -r modules/FvwmIconMan/FvwmIconMan.h modules/FvwmIconMan/FvwmIconMan.h
5 --- modules/FvwmIconMan/FvwmIconMan.h 2010-08-07 00:35:19.000000000 +0200
6 +++ modules/FvwmIconMan/FvwmIconMan.h 2011-12-09 21:47:16.017350293 +0100
7 @@ -316,6 +316,8 @@
8 char *tips_fontname;
9 char *tips_formatstring;
10 ftips_config *tips_conf;
11 + Uchar roundedcorners;
12 + int padding;
14 /* X11 state */
15 Window theWindow, theFrame;
16 diff -U3 -r modules/FvwmIconMan/readconfig.c modules/FvwmIconMan/readconfig.c
17 --- modules/FvwmIconMan/readconfig.c 2011-08-07 00:03:32.000000000 +0200
18 +++ modules/FvwmIconMan/readconfig.c 2011-12-09 21:47:16.014017045 +0100
19 @@ -2021,6 +2021,40 @@
21 SET_MANAGER(manager, relief_thickness, n);
23 + else if (!strcasecmp(option1, "padding")) {
24 + p = read_next_cmd(READ_ARG);
25 + if (!p) {
26 + ConsoleMessage("Bad line: %s\n", current_line);
27 + continue;
28 + }
29 + if (extract_int(p, &n) == 0) {
30 + ConsoleMessage("This is not a number: %s\n", p);
31 + ConsoleMessage("Bad line: %s\n", current_line);
32 + continue;
33 + }
34 + SET_MANAGER(manager, padding, n);
35 + }
36 + else if (!strcasecmp(option1, "roundedcorners")) {
37 + p = read_next_cmd(READ_ARG);
38 + if (!p) {
39 + ConsoleMessage("Bad line: %s\n", current_line);
40 + ConsoleMessage("Need argument to roundedcorners\n");
41 + continue;
42 + }
43 + if (!strcasecmp(p, "true")) {
44 + i = 1;
45 + }
46 + else if (!strcasecmp(p, "false")) {
47 + i = 0;
48 + }
49 + else {
50 + ConsoleMessage("Bad line: %s\n", current_line);
51 + ConsoleMessage("What is this: %s?\n", p);
52 + continue;
53 + }
54 + ConsoleDebug(CONFIG, "Setting roundedcorners to: %d\n", i);
55 + SET_MANAGER(manager, roundedcorners, i);
56 + }
57 else if (!strcasecmp(option1, "tips")) {
58 p = read_next_cmd(READ_ARG);
59 if (!p) {
60 diff -U3 -r modules/FvwmIconMan/xmanager.c modules/FvwmIconMan/xmanager.c
61 --- modules/FvwmIconMan/xmanager.c 2011-04-15 13:57:02.000000000 +0200
62 +++ modules/FvwmIconMan/xmanager.c 2011-12-09 21:47:16.014017045 +0100
63 @@ -1365,6 +1365,8 @@
65 g->text_y = g->button_y + text_pad;
66 g->text_base = g->text_y + man->FButtonFont->ascent;
68 + g->button_w -= man->padding;
71 static void draw_button_background(
72 @@ -1637,6 +1639,33 @@
76 +static void __draw_rounded_corner(WinManager *man, ButtonGeometry *g,
77 + int x, int y, int width, int height, GC gc)
79 + int x1 = g->button_x + x;
80 + int x2 = g->button_x + g->button_w - x - width;
81 + int y1 = g->button_y + y;
82 + int y2 = g->button_y + g->button_h - y - height;
84 + XFillRectangle(theDisplay, man->theWindow, gc, x1, y1, width, height);
85 + XFillRectangle(theDisplay, man->theWindow, gc, x2, y1, width, height);
86 + XFillRectangle(theDisplay, man->theWindow, gc, x1, y2, width, height);
87 + XFillRectangle(theDisplay, man->theWindow, gc, x2, y2, width, height);
90 +static void draw_rounded_corners(WinManager *man, ButtonGeometry *g, GC gc)
92 + if (man->roundedcorners)
93 + {
94 + __draw_rounded_corner(man, g, 0, 0, 2, 1, man->backContext[TITLE_CONTEXT]);
95 + __draw_rounded_corner(man, g, 0, 1, 1, 1, man->backContext[TITLE_CONTEXT]);
96 + __draw_rounded_corner(man, g, 1, 1, 1, 1, gc);
97 + }
99 + XFillRectangle(theDisplay, man->theWindow, man->backContext[TITLE_CONTEXT],
100 + g->button_x + g->button_w, g->button_y, man->padding, g->button_h);
103 static void draw_button(WinManager *man, int button, int force)
105 Button *b;
106 @@ -1825,6 +1854,8 @@
107 draw_relief(
108 man, button_state, &g, context1,
109 context2);
111 + draw_rounded_corners(man, &g, context1);
113 else if (button_state & SELECT_CONTEXT)