diff options
author | Dave Davenport <qball@blame.services> | 2021-09-06 22:42:33 +0200 |
---|---|---|
committer | Dave Davenport <qball@blame.services> | 2021-09-06 22:49:45 +0200 |
commit | c33e841574d08b052a56d7b70cef88e32c70bb96 (patch) | |
tree | f8cecf228f572fa4c7e2cc71a4691fda863f3b0d | |
parent | f72fd02db8446c59f5494d7d3d9ce3eca2cc010a (diff) |
[i1437] [View] Do the sizing based on the desired window width.
issue: #1437
-rw-r--r-- | source/view.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/source/view.c b/source/view.c index 816093b7..51e4437f 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, main_window->w); + return widget_get_desired_height(main_window, state->width); } static WidgetTriggerActionResult textbox_button_trigger_action( @@ -1994,8 +1994,6 @@ 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); @@ -2048,11 +2046,7 @@ int rofi_view_error_dialog(const char *msg, int markup) { listview_set_fixed_num_lines(state->list_view); } rofi_view_calculate_window_width(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); + state->height = rofi_view_calculate_height(state); // Calculate window position. rofi_view_calculate_window_position(state); |