فهرست منبع

WindowServer: Move some menu related functions to MenuManager

Andreas Kling 5 سال پیش
والد
کامیت
6cf49c23d4

+ 11 - 1
Servers/WindowServer/MenuManager.cpp

@@ -198,6 +198,16 @@ bool MenuManager::is_open(const Menu& menu) const
     return false;
 }
 
+const Gfx::Font& MenuManager::menu_font() const
+{
+    return Gfx::Font::default_font();
+}
+
+const Gfx::Font& MenuManager::app_menu_font() const
+{
+    return Gfx::Font::default_bold_font();
+}
+
 void MenuManager::draw()
 {
     auto& wm = WindowManager::the();
@@ -246,7 +256,7 @@ void MenuManager::draw()
         painter.draw_text(
             menu.text_rect_in_menubar(),
             menu.name(),
-            index == 1 ? wm.app_menu_font() : wm.menu_font(),
+            index == 1 ? app_menu_font() : menu_font(),
             Gfx::TextAlignment::CenterLeft,
             text_color);
         ++index;

+ 3 - 0
Servers/WindowServer/MenuManager.h

@@ -90,6 +90,9 @@ public:
     }
 
 private:
+    const Gfx::Font& menu_font() const;
+    const Gfx::Font& app_menu_font() const;
+
     void close_menus(const Vector<Menu*>&);
 
     Window& window() { return *m_window; }

+ 0 - 10
Servers/WindowServer/WindowManager.cpp

@@ -130,16 +130,6 @@ const Gfx::Font& WindowManager::window_title_font() const
     return Gfx::Font::default_bold_font();
 }
 
-const Gfx::Font& WindowManager::menu_font() const
-{
-    return Gfx::Font::default_font();
-}
-
-const Gfx::Font& WindowManager::app_menu_font() const
-{
-    return Gfx::Font::default_bold_font();
-}
-
 void WindowManager::set_resolution(int width, int height)
 {
     Compositor::the().set_resolution(width, height);

+ 0 - 4
Servers/WindowServer/WindowManager.h

@@ -142,10 +142,6 @@ public:
 
     const Gfx::Font& font() const;
     const Gfx::Font& window_title_font() const;
-    const Gfx::Font& menu_font() const;
-    const Gfx::Font& app_menu_font() const;
-
-    int menubar_menu_margin() const;
 
     void set_resolution(int width, int height);