mirror of
https://github.com/davatorium/rofi.git
synced 2024-11-11 13:50:48 -05:00
Revert "[i1437] [View] Do the sizing based on the desired window width."
This reverts commit 46ac770fcc
.
This commit is contained in:
parent
46ac770fcc
commit
965d3631cb
1 changed files with 8 additions and 2 deletions
|
@ -1667,7 +1667,7 @@ static int rofi_view_calculate_height(RofiViewState *state) {
|
|||
}
|
||||
// Autosize based on widgets.
|
||||
widget *main_window = WIDGET(state->main_window);
|
||||
return widget_get_desired_height(main_window, state->width);
|
||||
return widget_get_desired_height(main_window, main_window->w);
|
||||
}
|
||||
|
||||
static WidgetTriggerActionResult textbox_button_trigger_action(
|
||||
|
@ -1994,6 +1994,8 @@ RofiViewState *rofi_view_create(Mode *sw, const char *input,
|
|||
state->distance = (int *)g_malloc0_n(state->num_lines, sizeof(int));
|
||||
|
||||
rofi_view_calculate_window_width(state);
|
||||
// Need to resize otherwise calculated desired height is wrong.
|
||||
widget_resize(WIDGET(state->main_window), state->width, 100);
|
||||
// Only needed when window is fixed size.
|
||||
if ((CacheState.flags & MENU_NORMAL_WINDOW) == MENU_NORMAL_WINDOW) {
|
||||
listview_set_fixed_num_lines(state->list_view);
|
||||
|
@ -2046,7 +2048,11 @@ int rofi_view_error_dialog(const char *msg, int markup) {
|
|||
listview_set_fixed_num_lines(state->list_view);
|
||||
}
|
||||
rofi_view_calculate_window_width(state);
|
||||
state->height = rofi_view_calculate_height(state);
|
||||
// Need to resize otherwise calculated desired height is wrong.
|
||||
// widget_resize(WIDGET(state->main_window), state->width, 100);
|
||||
// resize window vertically to suit
|
||||
state->height =
|
||||
widget_get_desired_height(WIDGET(state->main_window), state->width);
|
||||
|
||||
// Calculate window position.
|
||||
rofi_view_calculate_window_position(state);
|
||||
|
|
Loading…
Reference in a new issue