mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
WindowServer: Rename WallpaperMode::{Scaled => Stretch}
This option was renamed from scaled to stretch in DisplaySettings in
699ba84
, but since WindowServer receives a plain string and was not
updated, it wouldn't recognize the new renamed value as a valid option.
Turns out sending plain strings via IPC and only mapping them to enum
values on the receiving end is brittle, we should probably update
Desktop::set_wallpaper_mode() to use an enum as well at some point.
Fixes #5006.
This commit is contained in:
parent
cb8e4be3b5
commit
c6726f331e
Notes:
sideshowbarker
2024-07-18 23:03:09 +09:00
Author: https://github.com/linusg Commit: https://github.com/SerenityOS/serenity/commit/c6726f331ea Pull-request: https://github.com/SerenityOS/serenity/pull/5011 Issue: https://github.com/SerenityOS/serenity/issues/5006
2 changed files with 4 additions and 4 deletions
|
@ -58,8 +58,8 @@ static WallpaperMode mode_to_enum(const String& name)
|
|||
return WallpaperMode::Tile;
|
||||
if (name == "center")
|
||||
return WallpaperMode::Center;
|
||||
if (name == "scaled")
|
||||
return WallpaperMode::Scaled;
|
||||
if (name == "stretch")
|
||||
return WallpaperMode::Stretch;
|
||||
return WallpaperMode::Simple;
|
||||
}
|
||||
|
||||
|
@ -263,7 +263,7 @@ void Compositor::compose()
|
|||
rect, offset);
|
||||
} else if (m_wallpaper_mode == WallpaperMode::Tile) {
|
||||
painter.draw_tiled_bitmap(rect, *m_wallpaper);
|
||||
} else if (m_wallpaper_mode == WallpaperMode::Scaled) {
|
||||
} else if (m_wallpaper_mode == WallpaperMode::Stretch) {
|
||||
float hscale = (float)m_wallpaper->size().width() / (float)ws.size().width();
|
||||
float vscale = (float)m_wallpaper->size().height() / (float)ws.size().height();
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ enum class WallpaperMode {
|
|||
Simple,
|
||||
Tile,
|
||||
Center,
|
||||
Scaled,
|
||||
Stretch,
|
||||
Unchecked
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue