mirror of
				https://github.com/labwc/labwc.git
				synced 2025-11-03 09:01:51 -05:00 
			
		
		
		
	Split theme-builtin.c into a separate file
This commit is contained in:
		
							parent
							
								
									4a89fbfb22
								
							
						
					
					
						commit
						5a77c84fc8
					
				
					 4 changed files with 39 additions and 22 deletions
				
			
		| 
						 | 
				
			
			@ -21,7 +21,7 @@ static int hex_to_dec(char c)
 | 
			
		|||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void parse_hexstr(const char *hex, float *rgba)
 | 
			
		||||
void parse_hexstr(const char *hex, float *rgba)
 | 
			
		||||
{
 | 
			
		||||
	if (!hex || hex[0] != '#' || strlen(hex) < 7)
 | 
			
		||||
		return;
 | 
			
		||||
| 
						 | 
				
			
			@ -95,27 +95,6 @@ static void process_line(char *line)
 | 
			
		|||
	entry(key, value);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * We generally use Openbox defaults, but if no theme file can be found it's
 | 
			
		||||
 * better to populate the theme variables with some sane values as no-one
 | 
			
		||||
 * wants to use openbox without a theme - it'll all just be black and white.
 | 
			
		||||
 *
 | 
			
		||||
 * Openbox doesn't actual start if it can't find a theme. As it's normally
 | 
			
		||||
 * packaged with Clearlooks, this is not a problem, but for labwc I thought
 | 
			
		||||
 * this was a bit hard-line. People might want to try labwc without having
 | 
			
		||||
 * Openbox (and associated themes) installed.
 | 
			
		||||
 */
 | 
			
		||||
/* clang-format off */
 | 
			
		||||
void theme_builtin(void)
 | 
			
		||||
{
 | 
			
		||||
	parse_hexstr("#589bda", theme.window_active_title_bg_color);
 | 
			
		||||
	parse_hexstr("#3c7cb7", theme.window_active_handle_bg_color);
 | 
			
		||||
	parse_hexstr("#efece6", theme.window_inactive_title_bg_color);
 | 
			
		||||
	parse_hexstr("#ffffff", theme.window_active_button_unpressed_image_color);
 | 
			
		||||
	parse_hexstr("#000000", theme.window_inactive_button_unpressed_image_color);
 | 
			
		||||
}
 | 
			
		||||
/* clang-format on */
 | 
			
		||||
 | 
			
		||||
void theme_read(const char *theme_name)
 | 
			
		||||
{
 | 
			
		||||
	FILE *stream = NULL;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue