浏览代码

LibGUI: Don't show empty ComboBox windows

thankyouverycool 2 年之前
父节点
当前提交
aa8e7aba42
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      Userland/Libraries/LibGUI/ComboBox.cpp

+ 2 - 0
Userland/Libraries/LibGUI/ComboBox.cpp

@@ -103,6 +103,8 @@ ComboBox::ComboBox()
     m_open_button->set_icon(Gfx::Bitmap::try_load_from_file("/res/icons/16x16/downward-triangle.png"sv).release_value_but_fixme_should_propagate_errors());
     m_open_button->set_focus_policy(GUI::FocusPolicy::NoFocus);
     m_open_button->on_click = [this](auto) {
+        if (!m_list_view->item_count())
+            return;
         if (m_list_window->is_visible())
             close();
         else