diff options
author | Cubic Love <7754483+cubiclove@users.noreply.github.com> | 2023-04-11 18:20:03 +0100 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2023-04-12 19:34:27 +0200 |
commit | c6af248909ba9ea3fbd9008dcb3e145f813bd891 (patch) | |
tree | a1f378e882d4c06557ce3b48586aeee527e7021e /Userland/Demos | |
parent | 97dc2d1dd5e981fe3751cd4e8bb3f576fb1f7472 (diff) | |
download | serenity-c6af248909ba9ea3fbd9008dcb3e145f813bd891.zip |
Demos: Rename GradientScreensaver to Gradient
This brings the name in-line with the naming convention used by the
other screensavers 'Starfield' and 'Tubes'.
Diffstat (limited to 'Userland/Demos')
-rw-r--r-- | Userland/Demos/CMakeLists.txt | 2 | ||||
-rw-r--r-- | Userland/Demos/Gradient/CMakeLists.txt | 11 | ||||
-rw-r--r-- | Userland/Demos/Gradient/Gradient.cpp (renamed from Userland/Demos/GradientScreensaver/GradientScreensaver.cpp) | 26 | ||||
-rw-r--r-- | Userland/Demos/GradientScreensaver/CMakeLists.txt | 11 |
4 files changed, 25 insertions, 25 deletions
diff --git a/Userland/Demos/CMakeLists.txt b/Userland/Demos/CMakeLists.txt index 4e9c4569e7..411133ae04 100644 --- a/Userland/Demos/CMakeLists.txt +++ b/Userland/Demos/CMakeLists.txt @@ -1,6 +1,6 @@ add_subdirectory(CatDog) add_subdirectory(Eyes) -add_subdirectory(GradientScreensaver) +add_subdirectory(Gradient) add_subdirectory(LibGfxDemo) add_subdirectory(LibGfxScaleDemo) add_subdirectory(Mandelbrot) diff --git a/Userland/Demos/Gradient/CMakeLists.txt b/Userland/Demos/Gradient/CMakeLists.txt new file mode 100644 index 0000000000..8c02bd89c2 --- /dev/null +++ b/Userland/Demos/Gradient/CMakeLists.txt @@ -0,0 +1,11 @@ +serenity_component( + Gradient + TARGETS Gradient +) + +set(SOURCES + Gradient.cpp +) + +serenity_app(Gradient ICON app-screensaver) +target_link_libraries(Gradient PRIVATE LibDesktop LibGUI LibCore LibGfx LibMain) diff --git a/Userland/Demos/GradientScreensaver/GradientScreensaver.cpp b/Userland/Demos/Gradient/Gradient.cpp index a5259ffd7e..77a1f61950 100644 --- a/Userland/Demos/GradientScreensaver/GradientScreensaver.cpp +++ b/Userland/Demos/Gradient/Gradient.cpp @@ -17,13 +17,13 @@ #include <time.h> #include <unistd.h> -class Screensaver final : public Desktop::Screensaver { - C_OBJECT(Screensaver) +class Gradient final : public Desktop::Screensaver { + C_OBJECT(Gradient) public: - virtual ~Screensaver() override = default; + virtual ~Gradient() override = default; private: - Screensaver(int width = 64, int height = 48, int interval = 10000); + Gradient(int width = 64, int height = 48, int interval = 10000); RefPtr<Gfx::Bitmap> m_bitmap; void draw(); @@ -31,7 +31,7 @@ private: virtual void timer_event(Core::TimerEvent&) override; }; -Screensaver::Screensaver(int width, int height, int interval) +Gradient::Gradient(int width, int height, int interval) { on_screensaver_exit = []() { GUI::Application::the()->quit(); }; m_bitmap = Gfx::Bitmap::create(Gfx::BitmapFormat::BGRx8888, { width, height }).release_value_but_fixme_should_propagate_errors(); @@ -41,20 +41,20 @@ Screensaver::Screensaver(int width, int height, int interval) draw(); } -void Screensaver::paint_event(GUI::PaintEvent& event) +void Gradient::paint_event(GUI::PaintEvent& event) { GUI::Painter painter(*this); painter.add_clip_rect(event.rect()); painter.draw_scaled_bitmap(rect(), *m_bitmap, m_bitmap->rect()); } -void Screensaver::timer_event(Core::TimerEvent&) +void Gradient::timer_event(Core::TimerEvent&) { draw(); update(); } -void Screensaver::draw() +void Gradient::draw() { const Color colors[] { Color::Blue, @@ -95,12 +95,12 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) TRY(Core::System::unveil("/res", "r")); TRY(Core::System::unveil(nullptr, nullptr)); - auto window = TRY(Desktop::Screensaver::create_window("Screensaver"sv, "app-screensaver"sv)); + auto window = TRY(Desktop::Screensaver::create_window("Gradient"sv, "app-screensaver"sv)); - auto screensaver_window = TRY(window->set_main_widget<Screensaver>(64, 48, 10000)); - screensaver_window->set_fill_with_background_color(false); - screensaver_window->set_override_cursor(Gfx::StandardCursor::Hidden); - screensaver_window->update(); + auto gradient_widget = TRY(window->set_main_widget<Gradient>(64, 48, 10000)); + gradient_widget->set_fill_with_background_color(false); + gradient_widget->set_override_cursor(Gfx::StandardCursor::Hidden); + gradient_widget->update(); window->show(); window->move_to_front(); diff --git a/Userland/Demos/GradientScreensaver/CMakeLists.txt b/Userland/Demos/GradientScreensaver/CMakeLists.txt deleted file mode 100644 index d46b533947..0000000000 --- a/Userland/Demos/GradientScreensaver/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -serenity_component( - GradientScreensaver - TARGETS GradientScreensaver -) - -set(SOURCES - GradientScreensaver.cpp -) - -serenity_app(GradientScreensaver ICON app-screensaver) -target_link_libraries(GradientScreensaver PRIVATE LibDesktop LibGUI LibCore LibGfx LibMain) |