mirror of
https://github.com/labwc/labwc.git
synced 2026-02-22 01:40:25 -05:00
Make font_texture_create() more generic
Move font_texture_create() to font.c so it can be used for purposes other than rendering the menu, for example server side decoration. Refactor menu.c and menu.h to use this more generic font_texture_create()
This commit is contained in:
parent
8fc6f795db
commit
5ecf0e1e7e
5 changed files with 104 additions and 72 deletions
12
src/output.c
12
src/output.c
|
|
@ -544,13 +544,13 @@ render_rootmenu(struct output *output, pixman_region32_t *output_damage)
|
|||
struct menuitem *menuitem;
|
||||
wl_list_for_each (menuitem, &server->rootmenu->menuitems, link) {
|
||||
struct wlr_texture *t;
|
||||
t = menuitem->selected ? menuitem->active_texture :
|
||||
menuitem->inactive_texture;
|
||||
t = menuitem->selected ? menuitem->texture.active :
|
||||
menuitem->texture.inactive;
|
||||
struct wlr_box box = {
|
||||
.x = menuitem->geo_box.x + ox,
|
||||
.y = menuitem->geo_box.y + oy,
|
||||
.width = menuitem->geo_box.width,
|
||||
.height = menuitem->geo_box.height,
|
||||
.x = menuitem->box.x + ox + menuitem->texture.offset_x,
|
||||
.y = menuitem->box.y + oy + menuitem->texture.offset_y,
|
||||
.width = t->width,
|
||||
.height = t->height,
|
||||
};
|
||||
scale_box(&box, output->wlr_output->scale);
|
||||
wlr_matrix_project_box(matrix, &box, WL_OUTPUT_TRANSFORM_NORMAL,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue