diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-06-21 21:29:51 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-06-21 21:29:51 +0300 |
commit | f3a89322713a379678abc420d75230a9b17aa18f (patch) | |
tree | 1fa4318ba77eeef61272eb6cd982c7bf37b82800 /src/gui | |
parent | 552867509d2a29d806d2ba416b24fbf7ac711803 (diff) | |
download | plus-f3a89322713a379678abc420d75230a9b17aa18f.tar.gz plus-f3a89322713a379678abc420d75230a9b17aa18f.tar.bz2 plus-f3a89322713a379678abc420d75230a9b17aa18f.tar.xz plus-f3a89322713a379678abc420d75230a9b17aa18f.zip |
fix code style.
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/chatwindow.cpp | 6 | ||||
-rw-r--r-- | src/gui/didyouknowwindow.cpp | 2 | ||||
-rw-r--r-- | src/gui/killstats.cpp | 1 | ||||
-rw-r--r-- | src/gui/killstats.h | 1 | ||||
-rw-r--r-- | src/gui/outfitwindow.cpp | 1 | ||||
-rw-r--r-- | src/gui/outfitwindow.h | 1 | ||||
-rw-r--r-- | src/gui/questswindow.h | 2 | ||||
-rw-r--r-- | src/gui/registerdialog.cpp | 2 | ||||
-rw-r--r-- | src/gui/setup_colors.cpp | 5 | ||||
-rw-r--r-- | src/gui/setup_colors.h | 3 | ||||
-rw-r--r-- | src/gui/socialwindow.cpp | 10 | ||||
-rw-r--r-- | src/gui/textcommandeditor.cpp | 1 | ||||
-rw-r--r-- | src/gui/textcommandeditor.h | 1 | ||||
-rw-r--r-- | src/gui/textpopup.h | 2 | ||||
-rw-r--r-- | src/gui/viewport.cpp | 2 | ||||
-rw-r--r-- | src/gui/widgets/characterviewnormal.cpp | 1 | ||||
-rw-r--r-- | src/gui/widgets/characterviewnormal.h | 1 | ||||
-rw-r--r-- | src/gui/widgets/chattab.cpp | 1 | ||||
-rw-r--r-- | src/gui/widgets/itemcontainer.cpp | 2 | ||||
-rw-r--r-- | src/gui/widgets/popuplist.cpp | 2 | ||||
-rw-r--r-- | src/gui/widgets/vertcontainer.cpp | 3 | ||||
-rw-r--r-- | src/gui/widgets/window.cpp | 5 |
22 files changed, 18 insertions, 37 deletions
diff --git a/src/gui/chatwindow.cpp b/src/gui/chatwindow.cpp index 05595fe89..1cb0a225d 100644 --- a/src/gui/chatwindow.cpp +++ b/src/gui/chatwindow.cpp @@ -77,10 +77,9 @@ class ChatInput final : public TextField { public: - ChatInput(ChatWindow *const window, TabbedArea *const tabs): + explicit ChatInput(ChatWindow *const window): TextField(window, "", false), mWindow(window), - mChatTabs(tabs), mFocusGaining(false) { setVisible(false); @@ -131,7 +130,6 @@ class ChatInput final : public TextField private: ChatWindow *mWindow; - TabbedArea *mChatTabs; bool mFocusGaining; }; @@ -196,7 +194,7 @@ ChatWindow::ChatWindow(): gcn::KeyListener(), mItemLinkHandler(new ItemLinkHandler), mChatTabs(new TabbedArea(this)), - mChatInput(new ChatInput(this, mChatTabs)), + mChatInput(new ChatInput(this)), mRainbowColor(0), mWhispers(), mHistory(), diff --git a/src/gui/didyouknowwindow.cpp b/src/gui/didyouknowwindow.cpp index 56aeb6129..17b89b9b6 100644 --- a/src/gui/didyouknowwindow.cpp +++ b/src/gui/didyouknowwindow.cpp @@ -122,7 +122,7 @@ void DidYouKnowWindow::action(const gcn::ActionEvent &event) } } -void DidYouKnowWindow::handleLink(const std::string &link A_UNUSED, +void DidYouKnowWindow::handleLink(const std::string &link, gcn::MouseEvent *event A_UNUSED) { if (strStartWith(link, "http://") || strStartWith(link, "https://")) diff --git a/src/gui/killstats.cpp b/src/gui/killstats.cpp index 6d204ab91..e1472c822 100644 --- a/src/gui/killstats.cpp +++ b/src/gui/killstats.cpp @@ -97,7 +97,6 @@ KillStats::KillStats() : m15minExpNum(0), m15minSpeed(0), mJackoSpawnTime(0), - mValidateJackoTime(0), mJackoId(0), mIsJackoAlive(false), mIsJackoMustSpawn(true), diff --git a/src/gui/killstats.h b/src/gui/killstats.h index 02a7d1c9c..ea4d89582 100644 --- a/src/gui/killstats.h +++ b/src/gui/killstats.h @@ -121,7 +121,6 @@ class KillStats final : public Window, int m15minSpeed; int mJackoSpawnTime; - int mValidateJackoTime; int mJackoId; bool mIsJackoAlive; bool mIsJackoMustSpawn; diff --git a/src/gui/outfitwindow.cpp b/src/gui/outfitwindow.cpp index ca3f504ad..132419c91 100644 --- a/src/gui/outfitwindow.cpp +++ b/src/gui/outfitwindow.cpp @@ -86,7 +86,6 @@ OutfitWindow::OutfitWindow(): mBorderColor(getThemeColor(Theme::BORDER, 64)), mBackgroundColor(getThemeColor(Theme::BACKGROUND, 32)), mItemColors(), - mItemColorSelected(1), mItemClicked(false), mItemsUnequip() { diff --git a/src/gui/outfitwindow.h b/src/gui/outfitwindow.h index b756b1e75..37d1b61a8 100644 --- a/src/gui/outfitwindow.h +++ b/src/gui/outfitwindow.h @@ -120,7 +120,6 @@ class OutfitWindow final : public Window, gcn::Color mBorderColor; gcn::Color mBackgroundColor; unsigned char mItemColors[OUTFITS_COUNT + 1][OUTFIT_ITEM_COUNT]; - unsigned char mItemColorSelected; bool mItemClicked; bool mItemsUnequip[OUTFITS_COUNT]; diff --git a/src/gui/questswindow.h b/src/gui/questswindow.h index 0d45881af..72fdb7bb6 100644 --- a/src/gui/questswindow.h +++ b/src/gui/questswindow.h @@ -39,9 +39,9 @@ class ExtendedListBox; class ItemLinkHandler; class Map; class ScrollArea; -class QuestEffect; class QuestsModel; +struct QuestEffect; struct QuestItem; typedef std::map<int, const QuestEffect*> NpcQuestEffectMap; diff --git a/src/gui/registerdialog.cpp b/src/gui/registerdialog.cpp index a4ec0983a..a4de48807 100644 --- a/src/gui/registerdialog.cpp +++ b/src/gui/registerdialog.cpp @@ -279,7 +279,7 @@ void RegisterDialog::action(const gcn::ActionEvent &event) } } -void RegisterDialog::keyPressed(gcn::KeyEvent &keyEvent A_UNUSED) +void RegisterDialog::keyPressed(gcn::KeyEvent &keyEvent) { if (keyEvent.isConsumed()) { diff --git a/src/gui/setup_colors.cpp b/src/gui/setup_colors.cpp index 59961f434..83020d1e1 100644 --- a/src/gui/setup_colors.cpp +++ b/src/gui/setup_colors.cpp @@ -70,17 +70,14 @@ Setup_Colors::Setup_Colors(const Widget2 *const widget) : mRedLabel(new Label(this, _("Red:"))), mRedSlider(new Slider(0, 255)), mRedText(new TextField(this)), - mRedValue(0), // TRANSLATORS: colors tab. label. mGreenLabel(new Label(this, _("Green:"))), mGreenSlider(new Slider(0, 255)), mGreenText(new TextField(this)), - mGreenValue(0), // TRANSLATORS: colors tab. label. mBlueLabel(new Label(this, _("Blue:"))), mBlueSlider(new Slider(0, 255)), - mBlueText(new TextField(this)), - mBlueValue(0) + mBlueText(new TextField(this)) { // TRANSLATORS: settings colors tab name setName(_("Colors")); diff --git a/src/gui/setup_colors.h b/src/gui/setup_colors.h index b3ad3a3e9..1e631663c 100644 --- a/src/gui/setup_colors.h +++ b/src/gui/setup_colors.h @@ -75,17 +75,14 @@ class Setup_Colors final : public SetupTab, Label *mRedLabel; Slider *mRedSlider; TextField *mRedText; - int mRedValue; Label *mGreenLabel; Slider *mGreenSlider; TextField *mGreenText; - int mGreenValue; Label *mBlueLabel; Slider *mBlueSlider; TextField *mBlueText; - int mBlueValue; static void setEntry(Slider *const s, TextField *const t, const int value); diff --git a/src/gui/socialwindow.cpp b/src/gui/socialwindow.cpp index 83569416a..bdac7cca6 100644 --- a/src/gui/socialwindow.cpp +++ b/src/gui/socialwindow.cpp @@ -250,11 +250,10 @@ private: class SocialGuildTab2 final : public SocialTab, public gcn::ActionListener { public: - SocialGuildTab2(const Widget2 *const widget, - Guild *const guild, const bool showBackground) : + SocialGuildTab2(const Widget2 *const widget, Guild *const guild, + const bool showBackground) : SocialTab(widget), - gcn::ActionListener(), - mGuild(guild) + gcn::ActionListener() { // TRANSLATORS: tab in social window setCaption(_("Guild")); @@ -288,9 +287,6 @@ public: void action(const gcn::ActionEvent &event A_UNUSED) override { } - -private: - Guild *mGuild; }; class SocialPartyTab final : public SocialTab, public gcn::ActionListener diff --git a/src/gui/textcommandeditor.cpp b/src/gui/textcommandeditor.cpp index 7b3703cfb..449196ed8 100644 --- a/src/gui/textcommandeditor.cpp +++ b/src/gui/textcommandeditor.cpp @@ -173,7 +173,6 @@ TextCommandEditor::TextCommandEditor(TextCommand *const command) : gcn::ActionListener(), mIsMagicCommand(command->getCommandType() == TEXT_COMMAND_MAGIC), mCommand(command), - mAdvanced(false), // TRANSLATORS: command editor button mIsMagic(new RadioButton(this, _("magic"), "magic", mIsMagicCommand)), // TRANSLATORS: command editor button diff --git a/src/gui/textcommandeditor.h b/src/gui/textcommandeditor.h index c9308fe06..a145bf62c 100644 --- a/src/gui/textcommandeditor.h +++ b/src/gui/textcommandeditor.h @@ -70,7 +70,6 @@ class TextCommandEditor final : public Window, public gcn::ActionListener bool mIsMagicCommand; TextCommand *mCommand; - bool mAdvanced; RadioButton *mIsMagic; RadioButton *mIsOther; diff --git a/src/gui/textpopup.h b/src/gui/textpopup.h index 296cadb63..ce6ae2a02 100644 --- a/src/gui/textpopup.h +++ b/src/gui/textpopup.h @@ -58,7 +58,7 @@ class TextPopup final : public Popup { show(x, y, str1, static_cast<const char*>(""), static_cast<const char*>("")); - }; + } /** * Sets the text to be displayed. diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp index 867142c52..34a24e2aa 100644 --- a/src/gui/viewport.cpp +++ b/src/gui/viewport.cpp @@ -824,7 +824,7 @@ void Viewport::closePopupMenu() mPopupMenu->handleLink("cancel", nullptr); } -void Viewport::optionChanged(const std::string &name A_UNUSED) +void Viewport::optionChanged(const std::string &name) { if (name == "ScrollLaziness") mScrollLaziness = config.getIntValue("ScrollLaziness"); diff --git a/src/gui/widgets/characterviewnormal.cpp b/src/gui/widgets/characterviewnormal.cpp index 74cb0bdec..50dd8f7e4 100644 --- a/src/gui/widgets/characterviewnormal.cpp +++ b/src/gui/widgets/characterviewnormal.cpp @@ -32,7 +32,6 @@ CharacterViewNormal::CharacterViewNormal(CharSelectDialog *const widget, *const entries, const int padding) : CharacterViewBase(widget, padding), - mSelectedEntry(nullptr), mCharacterEntries(entries) { addKeyListener(widget); diff --git a/src/gui/widgets/characterviewnormal.h b/src/gui/widgets/characterviewnormal.h index d9b65d765..b8b8e1f7c 100644 --- a/src/gui/widgets/characterviewnormal.h +++ b/src/gui/widgets/characterviewnormal.h @@ -43,7 +43,6 @@ class CharacterViewNormal final : public CharacterViewBase void action(const gcn::ActionEvent &event A_UNUSED) override; private: - CharacterDisplay *mSelectedEntry; std::vector<CharacterDisplay*> *mCharacterEntries; }; diff --git a/src/gui/widgets/chattab.cpp b/src/gui/widgets/chattab.cpp index cad16dde3..3ab9594fe 100644 --- a/src/gui/widgets/chattab.cpp +++ b/src/gui/widgets/chattab.cpp @@ -193,7 +193,6 @@ void ChatTab::chatLog(std::string line, Own own, lineColor = "##L"; break; default: - logger->log1("ChatTab::chatLog incorrect value in switch"); break; } diff --git a/src/gui/widgets/itemcontainer.cpp b/src/gui/widgets/itemcontainer.cpp index 7f4846fce..997e1af7f 100644 --- a/src/gui/widgets/itemcontainer.cpp +++ b/src/gui/widgets/itemcontainer.cpp @@ -695,8 +695,6 @@ void ItemContainer::moveHighlight(const Direction direction) mHighlightedIndex += mGridColumns; break; default: - logger->log("warning moveHighlight unknown direction:" - + toString(static_cast<unsigned>(direction))); break; } } diff --git a/src/gui/widgets/popuplist.cpp b/src/gui/widgets/popuplist.cpp index 8cea612ab..fea5225d7 100644 --- a/src/gui/widgets/popuplist.cpp +++ b/src/gui/widgets/popuplist.cpp @@ -135,7 +135,7 @@ void PopupList::mousePressed(gcn::MouseEvent& mouseEvent) releaseModalFocus(); } -void PopupList::focusGained(const gcn::Event& event A_UNUSED) +void PopupList::focusGained(const gcn::Event& event) { const gcn::Widget *const source = event.getSource(); if (!mVisible || source == this || source == mListBox diff --git a/src/gui/widgets/vertcontainer.cpp b/src/gui/widgets/vertcontainer.cpp index 0611b3714..947080762 100644 --- a/src/gui/widgets/vertcontainer.cpp +++ b/src/gui/widgets/vertcontainer.cpp @@ -54,7 +54,8 @@ void VertContainer::add2(gcn::Widget *const widget, const bool resizable, widget->setPosition(mLeftSpacing, mNextY); if (resizable) { - widget->setSize(mDimension.width - mLeftSpacing, mVerticalItemSize * 5); + widget->setSize(mDimension.width - mLeftSpacing, + mVerticalItemSize * 5); mResizableWidgets.push_back(widget); } else if (widget->getHeight() > mVerticalItemSize) diff --git a/src/gui/widgets/window.cpp b/src/gui/widgets/window.cpp index 94937cac6..674fc171d 100644 --- a/src/gui/widgets/window.cpp +++ b/src/gui/widgets/window.cpp @@ -1019,7 +1019,10 @@ void Window::adjustPositionAfterResize(const int oldScreenWidth, if (mDimension.x > 0 && mDimension.x > rightMargin) mDimension.x = mainGraphics->mWidth - rightMargin - mDimension.width; if (mDimension.y > 0 && mDimension.y > bottomMargin) - mDimension.y = mainGraphics->mHeight - bottomMargin - mDimension.height; + { + mDimension.y = mainGraphics->mHeight + - bottomMargin - mDimension.height; + } ensureOnScreen(); } |