dropped = false;
add(list);
+ list.set_visible(false);
list.set_view_all();
list.signal_item_selected.connect(sigc::mem_fun(this, &Dropdown::list_item_selected));
list.signal_autosize_changed.connect(sigc::mem_fun(this, &Dropdown::list_autosize_changed));
if(!click_focus)
{
dropped = false;
+ list.set_visible(false);
clear_state(ACTIVE);
signal_ungrab_pointer.emit();
}
else if(btn==1)
{
dropped = true;
+ list.set_visible(true);
resize_list();
set_state(ACTIVE);
signal_grab_pointer.emit();
void Dropdown::on_geometry_change()
{
- resize_list();
+ if(dropped)
+ resize_list();
}
void Dropdown::on_style_change()
{
text.set_style(style);
- resize_list();
+ if(dropped)
+ resize_list();
}
void Dropdown::list_autosize_changed()
{
- resize_list();
+ if(dropped)
+ resize_list();
signal_autosize_changed.emit();
}