diff options
author | Dave Davenport <qball@blame.services> | 2021-09-06 22:47:26 +0200 |
---|---|---|
committer | Dave Davenport <qball@blame.services> | 2021-09-06 22:47:26 +0200 |
commit | 965d3631cb3007aa71c9682e0d54fb02262e8ef4 (patch) | |
tree | 28952710acfbd690887e8b186f3fa20be3d174d9 /source | |
parent | 46ac770fccf4e984cbbf8aa874c0673c40906d80 (diff) |
Revert "[i1437] [View] Do the sizing based on the desired window width."
This reverts commit 46ac770fccf4e984cbbf8aa874c0673c40906d80.
Diffstat (limited to 'source')
-rw-r--r-- | source/view.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/source/view.c b/source/view.c index 51e4437f..816093b7 100644 --- a/source/view.c +++ b/source/view.c @@ -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); |