diff options
Diffstat (limited to 'src/gui/widgets')
-rw-r--r-- | src/gui/widgets/desktop.cpp | 8 | ||||
-rw-r--r-- | src/gui/widgets/desktop.h | 6 |
2 files changed, 12 insertions, 2 deletions
diff --git a/src/gui/widgets/desktop.cpp b/src/gui/widgets/desktop.cpp index fc66ed93..4b806095 100644 --- a/src/gui/widgets/desktop.cpp +++ b/src/gui/widgets/desktop.cpp @@ -22,6 +22,7 @@ #include "gui/widgets/desktop.h" #include "gui/palette.h" +#include "gui/widgets/label.h" #include "resources/image.h" #include "resources/resourcemanager.h" @@ -29,6 +30,7 @@ #include "graphics.h" #include "log.h" +#include "main.h" Desktop::Desktop() : mWallpaper(0) @@ -36,12 +38,16 @@ Desktop::Desktop() addWidgetListener(this); Wallpaper::loadWallpapers(); + + versionLabel = new Label(Main::version); + add(versionLabel, 25, 2); } Desktop::~Desktop() { if (mWallpaper) mWallpaper->decRef(); + delete versionLabel; } void Desktop::reloadWallpaper() @@ -73,6 +79,8 @@ void Desktop::draw(gcn::Graphics *graphics) (getWidth() - mWallpaper->getWidth()) / 2, (getHeight() - mWallpaper->getHeight()) / 2); } + + drawChildren(graphics); } void Desktop::setBestFittingWallpaper() diff --git a/src/gui/widgets/desktop.h b/src/gui/widgets/desktop.h index ed68145a..7eabde54 100644 --- a/src/gui/widgets/desktop.h +++ b/src/gui/widgets/desktop.h @@ -22,10 +22,11 @@ #ifndef DESKTOP_H #define DESKTOP_H -#include <guichan/widget.hpp> +#include <guichan/widgets/container.hpp> #include <guichan/widgetlistener.hpp> class Image; +class Label; /** * Desktop widget, for drawing a background image and color. @@ -38,7 +39,7 @@ class Image; * * \ingroup GUI */ -class Desktop : public gcn::Widget, gcn::WidgetListener +class Desktop : public gcn::Container, gcn::WidgetListener { public: Desktop(); @@ -57,6 +58,7 @@ class Desktop : public gcn::Widget, gcn::WidgetListener void setBestFittingWallpaper(); Image *mWallpaper; + Label *versionLabel; }; #endif // DESKTOP_H |