mirror of
				https://github.com/labwc/labwc.git
				synced 2025-11-03 09:01:51 -05:00 
			
		
		
		
	osd: fix boxes size and alignment in workspace switcher
Workspace switcher boxes height was 2px more than supposed, e.g. theme defaults of 20x20 resulted in 20x22 boxes. The middle of the boxes list was also 1px to the left of the middle of the osd window.
This commit is contained in:
		
							parent
							
								
									96a3a576a9
								
							
						
					
					
						commit
						79b92d821f
					
				
					 1 changed files with 8 additions and 4 deletions
				
			
		| 
						 | 
					@ -114,12 +114,16 @@ _osd_update(struct server *server)
 | 
				
			||||||
			wl_list_for_each(workspace, &server->workspaces.all, link) {
 | 
								wl_list_for_each(workspace, &server->workspaces.all, link) {
 | 
				
			||||||
				bool active =  workspace == server->workspaces.current;
 | 
									bool active =  workspace == server->workspaces.current;
 | 
				
			||||||
				set_cairo_color(cairo, server->theme->osd_label_text_color);
 | 
									set_cairo_color(cairo, server->theme->osd_label_text_color);
 | 
				
			||||||
				cairo_rectangle(cairo, x, margin,
 | 
									struct wlr_fbox fbox = {
 | 
				
			||||||
					rect_width - padding, rect_height);
 | 
										.x = x,
 | 
				
			||||||
				cairo_stroke(cairo);
 | 
										.y = margin,
 | 
				
			||||||
 | 
										.width = rect_width,
 | 
				
			||||||
 | 
										.height = rect_height,
 | 
				
			||||||
 | 
									};
 | 
				
			||||||
 | 
									draw_cairo_border(cairo, fbox, 2);
 | 
				
			||||||
				if (active) {
 | 
									if (active) {
 | 
				
			||||||
					cairo_rectangle(cairo, x, margin,
 | 
										cairo_rectangle(cairo, x, margin,
 | 
				
			||||||
						rect_width - padding, rect_height);
 | 
											rect_width, rect_height);
 | 
				
			||||||
					cairo_fill(cairo);
 | 
										cairo_fill(cairo);
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
				x += rect_width + padding;
 | 
									x += rect_width + padding;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue