summaryrefslogtreecommitdiff
path: root/openbox
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2007-03-05 15:44:17 +0000
committerDana Jansens <danakj@orodu.net>2007-03-05 15:44:17 +0000
commitec304c9e433e4b1cedf924ca64d783f05db7d42d (patch)
treee5926bc65f538b18c269867b53496bcccf9511d1 /openbox
parentd209d828a7aceea9da59da980cd57f50757f3a29 (diff)
scary commit..but here goes.
YOUR THEMES ARE NOW OFFICIALLY BROKEN. Openbox has just moved it's theme format to an XML based one. The details of this format can be found in data/themerc.xsd (and http://openbox.org/themerc.xsd ALSO! This is very good and important and stuff! In the tools directory you will find THEMETOXML ! This tool takes a themerc on stdin, and spits out the same theme in theme.xml format. So this is all you need to do to update your themes. PLEASE NOTE: This themetoxml does _not_ install itself anywhere. It simply builds and then lives out in its tools/themetoxml directory, and that's it. So if you want to use it, that is where to find it. In moving to the new XML format, a number of additions/changes to the theme engine have been made. Themetoxml takes these into account and will set all the new things appropriately to make your theme look the same as it always has. New additions include.. * padding now has an horizontal and vertical component, instead of being one number * menus can have different borders than windows (color and size) * menu offset can now be negative. it's a little weird, but someone will want it no doubt * fonts are no longer controled by the theme at all, however font shadowing is, and on that note.. * font shadows are now any color you want, not just black and white * you can now set the shadow anywhere you can set the text's color, so you have more control, i.e. you can set shadow on active menu items but not inactive, or disabled, etc. * every color now has an alpha channel. at the moment they don't do anything, besides the font shadow one, but it leaves room for future explorations. it is REALLY HIGHLY RECOMMENDED that you set the alpha to 255 all the time, until such time as it could be useful. otherwise one day your theme may turn awful for people. * font colors are in the range 0-255, in case you were wondering, and they have to be specified in decimal * if you'd like to change you font's you can do so in your configuration file. this is how it is going to stay. changing the font in the theme assumes too much about peoples eye sight and locality and stuff. it doesn't belong there, sorry. the system-wide default rc.xml includes the new font settings for your viewing pleasure, and ill drop an example of it below. * shadows can now be positioned in any direction, they have both an x and a y offset which can be negative and positive. and offset of 0,0 will disable the shadow This isn't a release or anything. If someone had some good ideas about the xml theme format, I'd like to hear them. But I don't think it will be changing much right now beyond where it is. I don't even know how the new functionality will play out for themers, so we'll see. Whew.. I guess that's it. I'm not sure if I mentioned every little change or not, but oh well. Mileage may vary.. Please send any feedback. Here's the font configuration example. Hopefully ObConf will let you set this real soon. <theme> ... <font place="ActiveWindow"> <name>arial,sans</name> <size>7</size> <weight>bold</weight> <slant>normal</slant> </font> <font place="InactiveWindow"> <name>arial,sans</name> <size>7</size> <weight>bold</weight> <slant>normal</slant> </font> <font place="MenuTitle"> <name>arial,sans</name> <size>8</size> <weight>bold</weight> <slant>normal</slant> </font> <font place="MenuItem"> <name>arial,sans</name> <size>8</size> <weight>bold</weight> <slant>normal</slant> </font> </theme>
Diffstat (limited to 'openbox')
-rw-r--r--openbox/dock.c48
-rw-r--r--openbox/event.c4
-rw-r--r--openbox/focus.c2
-rw-r--r--openbox/frame.c89
-rw-r--r--openbox/framerender.c23
-rw-r--r--openbox/menu.c2
-rw-r--r--openbox/menuframe.c28
-rw-r--r--openbox/popup.c63
8 files changed, 129 insertions, 130 deletions
diff --git a/openbox/dock.c b/openbox/dock.c
index eceb3b99..53c79139 100644
--- a/openbox/dock.c
+++ b/openbox/dock.c
@@ -57,8 +57,8 @@ void dock_startup(gboolean reconfig)
GList *it;
XSetWindowBorder(ob_display, dock->frame,
- RrColorPixel(ob_rr_theme->b_color));
- XSetWindowBorderWidth(ob_display, dock->frame, ob_rr_theme->bwidth);
+ RrColorPixel(ob_rr_theme->frame_b_color));
+ XSetWindowBorderWidth(ob_display, dock->frame, ob_rr_theme->fbwidth);
RrAppearanceFree(dock->a_frame);
dock->a_frame = RrAppearanceCopy(ob_rr_theme->a_focused_title);
@@ -91,8 +91,8 @@ void dock_startup(gboolean reconfig)
&attrib);
dock->a_frame = RrAppearanceCopy(ob_rr_theme->a_focused_title);
XSetWindowBorder(ob_display, dock->frame,
- RrColorPixel(ob_rr_theme->b_color));
- XSetWindowBorderWidth(ob_display, dock->frame, ob_rr_theme->bwidth);
+ RrColorPixel(ob_rr_theme->frame_b_color));
+ XSetWindowBorderWidth(ob_display, dock->frame, ob_rr_theme->fbwidth);
g_hash_table_insert(window_map, &dock->frame, dock);
stacking_add(DOCK_AS_WINDOW(dock));
@@ -261,8 +261,8 @@ void dock_configure()
}
/* used for calculating offsets */
- dock->w += ob_rr_theme->bwidth * 2;
- dock->h += ob_rr_theme->bwidth * 2;
+ dock->w += ob_rr_theme->fbwidth * 2;
+ dock->h += ob_rr_theme->fbwidth * 2;
a = screen_physical_area();
@@ -349,51 +349,51 @@ void dock_configure()
case OB_DIRECTION_NORTHWEST:
switch (config_dock_orient) {
case OB_ORIENTATION_HORZ:
- dock->y -= dock->h - ob_rr_theme->bwidth;
+ dock->y -= dock->h - ob_rr_theme->fbwidth;
break;
case OB_ORIENTATION_VERT:
- dock->x -= dock->w - ob_rr_theme->bwidth;
+ dock->x -= dock->w - ob_rr_theme->fbwidth;
break;
}
break;
case OB_DIRECTION_NORTH:
- dock->y -= dock->h - ob_rr_theme->bwidth;
+ dock->y -= dock->h - ob_rr_theme->fbwidth;
break;
case OB_DIRECTION_NORTHEAST:
switch (config_dock_orient) {
case OB_ORIENTATION_HORZ:
- dock->y -= dock->h - ob_rr_theme->bwidth;
+ dock->y -= dock->h - ob_rr_theme->fbwidth;
break;
case OB_ORIENTATION_VERT:
- dock->x += dock->w - ob_rr_theme->bwidth;
+ dock->x += dock->w - ob_rr_theme->fbwidth;
break;
}
break;
case OB_DIRECTION_WEST:
- dock->x -= dock->w - ob_rr_theme->bwidth;
+ dock->x -= dock->w - ob_rr_theme->fbwidth;
break;
case OB_DIRECTION_EAST:
- dock->x += dock->w - ob_rr_theme->bwidth;
+ dock->x += dock->w - ob_rr_theme->fbwidth;
break;
case OB_DIRECTION_SOUTHWEST:
switch (config_dock_orient) {
case OB_ORIENTATION_HORZ:
- dock->y += dock->h - ob_rr_theme->bwidth;
+ dock->y += dock->h - ob_rr_theme->fbwidth;
break;
case OB_ORIENTATION_VERT:
- dock->x -= dock->w - ob_rr_theme->bwidth;
+ dock->x -= dock->w - ob_rr_theme->fbwidth;
break;
} break;
case OB_DIRECTION_SOUTH:
- dock->y += dock->h - ob_rr_theme->bwidth;
+ dock->y += dock->h - ob_rr_theme->fbwidth;
break;
case OB_DIRECTION_SOUTHEAST:
switch (config_dock_orient) {
case OB_ORIENTATION_HORZ:
- dock->y += dock->h - ob_rr_theme->bwidth;
+ dock->y += dock->h - ob_rr_theme->fbwidth;
break;
case OB_ORIENTATION_VERT:
- dock->x += dock->w - ob_rr_theme->bwidth;
+ dock->x += dock->w - ob_rr_theme->fbwidth;
break;
}
break;
@@ -402,8 +402,8 @@ void dock_configure()
}
if (!config_dock_floating && config_dock_hide) {
- strw = ob_rr_theme->bwidth;
- strh = ob_rr_theme->bwidth;
+ strw = ob_rr_theme->fbwidth;
+ strh = ob_rr_theme->fbwidth;
} else {
strw = dock->w;
strh = dock->h;
@@ -501,8 +501,8 @@ void dock_configure()
dock->h += minh;
/* not used for actually sizing shit */
- dock->w -= ob_rr_theme->bwidth * 2;
- dock->h -= ob_rr_theme->bwidth * 2;
+ dock->w -= ob_rr_theme->fbwidth * 2;
+ dock->h -= ob_rr_theme->fbwidth * 2;
if (dock->dock_apps) {
g_assert(dock->w > 0);
@@ -517,8 +517,8 @@ void dock_configure()
XUnmapWindow(ob_display, dock->frame);
/* but they are useful outside of this function! */
- dock->w += ob_rr_theme->bwidth * 2;
- dock->h += ob_rr_theme->bwidth * 2;
+ dock->w += ob_rr_theme->fbwidth * 2;
+ dock->h += ob_rr_theme->fbwidth * 2;
screen_update_areas();
}
diff --git a/openbox/event.c b/openbox/event.c
index b978f563..6314c9f7 100644
--- a/openbox/event.c
+++ b/openbox/event.c
@@ -597,9 +597,9 @@ static void event_handle_root(XEvent *e)
} else if (msgtype == prop_atoms.net_showing_desktop) {
screen_show_desktop(e->xclient.data.l[0] != 0);
} else if (msgtype == prop_atoms.ob_control) {
- if ((Atom)e->xclient.data.l[0] == 1)
+ if (e->xclient.data.l[0] == 1)
ob_reconfigure();
- else if ((Atom)e->xclient.data.l[0] == 2)
+ else if (e->xclient.data.l[0] == 2)
ob_restart();
}
break;
diff --git a/openbox/focus.c b/openbox/focus.c
index edd26b69..f867ff16 100644
--- a/openbox/focus.c
+++ b/openbox/focus.c
@@ -392,7 +392,7 @@ void focus_cycle_draw_indicator()
wt = wl = wr = wb = MAX(3,
ob_rr_theme->handle_height +
- ob_rr_theme->bwidth * 2);
+ ob_rr_theme->fbwidth * 2);
x = focus_cycle_target->frame->area.x;
y = focus_cycle_target->frame->area.y;
diff --git a/openbox/frame.c b/openbox/frame.c
index 57a1b8ab..b92c3f12 100644
--- a/openbox/frame.c
+++ b/openbox/frame.c
@@ -159,15 +159,15 @@ static void set_theme_statics(ObFrame *self)
{
/* set colors/appearance/sizes for stuff that doesn't change */
XSetWindowBorder(ob_display, self->window,
- RrColorPixel(ob_rr_theme->b_color));
+ RrColorPixel(ob_rr_theme->frame_b_color));
XSetWindowBorder(ob_display, self->title,
- RrColorPixel(ob_rr_theme->b_color));
+ RrColorPixel(ob_rr_theme->frame_b_color));
XSetWindowBorder(ob_display, self->handle,
- RrColorPixel(ob_rr_theme->b_color));
+ RrColorPixel(ob_rr_theme->frame_b_color));
XSetWindowBorder(ob_display, self->rgrip,
- RrColorPixel(ob_rr_theme->b_color));
+ RrColorPixel(ob_rr_theme->frame_b_color));
XSetWindowBorder(ob_display, self->lgrip,
- RrColorPixel(ob_rr_theme->b_color));
+ RrColorPixel(ob_rr_theme->frame_b_color));
XResizeWindow(ob_display, self->max,
ob_rr_theme->button_size, ob_rr_theme->button_size);
@@ -181,14 +181,16 @@ static void set_theme_statics(ObFrame *self)
ob_rr_theme->button_size, ob_rr_theme->button_size);
XResizeWindow(ob_display, self->shade,
ob_rr_theme->button_size, ob_rr_theme->button_size);
- XResizeWindow(ob_display, self->lgrip,
- ob_rr_theme->grip_width, ob_rr_theme->handle_height);
- XResizeWindow(ob_display, self->rgrip,
- ob_rr_theme->grip_width, ob_rr_theme->handle_height);
+ if (ob_rr_theme->handle_height > 0) {
+ XResizeWindow(ob_display, self->lgrip,
+ ob_rr_theme->grip_width, ob_rr_theme->handle_height);
+ XResizeWindow(ob_display, self->rgrip,
+ ob_rr_theme->grip_width, ob_rr_theme->handle_height);
+ }
XResizeWindow(ob_display, self->tlresize,
- ob_rr_theme->grip_width, ob_rr_theme->handle_height);
+ ob_rr_theme->grip_width, ob_rr_theme->top_grip_height);
XResizeWindow(ob_display, self->trresize,
- ob_rr_theme->grip_width, ob_rr_theme->handle_height);
+ ob_rr_theme->grip_width, ob_rr_theme->top_grip_height);
/* set up the dynamic appearances */
self->a_unfocused_title = RrAppearanceCopy(ob_rr_theme->a_unfocused_title);
@@ -272,8 +274,8 @@ void frame_adjust_shape(ObFrame *self)
num = 0;
if (self->decorations & OB_FRAME_DECOR_TITLEBAR) {
- xrect[0].x = -ob_rr_theme->bwidth;
- xrect[0].y = -ob_rr_theme->bwidth;
+ xrect[0].x = -ob_rr_theme->fbwidth;
+ xrect[0].y = -ob_rr_theme->fbwidth;
xrect[0].width = self->width + self->rbwidth * 2;
xrect[0].height = ob_rr_theme->title_height +
self->bwidth * 2;
@@ -281,7 +283,7 @@ void frame_adjust_shape(ObFrame *self)
}
if (self->decorations & OB_FRAME_DECOR_HANDLE) {
- xrect[1].x = -ob_rr_theme->bwidth;
+ xrect[1].x = -ob_rr_theme->fbwidth;
xrect[1].y = FRAME_HANDLE_Y(self);
xrect[1].width = self->width + self->rbwidth * 2;
xrect[1].height = ob_rr_theme->handle_height +
@@ -308,8 +310,9 @@ void frame_adjust_area(ObFrame *self, gboolean moved,
self->max_horz = self->client->max_horz;
if (self->decorations & OB_FRAME_DECOR_BORDER) {
- self->bwidth = ob_rr_theme->bwidth;
- self->cbwidth_x = self->cbwidth_y = ob_rr_theme->cbwidth;
+ self->bwidth = ob_rr_theme->fbwidth;
+ self->cbwidth_x = ob_rr_theme->cbwidthx;
+ self->cbwidth_y = ob_rr_theme->cbwidthy;
} else {
self->bwidth = self->cbwidth_x = self->cbwidth_y = 0;
}
@@ -340,7 +343,7 @@ void frame_adjust_area(ObFrame *self, gboolean moved,
self->innersize.top += ob_rr_theme->title_height + self->rbwidth +
(self->rbwidth - self->bwidth);
if (self->decorations & OB_FRAME_DECOR_HANDLE &&
- ob_rr_theme->show_handle)
+ ob_rr_theme->handle_height > 0)
self->innersize.bottom += ob_rr_theme->handle_height +
self->rbwidth + (self->rbwidth - self->bwidth);
@@ -382,7 +385,7 @@ void frame_adjust_area(ObFrame *self, gboolean moved,
if (!fake) {
if (self->decorations & OB_FRAME_DECOR_HANDLE &&
- ob_rr_theme->show_handle)
+ ob_rr_theme->handle_height > 0)
{
XMoveResizeWindow(ob_display, self->handle,
-self->bwidth, FRAME_HANDLE_Y(self),
@@ -401,12 +404,6 @@ void frame_adjust_area(ObFrame *self, gboolean moved,
XUnmapWindow(ob_display, self->lgrip);
XUnmapWindow(ob_display, self->rgrip);
}
-
- /* XXX make a subwindow with these dimentions?
- ob_rr_theme->grip_width + self->bwidth, 0,
- self->width - (ob_rr_theme->grip_width + self->bwidth) * 2,
- ob_rr_theme->handle_height);
- */
} else
XUnmapWindow(ob_display, self->handle);
@@ -608,14 +605,14 @@ static void layout_title(ObFrame *self)
n = d = i = l = m = c = s = FALSE;
/* figure out whats being shown, and the width of the label */
- self->label_width = self->width - (ob_rr_theme->padding + 1) * 2;
+ self->label_width = self->width - (ob_rr_theme->paddingx + 1) * 2;
for (lc = config_title_layout; *lc != '\0'; ++lc) {
switch (*lc) {
case 'N':
if (n) { *lc = ' '; break; } /* rm duplicates */
n = TRUE;
self->label_width -= (ob_rr_theme->button_size + 2 +
- ob_rr_theme->padding + 1);
+ ob_rr_theme->paddingx + 1);
break;
case 'D':
if (d) { *lc = ' '; break; }
@@ -624,7 +621,7 @@ static void layout_title(ObFrame *self)
break;
d = TRUE;
self->label_width -= (ob_rr_theme->button_size +
- ob_rr_theme->padding + 1);
+ ob_rr_theme->paddingx + 1);
break;
case 'S':
if (s) { *lc = ' '; break; }
@@ -633,7 +630,7 @@ static void layout_title(ObFrame *self)
break;
s = TRUE;
self->label_width -= (ob_rr_theme->button_size +
- ob_rr_theme->padding + 1);
+ ob_rr_theme->paddingx + 1);
break;
case 'I':
if (i) { *lc = ' '; break; }
@@ -642,7 +639,7 @@ static void layout_title(ObFrame *self)
break;
i = TRUE;
self->label_width -= (ob_rr_theme->button_size +
- ob_rr_theme->padding + 1);
+ ob_rr_theme->paddingx + 1);
break;
case 'L':
if (l) { *lc = ' '; break; }
@@ -655,7 +652,7 @@ static void layout_title(ObFrame *self)
break;
m = TRUE;
self->label_width -= (ob_rr_theme->button_size +
- ob_rr_theme->padding + 1);
+ ob_rr_theme->paddingx + 1);
break;
case 'C':
if (c) { *lc = ' '; break; }
@@ -664,7 +661,7 @@ static void layout_title(ObFrame *self)
break;
c = TRUE;
self->label_width -= (ob_rr_theme->button_size +
- ob_rr_theme->padding + 1);
+ ob_rr_theme->paddingx + 1);
break;
}
}
@@ -678,57 +675,57 @@ static void layout_title(ObFrame *self)
if (!m) XUnmapWindow(ob_display, self->max);
if (!c) XUnmapWindow(ob_display, self->close);
- x = ob_rr_theme->padding + 1;
+ x = ob_rr_theme->paddingx + 1;
for (lc = config_title_layout; *lc != '\0'; ++lc) {
switch (*lc) {
case 'N':
if (!n) break;
self->icon_x = x;
XMapWindow(ob_display, self->icon);
- XMoveWindow(ob_display, self->icon, x, ob_rr_theme->padding);
- x += ob_rr_theme->button_size + 2 + ob_rr_theme->padding + 1;
+ XMoveWindow(ob_display, self->icon, x, ob_rr_theme->paddingx);
+ x += ob_rr_theme->button_size + 2 + ob_rr_theme->paddingx + 1;
break;
case 'D':
if (!d) break;
self->desk_x = x;
XMapWindow(ob_display, self->desk);
- XMoveWindow(ob_display, self->desk, x, ob_rr_theme->padding + 1);
- x += ob_rr_theme->button_size + ob_rr_theme->padding + 1;
+ XMoveWindow(ob_display, self->desk, x, ob_rr_theme->paddingx + 1);
+ x += ob_rr_theme->button_size + ob_rr_theme->paddingx + 1;
break;
case 'S':
if (!s) break;
self->shade_x = x;
XMapWindow(ob_display, self->shade);
- XMoveWindow(ob_display, self->shade, x, ob_rr_theme->padding + 1);
- x += ob_rr_theme->button_size + ob_rr_theme->padding + 1;
+ XMoveWindow(ob_display, self->shade, x, ob_rr_theme->paddingx + 1);
+ x += ob_rr_theme->button_size + ob_rr_theme->paddingx + 1;
break;
case 'I':
if (!i) break;
self->iconify_x = x;
XMapWindow(ob_display, self->iconify);
- XMoveWindow(ob_display,self->iconify, x, ob_rr_theme->padding + 1);
- x += ob_rr_theme->button_size + ob_rr_theme->padding + 1;
+ XMoveWindow(ob_display,self->iconify, x, ob_rr_theme->paddingx + 1);
+ x += ob_rr_theme->button_size + ob_rr_theme->paddingx + 1;
break;
case 'L':
if (!l) break;
self->label_x = x;
XMapWindow(ob_display, self->label);
- XMoveWindow(ob_display, self->label, x, ob_rr_theme->padding);
- x += self->label_width + ob_rr_theme->padding + 1;
+ XMoveWindow(ob_display, self->label, x, ob_rr_theme->paddingx);
+ x += self->label_width + ob_rr_theme->paddingx + 1;
break;
case 'M':
if (!m) break;
self->max_x = x;
XMapWindow(ob_display, self->max);
- XMoveWindow(ob_display, self->max, x, ob_rr_theme->padding + 1);
- x += ob_rr_theme->button_size + ob_rr_theme->padding + 1;
+ XMoveWindow(ob_display, self->max, x, ob_rr_theme->paddingx + 1);
+ x += ob_rr_theme->button_size + ob_rr_theme->paddingx + 1;
break;
case 'C':
if (!c) break;
self->close_x = x;
XMapWindow(ob_display, self->close);
- XMoveWindow(ob_display, self->close, x, ob_rr_theme->padding + 1);
- x += ob_rr_theme->button_size + ob_rr_theme->padding + 1;
+ XMoveWindow(ob_display, self->close, x, ob_rr_theme->paddingx + 1);
+ x += ob_rr_theme->button_size + ob_rr_theme->paddingx + 1;
break;
}
}
diff --git a/openbox/framerender.c b/openbox/framerender.c
index 464e1c6b..2195ff74 100644
--- a/openbox/framerender.c
+++ b/openbox/framerender.c
@@ -147,43 +147,42 @@ void framerender_frame(ObFrame *self)
ob_rr_theme->a_clear->surface.parenty = 0;
RrPaint(ob_rr_theme->a_clear, self->tlresize,
- ob_rr_theme->grip_width, ob_rr_theme->handle_height);
+ ob_rr_theme->grip_width, ob_rr_theme->top_grip_height);
ob_rr_theme->a_clear->surface.parentx =
self->width - ob_rr_theme->grip_width;
RrPaint(ob_rr_theme->a_clear, self->trresize,
- ob_rr_theme->grip_width, ob_rr_theme->handle_height);
-
+ ob_rr_theme->grip_width, ob_rr_theme->top_grip_height);
/* set parents for any parent relative guys */
l->surface.parent = t;
l->surface.parentx = self->label_x;
- l->surface.parenty = ob_rr_theme->padding;
+ l->surface.parenty = ob_rr_theme->paddingy;
m->surface.parent = t;
m->surface.parentx = self->max_x;
- m->surface.parenty = ob_rr_theme->padding + 1;
+ m->surface.parenty = ob_rr_theme->paddingy + 1;
n->surface.parent = t;
n->surface.parentx = self->icon_x;
- n->surface.parenty = ob_rr_theme->padding;
+ n->surface.parenty = ob_rr_theme->paddingy;
i->surface.parent = t;
i->surface.parentx = self->iconify_x;
- i->surface.parenty = ob_rr_theme->padding + 1;
+ i->surface.parenty = ob_rr_theme->paddingy + 1;
d->surface.parent = t;
d->surface.parentx = self->desk_x;
- d->surface.parenty = ob_rr_theme->padding + 1;
+ d->surface.parenty = ob_rr_theme->paddingy + 1;
s->surface.parent = t;
s->surface.parentx = self->shade_x;
- s->surface.parenty = ob_rr_theme->padding + 1;
+ s->surface.parenty = ob_rr_theme->paddingy + 1;
c->surface.parent = t;
c->surface.parentx = self->close_x;
- c->surface.parenty = ob_rr_theme->padding + 1;
+ c->surface.parenty = ob_rr_theme->paddingy + 1;
framerender_label(self, l);
framerender_max(self, m);
@@ -194,7 +193,9 @@ void framerender_frame(ObFrame *self)
framerender_close(self, c);
}
- if (self->decorations & OB_FRAME_DECOR_HANDLE) {
+ if (self->decorations & OB_FRAME_DECOR_HANDLE &&
+ ob_rr_theme->handle_height > 0)
+ {
RrAppearance *h, *g;
h = (self->focused ?
diff --git a/openbox/menu.c b/openbox/menu.c
index 243fc55b..868293c6 100644
--- a/openbox/menu.c
+++ b/openbox/menu.c
@@ -313,7 +313,7 @@ void menu_show(gchar *name, gint x, gint y, ObClient *client)
menu_frame_move(frame, x, y);
} else
menu_frame_move(frame,
- x - ob_rr_theme->bwidth, y - ob_rr_theme->bwidth);
+ x - ob_rr_theme->mbwidth, y - ob_rr_theme->mbwidth);
for (i = 0; i < screen_num_monitors; ++i) {
Rect *a = screen_physical_area_monitor(i);
if (RECT_CONTAINS(*a, x, y)) {
diff --git a/openbox/menuframe.c b/openbox/menuframe.c
index e9fc32da..743f4204 100644
--- a/openbox/menuframe.c
+++ b/openbox/menuframe.c
@@ -412,25 +412,25 @@ static void menu_frame_render(ObMenuFrame *self)
gboolean has_icon = FALSE;
ObMenu *sub;
- XSetWindowBorderWidth(ob_display, self->window, ob_rr_theme->bwidth);
+ XSetWindowBorderWidth(ob_display, self->window, ob_rr_theme->mbwidth);
XSetWindowBorder(ob_display, self->window,
- RrColorPixel(ob_rr_theme->b_color));
+ RrColorPixel(ob_rr_theme->menu_b_color));
if (!self->parent && self->show_title) {
XMoveWindow(ob_display, self->title,
- -ob_rr_theme->bwidth, h - ob_rr_theme->bwidth);
+ -ob_rr_theme->mbwidth, h - ob_rr_theme->mbwidth);
self->a_title->texture[0].data.text.string = self->menu->title;
RrMinsize(self->a_title, &tw, &th);
- tw = MIN(tw, MAX_MENU_WIDTH) + ob_rr_theme->padding * 2;
+ tw = MIN(tw, MAX_MENU_WIDTH) + ob_rr_theme->paddingx * 2;
w = MAX(w, tw);
th = ob_rr_theme->menu_title_height;
- h += (self->title_h = th + ob_rr_theme->bwidth);
+ h += (self->title_h = th + ob_rr_theme->mbwidth);
- XSetWindowBorderWidth(ob_display, self->title, ob_rr_theme->bwidth);
+ XSetWindowBorderWidth(ob_display, self->title, ob_rr_theme->mbwidth);
XSetWindowBorder(ob_display, self->title,
- RrColorPixel(ob_rr_theme->b_color));
+ RrColorPixel(ob_rr_theme->menu_b_color));
}
XMoveWindow(ob_display, self->items, 0, h);
@@ -538,9 +538,9 @@ static void menu_frame_render(ObMenuFrame *self)
if (!self->parent && self->show_title) {
XResizeWindow(ob_display, self->title,
- w, self->title_h - ob_rr_theme->bwidth);
+ w, self->title_h - ob_rr_theme->mbwidth);
RrPaint(self->a_title, self->title,
- w, self->title_h - ob_rr_theme->bwidth);
+ w, self->title_h - ob_rr_theme->mbwidth);
XMapWindow(ob_display, self->title);
} else
XUnmapWindow(ob_display, self->title);
@@ -550,8 +550,8 @@ static void menu_frame_render(ObMenuFrame *self)
for (it = self->entries; it; it = g_list_next(it))
menu_entry_frame_render(it->data);
- w += ob_rr_theme->bwidth * 2;
- h += ob_rr_theme->bwidth * 2;
+ w += ob_rr_theme->mbwidth * 2;
+ h += ob_rr_theme->mbwidth * 2;
RECT_SET_SIZE(self->area, w, h);
@@ -721,8 +721,8 @@ ObMenuEntryFrame* menu_entry_frame_under(gint x, gint y)
GList *it;
if ((frame = menu_frame_under(x, y))) {
- x -= ob_rr_theme->bwidth + frame->area.x;
- y -= frame->title_h + ob_rr_theme->bwidth + frame->area.y;
+ x -= ob_rr_theme->mbwidth + frame->area.x;
+ y -= frame->title_h + ob_rr_theme->mbwidth + frame->area.y;
for (it = frame->entries; it; it = g_list_next(it)) {
ObMenuEntryFrame *e = it->data;
@@ -795,7 +795,7 @@ void menu_entry_frame_show_submenu(ObMenuEntryFrame *self)
self->frame->area.x
+ self->frame->area.width
- ob_rr_theme->menu_overlap
- - ob_rr_theme->bwidth,
+ - ob_rr_theme->mbwidth,
self->frame->area.y
+ self->frame->title_h
+ self->area.y
diff --git a/openbox/popup.c b/openbox/popup.c
index 4a0ae890..6b118792 100644
--- a/openbox/popup.c
+++ b/openbox/popup.c
@@ -36,8 +36,8 @@ ObPopup *popup_new(gboolean hasicon)
self->hasicon = hasicon;
self->gravity = NorthWestGravity;
self->x = self->y = self->w = self->h = 0;
- self->a_bg = RrAppearanceCopy(ob_rr_theme->app_hilite_bg);
- self->a_text = RrAppearanceCopy(ob_rr_theme->app_hilite_label);
+ self->a_bg = RrAppearanceCopy(ob_rr_theme->osd_hilite_bg);
+ self->a_text = RrAppearanceCopy(ob_rr_theme->osd_hilite_label);
attrib.override_redirect = True;
self->bg = XCreateWindow(ob_display, RootWindow(ob_display, ob_screen),
@@ -88,11 +88,11 @@ void popup_size_to_string(ObPopup *self, gchar *text)
self->a_text->texture[0].data.text.string = text;
RrMinsize(self->a_text, &textw, &texth);
/*XXX textw += ob_rr_theme->bevel * 2;*/
- texth += ob_rr_theme->padding * 2;
+ texth += ob_rr_theme->paddingy * 2;
- self->h = texth + ob_rr_theme->padding * 2;
+ self->h = texth + ob_rr_theme->paddingy * 2;
iconw = (self->hasicon ? texth : 0);
- self->w = textw + iconw + ob_rr_theme->padding * (self->hasicon ? 3 : 2);
+ self->w = textw + iconw + ob_rr_theme->paddingx * (self->hasicon ? 3 : 2);
}
void popup_set_text_align(ObPopup *self, RrJustify align)
@@ -115,8 +115,8 @@ void popup_show(ObPopup *self, gchar *text)
RrMargins(self->a_bg, &l, &t, &r, &b);
- XSetWindowBorderWidth(ob_display, self->bg, ob_rr_theme->bwidth);
- XSetWindowBorder(ob_display, self->bg, ob_rr_theme->b_color->pixel);
+ XSetWindowBorderWidth(ob_display, self->bg, ob_rr_theme->fbwidth);
+ XSetWindowBorder(ob_display, self->bg, ob_rr_theme->frame_b_color->pixel);
/* set up the textures */
self->a_text->texture[0].data.text.string = text;
@@ -124,22 +124,22 @@ void popup_show(ObPopup *self, gchar *text)
/* measure the shit out */
RrMinsize(self->a_text, &textw, &texth);
/*XXX textw += ob_rr_theme->padding * 2;*/
- texth += ob_rr_theme->padding * 2;
+ texth += ob_rr_theme->paddingy * 2;
/* set the sizes up and reget the text sizes from the calculated
outer sizes */
if (self->h) {
h = self->h;
- texth = h - (t+b + ob_rr_theme->padding * 2);
+ texth = h - (t+b + ob_rr_theme->paddingy * 2);
} else
- h = t+b + texth + ob_rr_theme->padding * 2;
+ h = t+b + texth + ob_rr_theme->paddingy * 2;
iconw = (self->hasicon ? texth : 0);
if (self->w) {
w = self->w;
- textw = w - (l+r + iconw + ob_rr_theme->padding *
+ textw = w - (l+r + iconw + ob_rr_theme->paddingx *
(self->hasicon ? 3 : 2));
} else
- w = l+r + textw + iconw + ob_rr_theme->padding *
+ w = l+r + textw + iconw + ob_rr_theme->paddingx *
(self->hasicon ? 3 : 2);
/* sanity checks to avoid crashes! */
if (w < 1) w = 1;
@@ -185,12 +185,12 @@ void popup_show(ObPopup *self, gchar *text)
self->a_text->surface.parent = self->a_bg;
self->a_text->surface.parentx = l + iconw +
- ob_rr_theme->padding * (self->hasicon ? 2 : 1);
- self->a_text->surface.parenty = t + ob_rr_theme->padding;
+ ob_rr_theme->paddingx * (self->hasicon ? 2 : 1);
+ self->a_text->surface.parenty = t + ob_rr_theme->paddingy;
XMoveResizeWindow(ob_display, self->text,
- l + iconw + ob_rr_theme->padding *
+ l + iconw + ob_rr_theme->paddingx *
(self->hasicon ? 2 : 1),
- t + ob_rr_theme->padding, textw, texth);
+ t + ob_rr_theme->paddingy, textw, texth);
RrPaint(self->a_bg, self->bg, w, h);
RrPaint(self->a_text, self->text, textw, texth);
@@ -198,7 +198,8 @@ void popup_show(ObPopup *self, gchar *text)
if (self->hasicon) {
if (iconw < 1) iconw = 1; /* sanity check for crashes */
if (self->draw_icon)
- self->draw_icon(l + ob_rr_theme->padding, t + ob_rr_theme->padding,
+ self->draw_icon(l + ob_rr_theme->paddingx,
+ t + ob_rr_theme->paddingy,
iconw, texth, self->draw_icon_data);
}
@@ -282,20 +283,20 @@ static void pager_popup_draw_icon(gint px, gint py, gint w, gint h,
guint r, c;
gint eachw, eachh;
- eachw = (w - ob_rr_theme->bwidth -
- (screen_desktop_layout.columns * ob_rr_theme->bwidth))
+ eachw = (w - ob_rr_theme->fbwidth -
+ (screen_desktop_layout.columns * ob_rr_theme->fbwidth))
/ screen_desktop_layout.columns;
- eachh = (h - ob_rr_theme->bwidth -
- (screen_desktop_layout.rows * ob_rr_theme->bwidth))
+ eachh = (h - ob_rr_theme->fbwidth -
+ (screen_desktop_layout.rows * ob_rr_theme->fbwidth))
/ screen_desktop_layout.rows;
/* make them squares */
eachw = eachh = MIN(eachw, eachh);
/* center */
- px += (w - (screen_desktop_layout.columns * (eachw + ob_rr_theme->bwidth) +
- ob_rr_theme->bwidth)) / 2;
- py += (h - (screen_desktop_layout.rows * (eachh + ob_rr_theme->bwidth) +
- ob_rr_theme->bwidth)) / 2;
+ px += (w - (screen_desktop_layout.columns * (eachw + ob_rr_theme->fbwidth) +
+ ob_rr_theme->fbwidth)) / 2;
+ py += (h - (screen_desktop_layout.rows * (eachh + ob_rr_theme->fbwidth) +
+ ob_rr_theme->fbwidth)) / 2;
if (eachw <= 0 || eachh <= 0)
return;
@@ -361,10 +362,10 @@ static void pager_popup_draw_icon(gint px, gint py, gint w, gint h,
rown = n;
for (r = 0, y = 0; r < screen_desktop_layout.rows;
- ++r, y += eachh + ob_rr_theme->bwidth)
+ ++r, y += eachh + ob_rr_theme->fbwidth)
{
for (c = 0, x = 0; c < screen_desktop_layout.columns;
- ++c, x += eachw + ob_rr_theme->bwidth)
+ ++c, x += eachw + ob_rr_theme->fbwidth)
{
RrAppearance *a;
@@ -393,8 +394,8 @@ ObPagerPopup *pager_popup_new()
self->desks = 0;
self->wins = g_new(Window, self->desks);
- self->hilight = RrAppearanceCopy(ob_rr_theme->app_hilite_fg);
- self->unhilight = RrAppearanceCopy(ob_rr_theme->app_unhilite_fg);
+ self->hilight = RrAppearanceCopy(ob_rr_theme->osd_hilite_fg);
+ self->unhilight = RrAppearanceCopy(ob_rr_theme->osd_unhilite_fg);
self->popup->draw_icon = pager_popup_draw_icon;
self->popup->draw_icon_data = self;
@@ -432,9 +433,9 @@ void pager_popup_show(ObPagerPopup *self, gchar *text, guint desk)
for (i = self->desks; i < screen_num_desktops; ++i) {
XSetWindowAttributes attr;
- attr.border_pixel = RrColorPixel(ob_rr_theme->b_color);
+ attr.border_pixel = RrColorPixel(ob_rr_theme->frame_b_color);
self->wins[i] = XCreateWindow(ob_display, self->popup->bg,
- 0, 0, 1, 1, ob_rr_theme->bwidth,
+ 0, 0, 1, 1, ob_rr_theme->fbwidth,
RrDepth(ob_rr_inst), InputOutput,
RrVisual(ob_rr_inst), CWBorderPixel,
&attr);