mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 20:42:43 +00:00 
			
		
		
		
	WorkspacePicker: Hide applet if size == 0
This commit is contained in:
		
							parent
							
								
									3ee5bdcfb7
								
							
						
					
					
						commit
						a1ddc44c07
					
				
					 2 changed files with 14 additions and 1 deletions
				
			
		|  | @ -104,6 +104,12 @@ private: | |||
| DesktopStatusWindow::DesktopStatusWindow() | ||||
| { | ||||
|     GUI::Desktop::the().on_receive_screen_rects([&](GUI::Desktop&) { | ||||
|         auto& desktop = GUI::Desktop::the(); | ||||
|         if (desktop.workspace_rows() == 1 && desktop.workspace_columns() == 1) | ||||
|             resize(0, 0); | ||||
|         else | ||||
|             resize(28, 16); | ||||
| 
 | ||||
|         update(); | ||||
|     }); | ||||
|     set_window_type(GUI::WindowType::Applet); | ||||
|  |  | |||
|  | @ -8,6 +8,7 @@ | |||
| #include <LibCore/System.h> | ||||
| #include <LibGUI/Application.h> | ||||
| #include <LibGUI/ConnectionToWindowManagerServer.h> | ||||
| #include <LibGUI/Desktop.h> | ||||
| #include <LibGUI/Painter.h> | ||||
| #include <LibMain/Main.h> | ||||
| #include <WindowServer/Window.h> | ||||
|  | @ -25,7 +26,13 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) | |||
| 
 | ||||
|     auto window = TRY(DesktopStatusWindow::try_create()); | ||||
|     window->set_title("WorkspacePicker"); | ||||
|     window->resize(28, 16); | ||||
| 
 | ||||
|     auto& desktop = GUI::Desktop::the(); | ||||
|     if (desktop.workspace_rows() == 1 && desktop.workspace_columns() == 1) | ||||
|         window->resize(0, 0); | ||||
|     else | ||||
|         window->resize(28, 16); | ||||
| 
 | ||||
|     window->show(); | ||||
|     window->make_window_manager(WindowServer::WMEventMask::WorkspaceChanges); | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Filiph Sandström
						Filiph Sandström