summaryrefslogtreecommitdiff
path: root/lib/menu.c
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2019-05-31 20:32:02 +0000
committerAlyssa Ross <hi@alyssa.is>2019-05-31 23:20:54 +0000
commit93cde4831bca7055c38a1d6246fdcb84df07f7ec (patch)
tree15bc616a6da2139483d76ebe384d00a636b16441 /lib/menu.c
parent121367b9406b58c80591a21be3bd6e4771facb5e (diff)
downloadbemenu-93cde4831bca7055c38a1d6246fdcb84df07f7ec.tar.gz
bemenu-93cde4831bca7055c38a1d6246fdcb84df07f7ec.tar.bz2
bemenu-93cde4831bca7055c38a1d6246fdcb84df07f7ec.zip
bemenu: add --line-height / -H option
Text is displayed vertically centered in a line. If unspecified, or 0, the previous behaviour of making the height the size of the text, plus two pixels on either side, is used, so there will be no change in behaviour if this option is not used. Fixes https://github.com/Cloudef/bemenu/issues/44.
Diffstat (limited to 'lib/menu.c')
-rw-r--r--lib/menu.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/menu.c b/lib/menu.c
index e876126..c46a2d6 100644
--- a/lib/menu.c
+++ b/lib/menu.c
@@ -266,6 +266,20 @@ bm_menu_get_font(const struct bm_menu *menu)
return menu->font.name;
}
+void
+bm_menu_set_line_height(struct bm_menu *menu, uint32_t line_height)
+{
+ assert(menu);
+ menu->line_height = line_height;
+}
+
+uint32_t
+bm_menu_get_line_height(struct bm_menu *menu)
+{
+ assert(menu);
+ return menu->line_height;
+}
+
bool
bm_menu_set_color(struct bm_menu *menu, enum bm_color color, const char *hex)
{