diff options
author | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2025-05-01 08:08:15 +0200 |
---|---|---|
committer | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2025-08-12 12:26:44 +0200 |
commit | 6773f3a2cdd5db4ee161b7eb9d2fd9bba4b73783 (patch) | |
tree | aeaab1e3d1ead74e0187cfcb3537ed7c3b781d36 | |
parent | a67947441fa5f486ad5a460133f2b43808d09423 (diff) | |
download | mana-master.tar.gz mana-master.tar.bz2 mana-master.tar.xz mana-master.zip |
Replaces the default login wallpaper. The wallpaper can still be set
either through branding or in the client data.
This also fixes the scaling of the Manasource logo when using the Mana
theme.
Closes #99
-rw-r--r-- | data/graphics/gui/jewelry/theme.xml | 6 | ||||
-rw-r--r-- | data/graphics/gui/login_wallpaper.png (renamed from data/graphics/images/login_wallpaper.png) | bin | 10948 -> 10948 bytes | |||
-rw-r--r-- | data/graphics/gui/theme.xml | 6 | ||||
-rw-r--r-- | src/gui/widgets/desktop.cpp | 16 | ||||
-rw-r--r-- | src/resources/theme.cpp | 1 | ||||
-rw-r--r-- | src/resources/theme.h | 1 | ||||
-rw-r--r-- | src/resources/wallpaper.cpp | 1 |
7 files changed, 21 insertions, 10 deletions
diff --git a/data/graphics/gui/jewelry/theme.xml b/data/graphics/gui/jewelry/theme.xml index 2b4911de..d95d07d5 100644 --- a/data/graphics/gui/jewelry/theme.xml +++ b/data/graphics/gui/jewelry/theme.xml @@ -281,6 +281,12 @@ </state> </skin> + <skin type="Desktop"> + <state> + <rect color="#5a5044" /> + </state> + </skin> + <skin type="Button" padding="7"> <state disabled="true"> <text color="#aaaaaa" outlineColor="#000000"/> diff --git a/data/graphics/images/login_wallpaper.png b/data/graphics/gui/login_wallpaper.png Binary files differindex 109acccd..109acccd 100644 --- a/data/graphics/images/login_wallpaper.png +++ b/data/graphics/gui/login_wallpaper.png diff --git a/data/graphics/gui/theme.xml b/data/graphics/gui/theme.xml index fc1de9e3..5a0408f7 100644 --- a/data/graphics/gui/theme.xml +++ b/data/graphics/gui/theme.xml @@ -91,6 +91,12 @@ </state> </skin> + <skin type="Desktop"> + <state> + <img src="login_wallpaper.png" left="258" right="34" top="143" bottom="22" /> + </state> + </skin> + <skin type="Button" padding="4"> <state disabled="true"> <text color="#333333" /> diff --git a/src/gui/widgets/desktop.cpp b/src/gui/widgets/desktop.cpp index b21c235a..aae78335 100644 --- a/src/gui/widgets/desktop.cpp +++ b/src/gui/widgets/desktop.cpp @@ -69,24 +69,20 @@ void Desktop::draw(gcn::Graphics *graphics) { auto *g = static_cast<Graphics *>(graphics); - if (!mWallpaper || (getWidth() > mWallpaper->getWidth() || - getHeight() > mWallpaper->getHeight())) - { - // TODO: Color from palette - g->setColor(gcn::Color(64, 64, 64)); - g->fillRectangle(gcn::Rectangle(0, 0, getWidth(), getHeight())); - } - if (mWallpaper) { g->drawRescaledImage(mWallpaper, 0, 0, 0, 0, mWallpaper->getWidth(), mWallpaper->getHeight(), getWidth(), getHeight(), false); } + else + { + gui->getTheme()->drawSkin(g, SkinType::Desktop, WidgetState(this)); + } - // Draw a thin border under the application version... + // Draw a background beneath the application version for readability... g->setColor(gcn::Color(255, 255, 255, 128)); - g->fillRectangle(gcn::Rectangle(mVersionLabel->getDimension())); + g->fillRectangle(mVersionLabel->getDimension()); Container::draw(graphics); } diff --git a/src/resources/theme.cpp b/src/resources/theme.cpp index 0c332902..ea2cef45 100644 --- a/src/resources/theme.cpp +++ b/src/resources/theme.cpp @@ -529,6 +529,7 @@ static std::optional<SkinType> readSkinType(std::string_view type) if (type == "ToolWindow") return SkinType::ToolWindow; if (type == "Popup") return SkinType::Popup; if (type == "SpeechBubble") return SkinType::SpeechBubble; + if (type == "Desktop") return SkinType::Desktop; if (type == "Button") return SkinType::Button; if (type == "ButtonUp") return SkinType::ButtonUp; if (type == "ButtonDown") return SkinType::ButtonDown; diff --git a/src/resources/theme.h b/src/resources/theme.h index fbcb263b..80b78fdd 100644 --- a/src/resources/theme.h +++ b/src/resources/theme.h @@ -71,6 +71,7 @@ enum class SkinType ToolWindow, Popup, SpeechBubble, + Desktop, Button, ButtonUp, ButtonDown, diff --git a/src/resources/wallpaper.cpp b/src/resources/wallpaper.cpp index 2bdcd656..ece3e950 100644 --- a/src/resources/wallpaper.cpp +++ b/src/resources/wallpaper.cpp @@ -87,6 +87,7 @@ bool wallpaperCompare(const WallpaperData &a, const WallpaperData &b) void Wallpaper::loadWallpapers() { wallpaperData.clear(); + haveBackup = false; initWallpaperPaths(); |