summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-10-28 20:36:21 +0300
committerAndrei Karas <akaras@inbox.ru>2012-10-28 23:13:01 +0300
commit7f0ae63b8ce5a36f816159996e55ff4f66d62201 (patch)
treedd08ddd45e6babe20cb64083b6709b35e944c92c
parent7319759e4464994bbcbfbbe995759eb4a214e5e6 (diff)
downloadmanaplus-7f0ae63b8ce5a36f816159996e55ff4f66d62201.tar.gz
manaplus-7f0ae63b8ce5a36f816159996e55ff4f66d62201.tar.bz2
manaplus-7f0ae63b8ce5a36f816159996e55ff4f66d62201.tar.xz
manaplus-7f0ae63b8ce5a36f816159996e55ff4f66d62201.zip
Fix close button position under Android if window was resized.
-rw-r--r--src/client.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/client.cpp b/src/client.cpp
index 0159469f3..7df9febd6 100644
--- a/src/client.cpp
+++ b/src/client.cpp
@@ -1353,6 +1353,10 @@ int Client::gameExec()
// Allow any alpha opacity
Theme::instance()->setMinimumOpacity(-1.0f);
+#ifdef ANDROID
+ delete mCloseButton;
+ mCloseButton = nullptr;
+#endif
delete mSetupButton;
mSetupButton = nullptr;
delete mVideoButton;
@@ -1576,8 +1580,11 @@ void Client::action(const gcn::ActionEvent &event)
const std::string &eventId = event.getId();
if (eventId == "close")
+ {
setState(STATE_FORCE_QUIT);
- else if (eventId == "Setup")
+ return;
+ }
+ if (eventId == "Setup")
tab = "";
else if (eventId == "Video")
tab = "Video";
@@ -2504,11 +2511,8 @@ void Client::resizeVideo(int width, int height, const bool always)
if (mSetupButton)
{
-// mSetupButton->setPosition(width - mSetupButton->getWidth() - 3, 3);
-
int x = width - mSetupButton->getWidth() - 3;
mSetupButton->setPosition(x, 3);
-
#ifndef WIN32
x -= mPerfomanceButton->getWidth() + 6;
mPerfomanceButton->setPosition(x, 3);
@@ -2518,6 +2522,10 @@ void Client::resizeVideo(int width, int height, const bool always)
x -= mThemesButton->getWidth() + 6;
mThemesButton->setPosition(x, 3);
+#ifdef ANDROID
+ x -= mCloseButton->getWidth() + 6;
+ mCloseButton->setPosition(x, 3);
+#endif
#endif
}