From 7bc30f545784b26594803b559f1d76d5434027ea Mon Sep 17 00:00:00 2001 From: Bertram Date: Sun, 26 Jul 2009 22:34:34 +0200 Subject: Fixed a '+' string operation, and attempt to resolve the Mantis 427. --- src/gui/widgets/desktop.cpp | 19 ++++++++++++++++++- src/gui/widgets/desktop.h | 3 ++- 2 files changed, 20 insertions(+), 2 deletions(-) (limited to 'src/gui/widgets') diff --git a/src/gui/widgets/desktop.cpp b/src/gui/widgets/desktop.cpp index 6633d2ce..4583ef13 100644 --- a/src/gui/widgets/desktop.cpp +++ b/src/gui/widgets/desktop.cpp @@ -32,6 +32,9 @@ #include "log.h" #include "main.h" +#define VERSION_LABEL_X 25 +#define VERSION_LABEL_Y 2 + Desktop::Desktop() : mWallpaper(0) { @@ -40,7 +43,16 @@ Desktop::Desktop() Wallpaper::loadWallpapers(); gcn::Label *versionLabel = new Label(FULL_VERSION); - add(versionLabel, 25, 2); + add(versionLabel, VERSION_LABEL_X, VERSION_LABEL_Y); + + mVersionRectangle.x = VERSION_LABEL_X; + mVersionRectangle.y = VERSION_LABEL_Y; + mVersionRectangle.width = versionLabel->getWidth(); + mVersionRectangle.height = versionLabel->getHeight(); + + // Loads a white pattern and make it translucent... + mVersionBorder = Image::getColoredPattern(0xFF, 0xFF, 0xFF); + mVersionBorder->setAlpha(0.5f); } Desktop::~Desktop() @@ -84,6 +96,11 @@ void Desktop::draw(gcn::Graphics *graphics) getWidth(), getHeight(), false); } + // Draw a thin border under the application version... + g->drawImagePattern(mVersionBorder, mVersionRectangle.x, mVersionRectangle.y, + mVersionRectangle.width, + mVersionRectangle.height); + Container::draw(graphics); } diff --git a/src/gui/widgets/desktop.h b/src/gui/widgets/desktop.h index ad04ee96..267acead 100644 --- a/src/gui/widgets/desktop.h +++ b/src/gui/widgets/desktop.h @@ -59,7 +59,8 @@ class Desktop : public Container, gcn::WidgetListener private: void setBestFittingWallpaper(); - Image *mWallpaper; + Image *mWallpaper, *mVersionBorder; + gcn::Rectangle mVersionRectangle; }; #endif // DESKTOP_H -- cgit v1.2.3-70-g09d2