summaryrefslogtreecommitdiffstats
path: root/source/view.c
diff options
context:
space:
mode:
authorDave Davenport <qball@gmpclient.org>2016-03-05 23:25:46 +0100
committerDave Davenport <qball@gmpclient.org>2016-03-05 23:25:46 +0100
commitb13bff6d1da035b5a741fe6be4692fcbbaec63d7 (patch)
treee384b8d50d8c8d5da69b52c569078b4b1a468c96 /source/view.c
parentf4f2e3d1294cfb470e9c8a51b72fc5aa3f47c8bd (diff)
Try to fix things
Diffstat (limited to 'source/view.c')
-rw-r--r--source/view.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/source/view.c b/source/view.c
index f5e99f0e..4fa09908 100644
--- a/source/view.c
+++ b/source/view.c
@@ -318,14 +318,22 @@ static void rofi_view_resize ( RofiViewState *state )
textbox_draw ( state->modi[j], CacheState.draw );
}
}
- int entrybox_width = state->w - ( 2 * ( state->border ) ) - textbox_get_width ( state->prompt_tb )
- - textbox_get_width ( state->case_indicator );
+ int entrybox_width = state->w - ( 2 * ( state->border ) );
+ int offset = 0;
+ if ( state->prompt_tb ) {
+ entrybox_width -= textbox_get_width ( state->prompt_tb );
+ }
+ if ( state->case_indicator ) {
+ int width = textbox_get_width ( state->case_indicator );
+ entrybox_width -= width;
+ offset = width;
+ }
textbox_moveresize ( state->text, state->text->widget.x, state->text->widget.y, entrybox_width, state->line_height );
- widget_move ( WIDGET ( state->case_indicator ), state->w - state->border - textbox_get_width ( state->case_indicator ), state->border );
+ widget_move ( WIDGET ( state->case_indicator ), state->w - state->border - offset, state->border );
/**
* Resize in Height
*/
- {
+ if ( state->num_lines > 0 ) {
unsigned int last_length = state->max_elements;
int element_height = state->line_height * config.element_height + config.line_margin;
// Calculated new number of boxes.