Prefix the separator enum
This commit is contained in:
		
							parent
							
								
									1d58d2ec87
								
							
						
					
					
						commit
						b6283724b9
					
				
							
								
								
									
										2
									
								
								config.h
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								config.h
									
									
									
									
									
								
							| @ -45,7 +45,7 @@ settings_t defaults = { | ||||
| .separator_height = 2,       /* height of the separator line between two notifications */ | ||||
| .padding = 0, | ||||
| .h_padding = 0,              /* horizontal padding */ | ||||
| .sep_color = AUTO,           /* AUTO, FOREGROUND, FRAME, CUSTOM */ | ||||
| .sep_color = SEP_AUTO,       /* SEP_AUTO, SEP_FOREGROUND, SEP_FRAME, SEP_CUSTOM */ | ||||
| .sep_custom_color_str = NULL,/* custom color if sep_color is set to CUSTOM */ | ||||
| 
 | ||||
| .frame_width = 0, | ||||
|  | ||||
							
								
								
									
										10
									
								
								src/draw.c
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								src/draw.c
									
									
									
									
									
								
							| @ -93,16 +93,16 @@ static color_t calculate_foreground_color(color_t bg) | ||||
| static color_t layout_get_sepcolor(colored_layout *cl, colored_layout *cl_next) | ||||
| { | ||||
|         switch (settings.sep_color) { | ||||
|         case FRAME: | ||||
|         case SEP_FRAME: | ||||
|                 if (cl_next->n->urgency > cl->n->urgency) | ||||
|                         return cl_next->frame; | ||||
|                 else | ||||
|                         return cl->frame; | ||||
|         case CUSTOM: | ||||
|         case SEP_CUSTOM: | ||||
|                 return string_to_color(settings.sep_custom_color_str); | ||||
|         case FOREGROUND: | ||||
|         case SEP_FOREGROUND: | ||||
|                 return cl->fg; | ||||
|         case AUTO: | ||||
|         case SEP_AUTO: | ||||
|                 return calculate_foreground_color(cl->bg); | ||||
|         default: | ||||
|                 LOG_E("Invalid %s enum value in %s:%d", "sep_color", __FILE__, __LINE__); | ||||
| @ -429,7 +429,7 @@ static cairo_surface_t *render_background(cairo_surface_t *srf, | ||||
|         cairo_rectangle(c, x, y, width, height); | ||||
|         cairo_fill(c); | ||||
| 
 | ||||
|         if (   settings.sep_color != FRAME | ||||
|         if (   settings.sep_color != SEP_FRAME | ||||
|             && settings.separator_height > 0 | ||||
|             && !last) { | ||||
|                 color_t sep_color = layout_get_sepcolor(cl, cl_next); | ||||
|  | ||||
| @ -377,13 +377,13 @@ void load_settings(char *cmdline_config_path) | ||||
| 
 | ||||
|                 if (strlen(c) > 0) { | ||||
|                         if (strcmp(c, "auto") == 0) | ||||
|                                 settings.sep_color = AUTO; | ||||
|                                 settings.sep_color = SEP_AUTO; | ||||
|                         else if (strcmp(c, "foreground") == 0) | ||||
|                                 settings.sep_color = FOREGROUND; | ||||
|                                 settings.sep_color = SEP_FOREGROUND; | ||||
|                         else if (strcmp(c, "frame") == 0) | ||||
|                                 settings.sep_color = FRAME; | ||||
|                                 settings.sep_color = SEP_FRAME; | ||||
|                         else { | ||||
|                                 settings.sep_color = CUSTOM; | ||||
|                                 settings.sep_color = SEP_CUSTOM; | ||||
|                                 settings.sep_custom_color_str = g_strdup(c); | ||||
|                         } | ||||
|                 } | ||||
|  | ||||
| @ -9,7 +9,7 @@ | ||||
| enum alignment { left, center, right }; | ||||
| enum ellipsize { start, middle, end }; | ||||
| enum icon_position_t { icons_left, icons_right, icons_off }; | ||||
| enum separator_color { FOREGROUND, AUTO, FRAME, CUSTOM }; | ||||
| enum separator_color { SEP_FOREGROUND, SEP_AUTO, SEP_FRAME, SEP_CUSTOM }; | ||||
| enum follow_mode { FOLLOW_NONE, FOLLOW_MOUSE, FOLLOW_KEYBOARD }; | ||||
| enum markup_mode { MARKUP_NULL, MARKUP_NO, MARKUP_STRIP, MARKUP_FULL }; | ||||
| 
 | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Benedikt Heine
						Benedikt Heine