mirror of
https://github.com/labwc/labwc.git
synced 2025-11-05 13:29:58 -05:00
font: remove 4px padding on the right
Added `menu.items.padding.x` padding between item text and arrow instead. Replaced `if (!string)` with `if (string_null_or_empty(string))` in `font_extents()` just as a minor optimization.
This commit is contained in:
parent
141f932efa
commit
ebce406b11
3 changed files with 6 additions and 11 deletions
|
|
@ -22,7 +22,7 @@ static PangoRectangle
|
|||
font_extents(struct font *font, const char *string)
|
||||
{
|
||||
PangoRectangle rect = { 0 };
|
||||
if (!string) {
|
||||
if (string_null_or_empty(string)) {
|
||||
return rect;
|
||||
}
|
||||
cairo_surface_t *surface;
|
||||
|
|
@ -43,10 +43,6 @@ font_extents(struct font *font, const char *string)
|
|||
pango_layout_get_extents(layout, NULL, &rect);
|
||||
pango_extents_to_pixels(&rect, NULL);
|
||||
|
||||
/* we put a 2 px edge on each side - because Openbox does it :) */
|
||||
/* TODO: remove the 4 pixel addition and always do the padding by the caller */
|
||||
rect.width += 4;
|
||||
|
||||
cairo_destroy(c);
|
||||
cairo_surface_destroy(surface);
|
||||
pango_font_description_free(desc);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue