From 0c8c3d955b1a481f6900723ad8f43d074190aa7d Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 19 Jun 2017 19:59:48 +0300 Subject: Use staticbrowserbox in desktop. --- src/Makefile.am | 4 ++-- src/gui/widgets/desktop.cpp | 11 ++++++----- src/gui/widgets/desktop.h | 4 ++-- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index aeb1e2624..49f46db70 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -246,6 +246,8 @@ BASE_SRC += events/actionevent.h \ gui/models/colorlistmodel.h \ gui/widgets/browserbox.cpp \ gui/widgets/browserbox.h \ + gui/widgets/staticbrowserbox.cpp \ + gui/widgets/staticbrowserbox.h \ gui/widgets/button.cpp \ gui/widgets/button.h \ gui/widgets/chatinput.h \ @@ -1106,8 +1108,6 @@ SRC = ${BASE_SRC} \ gui/widgets/itemshortcutcontainer.h \ gui/widgets/spellshortcutcontainer.cpp \ gui/widgets/spellshortcutcontainer.h \ - gui/widgets/staticbrowserbox.cpp \ - gui/widgets/staticbrowserbox.h \ gui/widgets/statspage.cpp \ gui/widgets/statspage.h \ gui/widgets/statspagebasic.cpp \ diff --git a/src/gui/widgets/desktop.cpp b/src/gui/widgets/desktop.cpp index a1111b7ae..87eb14c48 100644 --- a/src/gui/widgets/desktop.cpp +++ b/src/gui/widgets/desktop.cpp @@ -26,7 +26,7 @@ #include "gui/skin.h" -#include "gui/widgets/browserbox.h" +#include "gui/widgets/staticbrowserbox.h" #include "input/inputmanager.h" @@ -52,7 +52,7 @@ Desktop::Desktop(const Widget2 *const widget) : LinkHandler(), WidgetListener(), mWallpaper(nullptr), - mVersionLabel(new BrowserBox(this, BrowserBoxMode::AUTO_WRAP, Opaque_false, + mVersionLabel(new StaticBrowserBox(this, Opaque_false, "browserbox.xml")), mSkin(nullptr), mBackgroundGrayColor(getThemeColor(ThemeColorId::BACKGROUND_GRAY)), @@ -83,6 +83,7 @@ Desktop::Desktop(const Widget2 *const widget) : mVersionLabel->addRow("copyright", "(C) ManaPlus developers, http://manaplus.org"); mVersionLabel->setLinkHandler(this); + mVersionLabel->updateHeight(); } Desktop::~Desktop() @@ -101,8 +102,8 @@ void Desktop::postInit() if (mSkin != nullptr) { addXY(mVersionLabel, - mSkin->getOption("versionX", 25), - mSkin->getOption("versionY", 2)); + mSkin->getOption("versionX", 25), + mSkin->getOption("versionY", 2)); } else { @@ -119,7 +120,7 @@ void Desktop::reloadWallpaper() void Desktop::widgetResized(const Event &event A_UNUSED) { mVersionLabel->setSize(getWidth(), getHeight()); - mVersionLabel->updateSize(true); + mVersionLabel->updateHeight(); setBestFittingWallpaper(); } diff --git a/src/gui/widgets/desktop.h b/src/gui/widgets/desktop.h index 0a7ecf82d..8a655892d 100644 --- a/src/gui/widgets/desktop.h +++ b/src/gui/widgets/desktop.h @@ -30,7 +30,7 @@ #include "localconsts.h" -class BrowserBox; +class StaticBrowserBox; class Image; class Skin; @@ -77,7 +77,7 @@ class Desktop final : public Container, void setBestFittingWallpaper(); Image *mWallpaper; - BrowserBox *mVersionLabel; + StaticBrowserBox *mVersionLabel; Skin *mSkin; Color mBackgroundGrayColor; bool mShowBackground; -- cgit v1.2.3-70-g09d2