mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 14:37:46 +00:00
LibGUI: Make sure combobox list windows can't be moved
This is done by adding a new window type (Popup) and using it for the combobox list window. Other incorrect uses of the Tooltip window type have also been updated to use the new window type.
This commit is contained in:
parent
419eb7ab97
commit
288c46dbdc
6 changed files with 10 additions and 3 deletions
|
@ -146,8 +146,7 @@ Locator::Locator(Core::Object* parent)
|
||||||
};
|
};
|
||||||
|
|
||||||
m_popup_window = GUI::Window::construct(parent);
|
m_popup_window = GUI::Window::construct(parent);
|
||||||
// FIXME: This is obviously not a tooltip window, but it's the closest thing to what we want atm.
|
m_popup_window->set_window_type(GUI::WindowType::Popup);
|
||||||
m_popup_window->set_window_type(GUI::WindowType::Tooltip);
|
|
||||||
m_popup_window->set_rect(0, 0, 500, 200);
|
m_popup_window->set_rect(0, 0, 500, 200);
|
||||||
|
|
||||||
m_suggestion_view = m_popup_window->set_main_widget<GUI::TableView>();
|
m_suggestion_view = m_popup_window->set_main_widget<GUI::TableView>();
|
||||||
|
|
|
@ -88,7 +88,7 @@ AutocompleteBox::AutocompleteBox(TextEditor& editor)
|
||||||
: m_editor(editor)
|
: m_editor(editor)
|
||||||
{
|
{
|
||||||
m_popup_window = GUI::Window::construct(m_editor->window());
|
m_popup_window = GUI::Window::construct(m_editor->window());
|
||||||
m_popup_window->set_window_type(GUI::WindowType::Tooltip);
|
m_popup_window->set_window_type(GUI::WindowType::Popup);
|
||||||
m_popup_window->set_rect(0, 0, 175, 25);
|
m_popup_window->set_rect(0, 0, 175, 25);
|
||||||
|
|
||||||
auto& main_widget = m_popup_window->set_main_widget<GUI::Widget>();
|
auto& main_widget = m_popup_window->set_main_widget<GUI::Widget>();
|
||||||
|
|
|
@ -113,6 +113,7 @@ ComboBox::ComboBox()
|
||||||
};
|
};
|
||||||
|
|
||||||
m_list_window = add<Window>(window());
|
m_list_window = add<Window>(window());
|
||||||
|
m_list_window->set_window_type(GUI::WindowType::Popup);
|
||||||
m_list_window->set_frameless(true);
|
m_list_window->set_frameless(true);
|
||||||
m_list_window->set_window_mode(WindowMode::CaptureInput);
|
m_list_window->set_window_mode(WindowMode::CaptureInput);
|
||||||
m_list_window->on_active_input_change = [this](bool is_active_input) {
|
m_list_window->on_active_input_change = [this](bool is_active_input) {
|
||||||
|
|
|
@ -1421,6 +1421,7 @@ Gfx::IntRect WindowManager::arena_rect_for_type(Screen& screen, WindowType type)
|
||||||
case WindowType::Tooltip:
|
case WindowType::Tooltip:
|
||||||
case WindowType::Applet:
|
case WindowType::Applet:
|
||||||
case WindowType::Notification:
|
case WindowType::Notification:
|
||||||
|
case WindowType::Popup:
|
||||||
return screen.rect();
|
return screen.rect();
|
||||||
default:
|
default:
|
||||||
VERIFY_NOT_REACHED();
|
VERIFY_NOT_REACHED();
|
||||||
|
|
|
@ -302,6 +302,7 @@ public:
|
||||||
switch (window_type) {
|
switch (window_type) {
|
||||||
case WindowType::Normal:
|
case WindowType::Normal:
|
||||||
case WindowType::Tooltip:
|
case WindowType::Tooltip:
|
||||||
|
case WindowType::Popup:
|
||||||
return false;
|
return false;
|
||||||
default:
|
default:
|
||||||
return true;
|
return true;
|
||||||
|
@ -512,6 +513,8 @@ inline IterationDecision WindowManager::for_each_visible_window_from_back_to_fro
|
||||||
return IterationDecision::Break;
|
return IterationDecision::Break;
|
||||||
if (for_each_window.template operator()<WindowType::Tooltip>() == IterationDecision::Break)
|
if (for_each_window.template operator()<WindowType::Tooltip>() == IterationDecision::Break)
|
||||||
return IterationDecision::Break;
|
return IterationDecision::Break;
|
||||||
|
if (for_each_window.template operator()<WindowType::Popup>() == IterationDecision::Break)
|
||||||
|
return IterationDecision::Break;
|
||||||
if (for_each_window.template operator()<WindowType::Menu>() == IterationDecision::Break)
|
if (for_each_window.template operator()<WindowType::Menu>() == IterationDecision::Break)
|
||||||
return IterationDecision::Break;
|
return IterationDecision::Break;
|
||||||
return for_each_window.template operator()<WindowType::WindowSwitcher>();
|
return for_each_window.template operator()<WindowType::WindowSwitcher>();
|
||||||
|
@ -541,6 +544,8 @@ inline IterationDecision WindowManager::for_each_visible_window_from_front_to_ba
|
||||||
return IterationDecision::Break;
|
return IterationDecision::Break;
|
||||||
if (for_each_window.template operator()<WindowType::Tooltip>() == IterationDecision::Break)
|
if (for_each_window.template operator()<WindowType::Tooltip>() == IterationDecision::Break)
|
||||||
return IterationDecision::Break;
|
return IterationDecision::Break;
|
||||||
|
if (for_each_window.template operator()<WindowType::Popup>() == IterationDecision::Break)
|
||||||
|
return IterationDecision::Break;
|
||||||
if (for_each_window.template operator()<WindowType::Notification>() == IterationDecision::Break)
|
if (for_each_window.template operator()<WindowType::Notification>() == IterationDecision::Break)
|
||||||
return IterationDecision::Break;
|
return IterationDecision::Break;
|
||||||
if (for_each_window.template operator()<WindowType::AppletArea>() == IterationDecision::Break)
|
if (for_each_window.template operator()<WindowType::AppletArea>() == IterationDecision::Break)
|
||||||
|
|
|
@ -19,6 +19,7 @@ enum class WindowType {
|
||||||
Notification,
|
Notification,
|
||||||
Desktop,
|
Desktop,
|
||||||
AppletArea,
|
AppletArea,
|
||||||
|
Popup,
|
||||||
_Count
|
_Count
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue