mirror of
https://github.com/labwc/labwc.git
synced 2025-11-04 13:30:07 -05:00
osd: refactor to remove get_osd_height()
This commit is contained in:
parent
f2479090a2
commit
a9e123393c
1 changed files with 3 additions and 16 deletions
19
src/osd.c
19
src/osd.c
|
|
@ -392,21 +392,6 @@ render_osd(struct server *server, cairo_t *cairo, int w, int h,
|
||||||
cairo_surface_flush(surf);
|
cairo_surface_flush(surf);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
|
||||||
get_osd_height(struct server *server, struct wl_array *views)
|
|
||||||
{
|
|
||||||
int height = 0;
|
|
||||||
|
|
||||||
/* Includes item border width */
|
|
||||||
size_t len = views->size / sizeof(struct view *);
|
|
||||||
height += len * rc.theme->osd_window_switcher_item_height;
|
|
||||||
|
|
||||||
/* Add OSD border width */
|
|
||||||
height += 2 * rc.theme->osd_border_width;
|
|
||||||
height += 2 * rc.theme->osd_window_switcher_padding;
|
|
||||||
return height;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
display_osd(struct output *output)
|
display_osd(struct output *output)
|
||||||
{
|
{
|
||||||
|
|
@ -426,7 +411,9 @@ display_osd(struct output *output)
|
||||||
|
|
||||||
float scale = output->wlr_output->scale;
|
float scale = output->wlr_output->scale;
|
||||||
int w = theme->osd_window_switcher_width;
|
int w = theme->osd_window_switcher_width;
|
||||||
int h = get_osd_height(server, &views);
|
int h = views.size / sizeof(struct view *) * rc.theme->osd_window_switcher_item_height
|
||||||
|
+ 2 * rc.theme->osd_border_width
|
||||||
|
+ 2 * rc.theme->osd_window_switcher_padding;
|
||||||
if (show_workspace) {
|
if (show_workspace) {
|
||||||
/* workspace indicator */
|
/* workspace indicator */
|
||||||
h += theme->osd_window_switcher_item_height;
|
h += theme->osd_window_switcher_item_height;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue