From 7f0ae63b8ce5a36f816159996e55ff4f66d62201 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 28 Oct 2012 20:36:21 +0300 Subject: Fix close button position under Android if window was resized. --- src/client.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'src/client.cpp') 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 } -- cgit v1.2.3-60-g2f50