summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQC <qball@gmpclient.org>2015-03-19 23:48:49 +0100
committerQC <qball@gmpclient.org>2015-03-19 23:48:49 +0100
commit3df30438b14d2202907812680fe95076dd2d0db5 (patch)
treefa0570517af217fdbd6c41965f684d2e9c8249b8
parent21144aef177f80ba1936043710d6e82ca962b7fa (diff)
Fix some font stuff.
-rw-r--r--Changelog1
-rw-r--r--source/rofi.c8
-rw-r--r--source/textbox.c2
3 files changed, 6 insertions, 5 deletions
diff --git a/Changelog b/Changelog
index af452b99..2b6fd67d 100644
--- a/Changelog
+++ b/Changelog
@@ -7,6 +7,7 @@
- Add Ctrl(Shift)Tab to switch modi's.
- Auto size number of columns based on available columns.
- Better way to determine font height.
+ - Fix font vertical centering.
- One-off when pasting text.
Cleanup:
- Do not lug argc,argv around everywhere.
diff --git a/source/rofi.c b/source/rofi.c
index 258e5b49..5e58ddc3 100644
--- a/source/rofi.c
+++ b/source/rofi.c
@@ -1018,13 +1018,13 @@ MenuReturn menu ( char **lines, unsigned int num_lines, char **input, char *prom
textbox_show ( state.boxes[i] );
}
// Arrows
- state.arrowbox_top = textbox_create ( main_window, &vinfo, map, TB_AUTOHEIGHT | TB_AUTOWIDTH,
+ state.arrowbox_top = textbox_create ( main_window, &vinfo, map, TB_AUTOWIDTH,
( config.padding ), ( config.padding ),
- 0, 0, NORMAL,
+ 0, element_height, NORMAL,
"↑" );
- state.arrowbox_bottom = textbox_create ( main_window, &vinfo, map, TB_AUTOHEIGHT | TB_AUTOWIDTH,
+ state.arrowbox_bottom = textbox_create ( main_window, &vinfo, map, TB_AUTOWIDTH,
( config.padding ), ( config.padding ),
- 0, 0, NORMAL,
+ 0, element_height, NORMAL,
"↓" );
textbox_move ( state.arrowbox_top,
state.w - config.padding - state.arrowbox_top->w,
diff --git a/source/textbox.c b/source/textbox.c
index 4c3e9848..b48d2a92 100644
--- a/source/textbox.c
+++ b/source/textbox.c
@@ -289,7 +289,7 @@ void textbox_draw ( textbox *tb )
int tw = textbox_get_font_width ( tb );
x = ( PANGO_SCALE * ( tb->w - tw - 2 * SIDE_MARGIN ) ) / 2;
}
- y = ( PANGO_SCALE * ( textbox_get_width ( tb ) - textbox_get_font_width ( tb ) ) ) / 2;
+ y = ( PANGO_SCALE * ( tb->h - textbox_get_height ( tb ) + 2 * SIDE_MARGIN ) ) / 2;
// Render the layout.
pango_xft_render_layout ( draw, &( tb->color_fg ), tb->layout, x, y );