mirror of
https://github.com/labwc/labwc.git
synced 2025-11-05 13:29:58 -05:00
menu: Dynamically adjust menu width based on widest item
Adds two new theme vars: - menu.width.min (menu will never be smaller than this) - menu.width.max (menu will never be wider than this + padding) A fixed menu width can be achieved by setting menu.width.min == menu.width.max.
This commit is contained in:
parent
f0666ba5c9
commit
d00327bc32
7 changed files with 115 additions and 14 deletions
|
|
@ -90,3 +90,10 @@ scaled_font_buffer_update(struct scaled_font_buffer *self, const char *text,
|
|||
/* Invalidate cache and force a new render */
|
||||
scaled_scene_buffer_invalidate_cache(self->scaled_buffer);
|
||||
}
|
||||
|
||||
void
|
||||
scaled_font_buffer_set_max_width(struct scaled_font_buffer *self, int max_width)
|
||||
{
|
||||
self->max_width = max_width;
|
||||
scaled_scene_buffer_invalidate_cache(self->scaled_buffer);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue