فهرست منبع

LibGUI: Desktop, add methods for set background color and wallpaper mode

Hüseyin ASLITÜRK 5 سال پیش
والد
کامیت
f88b90f6fd
2فایلهای تغییر یافته به همراه14 افزوده شده و 0 حذف شده
  1. 10 0
      Libraries/LibGUI/Desktop.cpp
  2. 4 0
      Libraries/LibGUI/Desktop.h

+ 10 - 0
Libraries/LibGUI/Desktop.cpp

@@ -54,6 +54,16 @@ void Desktop::did_receive_screen_rect(Badge<WindowServerConnection>, const Gfx::
         on_rect_change(rect);
         on_rect_change(rect);
 }
 }
 
 
+void Desktop::set_background_color(const StringView& background_color)
+{
+    WindowServerConnection::the().post_message(Messages::WindowServer::SetBackgroundColor(background_color));
+}
+
+void Desktop::set_wallpaper_mode(const StringView& mode)
+{
+    WindowServerConnection::the().post_message(Messages::WindowServer::SetWallpaperMode(mode));
+}
+
 bool Desktop::set_wallpaper(const StringView& path)
 bool Desktop::set_wallpaper(const StringView& path)
 {
 {
     WindowServerConnection::the().post_message(Messages::WindowServer::AsyncSetWallpaper(path));
     WindowServerConnection::the().post_message(Messages::WindowServer::AsyncSetWallpaper(path));

+ 4 - 0
Libraries/LibGUI/Desktop.h

@@ -38,6 +38,10 @@ public:
     static Desktop& the();
     static Desktop& the();
     Desktop();
     Desktop();
 
 
+    void set_background_color(const StringView& background_color);
+
+    void set_wallpaper_mode(const StringView& mode);
+
     String wallpaper() const;
     String wallpaper() const;
     bool set_wallpaper(const StringView& path);
     bool set_wallpaper(const StringView& path);