mirror of
				https://github.com/labwc/labwc.git
				synced 2025-11-03 09:01:51 -05:00 
			
		
		
		
	theme: use 'labwc' directory
as well as 'openbox-3', for example: /usr/share/themes/foo/labwc/themerc
Give 'labwc' higher precedence than 'openbox-3' if both exist.
For several reasons not all themes designed for labwc render well on
Openbox:
1. Labwc support some features like SVG/PNG icons and #rrggbbaa color
   definitions which Openbox does not.
2. Openbox generally defaults to black/white colors and will not render
   themes accurate without certain options specified in themerc. For
   example, in Openbox the following will just render as black:
       window.active.title.bg.color: #589bda
   ...because Openbox defaults the texture to "Gradient Vertical" and
   therefore either needs:
      window.active.title.bg.colorTo: #3c7cb7
   ...or remove 'Gradient' from the bg definition and just use something
   like:
      window.active.title.bg: Flat Border
Whilst none of this is a problem when using labwc, it causes problems for
setups with both Openbox and labwc because themes designed for labwc only
will now show up in obconf, lxappearance, etc causing confusion for users.
			
			
This commit is contained in:
		
							parent
							
								
									cacf11fc90
								
							
						
					
					
						commit
						8d9bd2d747
					
				
					 5 changed files with 25 additions and 5 deletions
				
			
		| 
						 | 
				
			
			@ -75,7 +75,15 @@ build_config_path(struct ctx *ctx, char *prefix, const char *path)
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
build_theme_path(struct ctx *ctx, char *prefix, const char *path)
 | 
			
		||||
build_theme_path_labwc(struct ctx *ctx, char *prefix, const char *path)
 | 
			
		||||
{
 | 
			
		||||
	assert(prefix);
 | 
			
		||||
	snprintf(ctx->buf, ctx->len, "%s/%s/%s/labwc/%s", prefix, path,
 | 
			
		||||
		ctx->theme_name, ctx->filename);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
build_theme_path_openbox(struct ctx *ctx, char *prefix, const char *path)
 | 
			
		||||
{
 | 
			
		||||
	assert(prefix);
 | 
			
		||||
	snprintf(ctx->buf, ctx->len, "%s/%s/%s/openbox-3/%s", prefix, path,
 | 
			
		||||
| 
						 | 
				
			
			@ -169,7 +177,7 @@ paths_theme_create(struct wl_list *paths, const char *theme_name,
 | 
			
		|||
	static char buf[4096] = { 0 };
 | 
			
		||||
	wl_list_init(paths);
 | 
			
		||||
	struct ctx ctx = {
 | 
			
		||||
		.build_path_fn = build_theme_path,
 | 
			
		||||
		.build_path_fn = build_theme_path_labwc,
 | 
			
		||||
		.filename = filename,
 | 
			
		||||
		.buf = buf,
 | 
			
		||||
		.len = sizeof(buf),
 | 
			
		||||
| 
						 | 
				
			
			@ -178,6 +186,9 @@ paths_theme_create(struct wl_list *paths, const char *theme_name,
 | 
			
		|||
		.list = paths,
 | 
			
		||||
	};
 | 
			
		||||
	find_dir(&ctx);
 | 
			
		||||
 | 
			
		||||
	ctx.build_path_fn = build_theme_path_openbox;
 | 
			
		||||
	find_dir(&ctx);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue