diff options
author | Bjørn <bjorn@horst-dieter.(none)> | 2009-04-12 19:04:20 +0200 |
---|---|---|
committer | Bjørn <bjorn@horst-dieter.(none)> | 2009-04-12 19:06:38 +0200 |
commit | 9f5b89189f00c959882f86067634a512e6970614 (patch) | |
tree | 8964803d49528d35585f1fb26f8f22e3c7353a52 /src/gui/widgets | |
parent | a6998fbdfaf84aa1920564d97e3421ed28c9a893 (diff) | |
download | mana-9f5b89189f00c959882f86067634a512e6970614.tar.gz mana-9f5b89189f00c959882f86067634a512e6970614.tar.bz2 mana-9f5b89189f00c959882f86067634a512e6970614.tar.xz mana-9f5b89189f00c959882f86067634a512e6970614.zip |
Moved client version string creation to preprocessor
Diffstat (limited to 'src/gui/widgets')
-rw-r--r-- | src/gui/widgets/container.cpp | 5 | ||||
-rw-r--r-- | src/gui/widgets/container.h | 11 | ||||
-rw-r--r-- | src/gui/widgets/desktop.cpp | 5 | ||||
-rw-r--r-- | src/gui/widgets/desktop.h | 9 |
4 files changed, 20 insertions, 10 deletions
diff --git a/src/gui/widgets/container.cpp b/src/gui/widgets/container.cpp index 10ef78a5..70731730 100644 --- a/src/gui/widgets/container.cpp +++ b/src/gui/widgets/container.cpp @@ -21,6 +21,11 @@ #include "gui/widgets/container.h" +Container::Container() +{ + setOpaque(false); +} + Container::~Container() { while (!mWidgets.empty()) diff --git a/src/gui/widgets/container.h b/src/gui/widgets/container.h index a6d1610e..dd286609 100644 --- a/src/gui/widgets/container.h +++ b/src/gui/widgets/container.h @@ -25,13 +25,18 @@ #include <guichan/widgets/container.hpp> /** - * A widget container. The only difference between the standard Guichan - * container and this one is that childs added to this container are - * automatically deleted when the container is deleted. + * A widget container. + * + * The main difference between the standard Guichan container and this one is + * that childs added to this container are automatically deleted when the + * container is deleted. + * + * This container is also non-opaque by default. */ class Container : public gcn::Container { public: + Container(); ~Container(); }; diff --git a/src/gui/widgets/desktop.cpp b/src/gui/widgets/desktop.cpp index 4b806095..a4164bcc 100644 --- a/src/gui/widgets/desktop.cpp +++ b/src/gui/widgets/desktop.cpp @@ -39,7 +39,7 @@ Desktop::Desktop() Wallpaper::loadWallpapers(); - versionLabel = new Label(Main::version); + gcn::Label *versionLabel = new Label(FULL_VERSION); add(versionLabel, 25, 2); } @@ -47,7 +47,6 @@ Desktop::~Desktop() { if (mWallpaper) mWallpaper->decRef(); - delete versionLabel; } void Desktop::reloadWallpaper() @@ -80,7 +79,7 @@ void Desktop::draw(gcn::Graphics *graphics) (getHeight() - mWallpaper->getHeight()) / 2); } - drawChildren(graphics); + Container::draw(graphics); } void Desktop::setBestFittingWallpaper() diff --git a/src/gui/widgets/desktop.h b/src/gui/widgets/desktop.h index 7eabde54..ad04ee96 100644 --- a/src/gui/widgets/desktop.h +++ b/src/gui/widgets/desktop.h @@ -22,11 +22,11 @@ #ifndef DESKTOP_H #define DESKTOP_H -#include <guichan/widgets/container.hpp> +#include "gui/widgets/container.h" + #include <guichan/widgetlistener.hpp> class Image; -class Label; /** * Desktop widget, for drawing a background image and color. @@ -37,9 +37,11 @@ class Label; * When the desktop widget is resized, the background image is automatically * updated. * + * The desktop also displays the client version in the top-right corner. + * * \ingroup GUI */ -class Desktop : public gcn::Container, gcn::WidgetListener +class Desktop : public Container, gcn::WidgetListener { public: Desktop(); @@ -58,7 +60,6 @@ class Desktop : public gcn::Container, gcn::WidgetListener void setBestFittingWallpaper(); Image *mWallpaper; - Label *versionLabel; }; #endif // DESKTOP_H |