mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 07:52:45 +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; |     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() | void MenuManager::draw() | ||||||
| { | { | ||||||
|     auto& wm = WindowManager::the(); |     auto& wm = WindowManager::the(); | ||||||
|  | @ -246,7 +256,7 @@ void MenuManager::draw() | ||||||
|         painter.draw_text( |         painter.draw_text( | ||||||
|             menu.text_rect_in_menubar(), |             menu.text_rect_in_menubar(), | ||||||
|             menu.name(), |             menu.name(), | ||||||
|             index == 1 ? wm.app_menu_font() : wm.menu_font(), |             index == 1 ? app_menu_font() : menu_font(), | ||||||
|             Gfx::TextAlignment::CenterLeft, |             Gfx::TextAlignment::CenterLeft, | ||||||
|             text_color); |             text_color); | ||||||
|         ++index; |         ++index; | ||||||
|  |  | ||||||
|  | @ -90,6 +90,9 @@ public: | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
| private: | private: | ||||||
|  |     const Gfx::Font& menu_font() const; | ||||||
|  |     const Gfx::Font& app_menu_font() const; | ||||||
|  | 
 | ||||||
|     void close_menus(const Vector<Menu*>&); |     void close_menus(const Vector<Menu*>&); | ||||||
| 
 | 
 | ||||||
|     Window& window() { return *m_window; } |     Window& window() { return *m_window; } | ||||||
|  |  | ||||||
|  | @ -130,16 +130,6 @@ const Gfx::Font& WindowManager::window_title_font() const | ||||||
|     return Gfx::Font::default_bold_font(); |     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) | void WindowManager::set_resolution(int width, int height) | ||||||
| { | { | ||||||
|     Compositor::the().set_resolution(width, height); |     Compositor::the().set_resolution(width, height); | ||||||
|  |  | ||||||
|  | @ -142,10 +142,6 @@ public: | ||||||
| 
 | 
 | ||||||
|     const Gfx::Font& font() const; |     const Gfx::Font& font() const; | ||||||
|     const Gfx::Font& window_title_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); |     void set_resolution(int width, int height); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Andreas Kling
						Andreas Kling