mirror of
https://github.com/RGBCube/serenity
synced 2025-05-23 13:25:08 +00:00
WindowServer: Move some menu related functions to MenuManager
This commit is contained in:
parent
6bda3bd8da
commit
6cf49c23d4
4 changed files with 14 additions and 15 deletions
|
@ -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;
|
||||
|
|
|
@ -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; }
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue