From ec304c9e433e4b1cedf924ca64d783f05db7d42d Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Mon, 5 Mar 2007 15:44:17 +0000 Subject: 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. ... arial,sans 7 bold normal arial,sans 7 bold normal arial,sans 8 bold normal arial,sans 8 bold normal --- openbox/dock.c | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) (limited to 'openbox/dock.c') 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(); } -- cgit v1.2.3