summaryrefslogtreecommitdiff
path: root/src/gui/windows
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2020-02-23 09:30:51 +0300
committerAndrei Karas <akaras@inbox.ru>2020-02-23 09:30:51 +0300
commit1e2a88e975019929c4c7e3154537865cc09550a6 (patch)
treeae8bc68ad3a3f6b61a5e2d511d7fc17daa22bd0e /src/gui/windows
parent6941fd4eeb1dce20aba8c42fd030c2690c37b731 (diff)
downloadmv-1e2a88e975019929c4c7e3154537865cc09550a6.tar.gz
mv-1e2a88e975019929c4c7e3154537865cc09550a6.tar.bz2
mv-1e2a88e975019929c4c7e3154537865cc09550a6.tar.xz
mv-1e2a88e975019929c4c7e3154537865cc09550a6.zip
Fix some code style issues
Diffstat (limited to 'src/gui/windows')
-rw-r--r--src/gui/windows/chatwindow.cpp6
-rw-r--r--src/gui/windows/inventorywindow.cpp6
-rw-r--r--src/gui/windows/ministatuswindow.cpp2
-rw-r--r--src/gui/windows/shopwindow.cpp2
-rw-r--r--src/gui/windows/shortcutwindow.cpp2
5 files changed, 9 insertions, 9 deletions
diff --git a/src/gui/windows/chatwindow.cpp b/src/gui/windows/chatwindow.cpp
index f96cf976d..ad7fc1573 100644
--- a/src/gui/windows/chatwindow.cpp
+++ b/src/gui/windows/chatwindow.cpp
@@ -1883,12 +1883,12 @@ void ChatWindow::loadState()
if (nick.empty())
break;
- const int flags = serverConfig.getValue(
- "chatWhisperFlags" + toString(num), 1);
-
ChatTab *const tab = addChatTab(nick, false, false);
if (tab != nullptr)
{
+ const int flags = serverConfig.getValue(
+ "chatWhisperFlags" + toString(num), 1);
+
tab->setAllowHighlight((flags & 1) != 0);
tab->setRemoveNames(((flags & 2) / 2) != 0);
tab->setNoAway(((flags & 4) / 4) != 0);
diff --git a/src/gui/windows/inventorywindow.cpp b/src/gui/windows/inventorywindow.cpp
index 8722e35e3..28d83b10f 100644
--- a/src/gui/windows/inventorywindow.cpp
+++ b/src/gui/windows/inventorywindow.cpp
@@ -643,11 +643,11 @@ void InventoryWindow::mouseClicked(MouseEvent &event)
/* Convert relative to the window coordinates to absolute screen
* coordinates.
*/
- const int mx = event.getX() + getX();
- const int my = event.getY() + getY();
-
if (popupMenu != nullptr)
{
+ const int mx = event.getX() + getX();
+ const int my = event.getY() + getY();
+
popupMenu->showPopup(this,
mx, my,
item,
diff --git a/src/gui/windows/ministatuswindow.cpp b/src/gui/windows/ministatuswindow.cpp
index 2a1b3e16c..42e7d8804 100644
--- a/src/gui/windows/ministatuswindow.cpp
+++ b/src/gui/windows/ministatuswindow.cpp
@@ -432,7 +432,6 @@ void MiniStatusWindow::mouseMoved(MouseEvent &event)
Attributes::PLAYER_JOB_LEVEL);
const std::string expStr = toString(CAST_U64(exp));
const std::string expNeedStr = toString(CAST_U64(expNeed));
- const std::string expLeftStr = toString(CAST_U64(expNeed - exp));
// TRANSLATORS: job bar label
const std::string level = strprintf(_("Job level: %d"),
@@ -447,6 +446,7 @@ void MiniStatusWindow::mouseMoved(MouseEvent &event)
}
else
{
+ const std::string expLeftStr = toString(CAST_U64(expNeed - exp));
textPopup->show(x + rect.x,
y + rect.y,
level,
diff --git a/src/gui/windows/shopwindow.cpp b/src/gui/windows/shopwindow.cpp
index eb28639f8..6bd298e2b 100644
--- a/src/gui/windows/shopwindow.cpp
+++ b/src/gui/windows/shopwindow.cpp
@@ -439,7 +439,6 @@ void ShopWindow::updateButtonsAndLabels()
{
bool allowDel(false);
bool allowAdd(false);
- const bool sellNotEmpty = mSellShopItems->getNumberOfElements() > 0;
if (isBuySelected)
{
allowAdd = !mEnableBuyingStore;
@@ -467,6 +466,7 @@ void ShopWindow::updateButtonsAndLabels()
}
else
{
+ const bool sellNotEmpty = mSellShopItems->getNumberOfElements() > 0;
allowAdd = !mEnableVending && mSelectedItem != -1;
allowDel = !mEnableVending
&& mSellShopItemList->getSelected() != -1
diff --git a/src/gui/windows/shortcutwindow.cpp b/src/gui/windows/shortcutwindow.cpp
index e45ca266c..faa8e6fa5 100644
--- a/src/gui/windows/shortcutwindow.cpp
+++ b/src/gui/windows/shortcutwindow.cpp
@@ -78,9 +78,9 @@ ShortcutWindow::ShortcutWindow(const std::string &restrict title,
setMinWidth(32);
setMinHeight(32);
- const int border = SCROLL_PADDING * 2 + getPadding() * 2;
if (mItems != nullptr)
{
+ const int border = SCROLL_PADDING * 2 + getPadding() * 2;
const int bw = mItems->getBoxWidth();
const int bh = mItems->getBoxHeight();
const int maxItems = mItems->getMaxItems();