1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 23:17:45 +00:00

WindowServer+LibGfx: Automatic "modified" markers in window titles

You can now add the string "[*]" to a window title and it will be
replaced with " (*)" if the window is modified, and with "" otherwise.
This commit is contained in:
Andreas Kling 2021-05-01 19:01:43 +02:00
parent e9c40b0243
commit 20dd5735ce
7 changed files with 13 additions and 10 deletions

View file

@ -76,7 +76,7 @@ void Canvas::paint_event(GUI::PaintEvent& event)
void Canvas::draw(Gfx::Painter& painter)
{
auto active_window_icon = Gfx::Bitmap::load_from_file("/res/icons/16x16/window.png");
Gfx::WindowTheme::current().paint_normal_frame(painter, Gfx::WindowTheme::WindowState::Active, { 4, 18, WIDTH - 8, HEIGHT - 29 }, "Well hello friends 🐞", *active_window_icon, palette(), { WIDTH - 20, 6, 16, 16 }, 0);
Gfx::WindowTheme::current().paint_normal_frame(painter, Gfx::WindowTheme::WindowState::Active, { 4, 18, WIDTH - 8, HEIGHT - 29 }, "Well hello friends 🐞", *active_window_icon, palette(), { WIDTH - 20, 6, 16, 16 }, 0, false);
painter.draw_rect({ 20, 34, WIDTH - 40, HEIGHT - 45 }, palette().color(Gfx::ColorRole::Selection), true);
painter.draw_rect({ 24, 38, WIDTH - 48, HEIGHT - 53 }, palette().color(Gfx::ColorRole::Selection));