diff options
author | Socapex <philippe_groarke@yahoo.ca> | 2013-03-12 15:40:00 -0400 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-03-12 23:22:36 +0300 |
commit | e74f40d96ed90750dd917d777a8621416084f019 (patch) | |
tree | 012d9541e2cf0140e0bce6e4bce2b89a10bda824 /src/gui | |
parent | 72d99267699fa38d3af1ea8e538eacc4e5d42acc (diff) | |
download | manaplus-e74f40d96ed90750dd917d777a8621416084f019.tar.gz manaplus-e74f40d96ed90750dd917d777a8621416084f019.tar.bz2 manaplus-e74f40d96ed90750dd917d777a8621416084f019.tar.xz manaplus-e74f40d96ed90750dd917d777a8621416084f019.zip |
Moved Did you know to Help window.
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/helpwindow.cpp | 18 | ||||
-rw-r--r-- | src/gui/helpwindow.h | 3 | ||||
-rw-r--r-- | src/gui/windowmenu.cpp | 2 |
3 files changed, 18 insertions, 5 deletions
diff --git a/src/gui/helpwindow.cpp b/src/gui/helpwindow.cpp index 1e73e658d..cacac99d1 100644 --- a/src/gui/helpwindow.cpp +++ b/src/gui/helpwindow.cpp @@ -24,6 +24,7 @@ #include "configuration.h" +#include "gui/didyouknowwindow.h" #include "gui/gui.h" #include "gui/sdlfont.h" #include "gui/setup.h" @@ -47,6 +48,7 @@ HelpWindow::HelpWindow(): Window(_("Help"), false, nullptr, "help.xml"), gcn::ActionListener(), + mDYKButton(new Button(this, _("Did you know..."), "DYK", this)), mBrowserBox(new BrowserBox(this)), mScrollArea(new ScrollArea(mBrowserBox, true, "help_background.xml")) { @@ -54,6 +56,7 @@ HelpWindow::HelpWindow(): setMinHeight(220); setContentSize(455, 350); setWindowName("Help"); + setCloseButton(true); setResizable(true); setStickyButtonLock(true); @@ -62,15 +65,14 @@ HelpWindow::HelpWindow(): setDefaultSize(500, 400, ImageRect::CENTER); mBrowserBox->setOpaque(false); - Button *const okButton = new Button(this, _("Close"), "close", this); mBrowserBox->setLinkHandler(this); mBrowserBox->setFont(gui->getHelpFont()); mBrowserBox->setProcessVersion(true); mBrowserBox->setEnableImages(true); + place(4, 3, mDYKButton); place(0, 0, mScrollArea, 5, 3).setPadding(3); - place(4, 3, okButton); Layout &layout = getLayout(); layout.setRowHeight(0, Layout::AUTO_SET); @@ -82,8 +84,16 @@ HelpWindow::HelpWindow(): void HelpWindow::action(const gcn::ActionEvent &event) { - if (event.getId() == "close") - setVisible(false); + if (event.getId() == "DYK") + { + if(didYouKnowWindow) + { + didYouKnowWindow->setVisible(!didYouKnowWindow->isVisible()); + if (didYouKnowWindow->isVisible()) + didYouKnowWindow->requestMoveToTop(); + } + } + } void HelpWindow::handleLink(const std::string &link, diff --git a/src/gui/helpwindow.h b/src/gui/helpwindow.h index 4e27a61e2..cec27aa75 100644 --- a/src/gui/helpwindow.h +++ b/src/gui/helpwindow.h @@ -33,6 +33,7 @@ #include <map> #include <set> +class Button; class BrowserBox; class LinkHandler; class ScrollArea; @@ -81,6 +82,8 @@ class HelpWindow final : public Window, public LinkHandler, void loadFile(std::string file); + Button *mDYKButton; + BrowserBox *mBrowserBox; ScrollArea *mScrollArea; HelpTagsMap mTagFileMap; diff --git a/src/gui/windowmenu.cpp b/src/gui/windowmenu.cpp index c9fb9c40c..7a583e954 100644 --- a/src/gui/windowmenu.cpp +++ b/src/gui/windowmenu.cpp @@ -132,7 +132,7 @@ WindowMenu::WindowMenu(const Widget2 *const widget) : _("Drop"), x, h, Input::KEY_WINDOW_DROP, false); // TRANSLATORS: short button name for did you know window. addButton(N_("YK"), - _("Did you know"), x, h, Input::KEY_WINDOW_DIDYOUKNOW); + _("Did you know"), x, h, Input::KEY_WINDOW_DIDYOUKNOW, false); // TRANSLATORS: short button name for shop window. addButton(N_("SHP"), _("Shop"), x, h, Input::KEY_WINDOW_SHOP, false); |