瀏覽代碼

LibGUI+WindowServer: Add WindowType:Autocomplete and helpers

thankyouverycool 2 年之前
父節點
當前提交
1718a40ac7

+ 2 - 0
Userland/Libraries/LibGUI/Window.h

@@ -39,6 +39,8 @@ public:
     bool is_blocking() const { return m_window_mode == WindowMode::Blocking; }
     bool is_capturing_input() const { return m_window_mode == WindowMode::CaptureInput; }
 
+    bool is_autocomplete() const { return m_window_type == WindowType::Autocomplete; }
+
     bool is_fullscreen() const { return m_fullscreen; }
     void set_fullscreen(bool);
 

+ 1 - 0
Userland/Services/WindowServer/WindowFrame.cpp

@@ -210,6 +210,7 @@ MultiScaleBitmaps const* WindowFrame::shadow_bitmap() const
         if (!WindowManager::the().system_effects().menu_shadow())
             return nullptr;
         return s_menu_shadow;
+    case WindowType::Autocomplete:
     case WindowType::Tooltip:
         if (!WindowManager::the().system_effects().tooltip_shadow())
             return nullptr;

+ 1 - 0
Userland/Services/WindowServer/WindowManager.cpp

@@ -1424,6 +1424,7 @@ Gfx::IntRect WindowManager::arena_rect_for_type(Screen& screen, WindowType type)
     case WindowType::Applet:
     case WindowType::Notification:
     case WindowType::Popup:
+    case WindowType::Autocomplete:
         return screen.rect();
     default:
         VERIFY_NOT_REACHED();

+ 5 - 1
Userland/Services/WindowServer/WindowManager.h

@@ -511,10 +511,12 @@ inline IterationDecision WindowManager::for_each_visible_window_from_back_to_fro
         return IterationDecision::Break;
     if (for_each_window.template operator()<WindowType::Notification>() == IterationDecision::Break)
         return IterationDecision::Break;
-    if (for_each_window.template operator()<WindowType::Tooltip>() == IterationDecision::Break)
+    if (for_each_window.template operator()<WindowType::Autocomplete>() == 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::Tooltip>() == IterationDecision::Break)
+        return IterationDecision::Break;
     if (for_each_window.template operator()<WindowType::Menu>() == IterationDecision::Break)
         return IterationDecision::Break;
     return for_each_window.template operator()<WindowType::WindowSwitcher>();
@@ -546,6 +548,8 @@ inline IterationDecision WindowManager::for_each_visible_window_from_front_to_ba
         return IterationDecision::Break;
     if (for_each_window.template operator()<WindowType::Popup>() == IterationDecision::Break)
         return IterationDecision::Break;
+    if (for_each_window.template operator()<WindowType::Autocomplete>() == IterationDecision::Break)
+        return IterationDecision::Break;
     if (for_each_window.template operator()<WindowType::Notification>() == IterationDecision::Break)
         return IterationDecision::Break;
     if (for_each_window.template operator()<WindowType::AppletArea>() == IterationDecision::Break)

+ 1 - 0
Userland/Services/WindowServer/WindowType.h

@@ -20,6 +20,7 @@ enum class WindowType {
     Desktop,
     AppletArea,
     Popup,
+    Autocomplete,
     _Count
 };