Fix resizing normal-window mode.

This commit is contained in:
Dave Davenport 2016-12-29 21:58:32 +01:00
parent 5183c14b51
commit b0a8edc95a
1 changed files with 11 additions and 3 deletions

View File

@ -1523,6 +1523,10 @@ RofiViewState *rofi_view_create ( Mode *sw,
state->line_map = g_malloc0_n ( state->num_lines, sizeof ( unsigned int ) );
state->distance = (int *) g_malloc0_n ( state->num_lines, sizeof ( int ) );
// Make sure we enable fixed num lines when in normal window mode.
if ( (CacheState.flags&MENU_NORMAL_WINDOW) == MENU_NORMAL_WINDOW){
config.fixed_num_lines = TRUE;
}
state->height = rofi_view_calculate_height ( state );
// Move the window to the correct x,y position.
@ -1565,8 +1569,12 @@ int rofi_view_error_dialog ( const char *msg, int markup )
box_add ( state->main_box, WIDGET ( state->text ), TRUE, FALSE );
unsigned int line_height = textbox_get_height ( state->text );
// Make sure we enable fixed num lines when in normal window mode.
if ( (CacheState.flags&MENU_NORMAL_WINDOW) == MENU_NORMAL_WINDOW){
config.fixed_num_lines = TRUE;
}
// resize window vertically to suit
state->height = line_height + ( state->border ) * 2+state->pad.top+state->pad.bottom;
state->height = line_height + window_get_border_width ( state->main_window)+widget_padding_get_padding_height ( WIDGET(state->main_window) );
// Calculte window position.
rofi_view_calculate_window_position ( state );