Skip to content

Commit

Permalink
menu: Fix resize in config (#256)
Browse files Browse the repository at this point in the history
  • Loading branch information
trigg authored Aug 23, 2024
1 parent 1a3da99 commit 4f1cfc7
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/panel/widgets/menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -812,6 +812,9 @@ void WayfireMenu::init(Gtk::HBox *container)

menu_icon.set_callback([=] () { update_icon(); });
menu_size.set_callback([=] () { update_icon(); });
menu_min_category_width.set_callback([=] () { update_category_width(); });
menu_min_content_height.set_callback([=] () { update_content_height(); });
menu_min_content_width.set_callback([=] () { update_content_width(); });
panel_position.set_callback([=] () { update_popover_layout(); });
menu_show_categories.set_callback([=] () { update_popover_layout(); });
menu_list.set_callback([=] () { update_popover_layout(); });
Expand Down Expand Up @@ -877,6 +880,22 @@ void WayfireMenu::init(Gtk::HBox *container)
button->show();
}

void WayfireMenu::update_category_width()
{
category_scrolled_window.set_min_content_width(int(menu_min_category_width));
}

void WayfireMenu::update_content_height()
{
category_scrolled_window.set_min_content_height(int(menu_min_content_height));
app_scrolled_window.set_min_content_height(int(menu_min_content_height));
}

void WayfireMenu::update_content_width()
{
app_scrolled_window.set_min_content_width(int(menu_min_content_width));
}

void WayfireMenu::toggle_menu()
{
if (button->get_active())
Expand Down
3 changes: 3 additions & 0 deletions src/panel/widgets/menu.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,9 @@ class WayfireMenu : public WayfireWidget
WfOption<int> menu_min_content_height{"panel/menu_min_content_height"};
WfOption<bool> menu_show_categories{"panel/menu_show_categories"};
void update_popover_layout();
void update_category_width();
void update_content_height();
void update_content_width();
void create_logout_ui();
void on_logout_click();
void key_press_search();
Expand Down

0 comments on commit 4f1cfc7

Please sign in to comment.