summaryrefslogtreecommitdiff
path: root/src/gui/helpwindow.cpp
diff options
context:
space:
mode:
authorSocapex <philippe_groarke@yahoo.ca>2013-03-12 15:40:00 -0400
committerAndrei Karas <akaras@inbox.ru>2013-03-12 23:22:36 +0300
commite74f40d96ed90750dd917d777a8621416084f019 (patch)
tree012d9541e2cf0140e0bce6e4bce2b89a10bda824 /src/gui/helpwindow.cpp
parent72d99267699fa38d3af1ea8e538eacc4e5d42acc (diff)
downloadmanaplus-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/helpwindow.cpp')
-rw-r--r--src/gui/helpwindow.cpp18
1 files changed, 14 insertions, 4 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,