Move corner textures from ssd.c to theme.c

It makes more sense to just keep one set of corner textures for server
side view decorations, rather than storing a set for each view. This also
keeps the code simpler when when changing theme parameters.
This commit is contained in:
Johan Malm 2021-07-16 17:07:00 +01:00
parent c668fd9b07
commit e50bb45890
5 changed files with 182 additions and 140 deletions

View file

@ -19,14 +19,26 @@ enum ssd_part_type {
struct ssd_part {
struct wlr_box box;
enum ssd_part_type type;
/*
* The texture pointers are often held in other places such as the
* theme struct, so here we use ** in order to keep the code
* simple and avoid updating pointers as textures change.
*/
struct {
struct wlr_texture *active;
struct wlr_texture *inactive;
struct wlr_texture **active;
struct wlr_texture **inactive;
} texture;
/*
* If a part does not contain textures, it'll just be rendered as a
* rectangle with the following colors.
*/
struct {
float *active;
float *inactive;
} color;
struct wl_list link;
};

View file

@ -1,7 +1,7 @@
/*
* Theme engine for labwc - trying to be consistent with openbox
* Theme engine for labwc
*
* Copyright Johan Malm 2020
* Copyright Johan Malm 2020-2021
*/
#ifndef __LABWC_THEME_H
@ -36,7 +36,12 @@ struct theme {
struct wlr_texture *xbm_maximize_inactive_unpressed;
struct wlr_texture *xbm_iconify_inactive_unpressed;
/* not set in rc.xml or themerc, but derived from font and padding_height */
struct wlr_texture *corner_top_left_active_normal;
struct wlr_texture *corner_top_right_active_normal;
struct wlr_texture *corner_top_left_inactive_normal;
struct wlr_texture *corner_top_right_inactive_normal;
/* not set in rc.xml/themerc, but derived from font & padding_height */
int title_height;
};