summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-08-01 21:21:06 +0300
committerAndrei Karas <akaras@inbox.ru>2014-08-01 22:13:44 +0300
commit41ffafd17ad8f0a7ee060cc9f48bca04a1e16cb6 (patch)
tree75a934dd456f4079898b77f17fc2e5da631ba761 /src/gui
parent33ef923235aeabd07308816bb07ef790cc6c1024 (diff)
downloadplus-41ffafd17ad8f0a7ee060cc9f48bca04a1e16cb6.tar.gz
plus-41ffafd17ad8f0a7ee060cc9f48bca04a1e16cb6.tar.bz2
plus-41ffafd17ad8f0a7ee060cc9f48bca04a1e16cb6.tar.xz
plus-41ffafd17ad8f0a7ee060cc9f48bca04a1e16cb6.zip
Fix code style.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/popupmanager.cpp25
-rw-r--r--src/gui/popupmanager.h2
-rw-r--r--src/gui/popups/statuspopup.cpp6
-rw-r--r--src/gui/popups/statuspopup.h1
-rw-r--r--src/gui/viewport.cpp7
-rw-r--r--src/gui/viewport.h10
-rw-r--r--src/gui/widgets/guitable.h2
-rw-r--r--src/gui/widgets/textfield.cpp6
-rw-r--r--src/gui/widgets/textfield.h3
-rw-r--r--src/gui/windows/buydialog.cpp1
-rw-r--r--src/gui/windows/outfitwindow.cpp3
-rw-r--r--src/gui/windows/outfitwindow.h1
-rw-r--r--src/gui/windows/statuswindow.cpp3
13 files changed, 7 insertions, 63 deletions
diff --git a/src/gui/popupmanager.cpp b/src/gui/popupmanager.cpp
index b5abb4f04..24c816008 100644
--- a/src/gui/popupmanager.cpp
+++ b/src/gui/popupmanager.cpp
@@ -22,36 +22,14 @@
#include "gui/popupmanager.h"
-#include "actormanager.h"
-#include "configuration.h"
-#include "game.h"
-#include "settings.h"
#include "sdlshared.h"
-#include "textmanager.h"
-#include "resources/mapitemtype.h"
-
-#include "resources/map/map.h"
-#include "resources/map/mapitem.h"
-#include "resources/map/maptype.h"
-#include "resources/map/speciallayer.h"
-
-#include "being/localplayer.h"
-#include "being/playerinfo.h"
-
-#include "input/inputmanager.h"
-
-#include "gui/gui.h"
#include "gui/viewport.h"
-#include "gui/fonts/font.h"
-
#include "gui/popups/beingpopup.h"
#include "gui/popups/popupmenu.h"
#include "gui/popups/textpopup.h"
-#include "gui/windows/ministatuswindow.h"
-
#include "utils/delete2.h"
#include "debug.h"
@@ -200,7 +178,8 @@ void PopupManager::showAttackMonsterPopup(const std::string &name,
void PopupManager::showPickupItemPopup(const std::string &name)
{
- mPopupMenu->showPickupItemPopup(viewport->getMouseX(), viewport->getMouseY(),
+ mPopupMenu->showPickupItemPopup(viewport->getMouseX(),
+ viewport->getMouseY(),
name);
}
diff --git a/src/gui/popupmanager.h b/src/gui/popupmanager.h
index a44625b1e..fcd0f0919 100644
--- a/src/gui/popupmanager.h
+++ b/src/gui/popupmanager.h
@@ -29,9 +29,7 @@ class Being;
class BeingPopup;
class ChatTab;
class FloorItem;
-class Graphics;
class Item;
-class Map;
class MapItem;
class PopupMenu;
class ProgressBar;
diff --git a/src/gui/popups/statuspopup.cpp b/src/gui/popups/statuspopup.cpp
index fd696c568..88b61489f 100644
--- a/src/gui/popups/statuspopup.cpp
+++ b/src/gui/popups/statuspopup.cpp
@@ -21,16 +21,12 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "gui/viewport.h"
+#include "gui/popups/statuspopup.h"
#include "gamemodifiers.h"
-#include "gui/popups/statuspopup.h"
-
#include "gui/widgets/label.h"
-#include "being/localplayer.h"
-
#include "input/inputmanager.h"
#include "utils/stringutils.h"
diff --git a/src/gui/popups/statuspopup.h b/src/gui/popups/statuspopup.h
index 6dcdd636f..77cdce12c 100644
--- a/src/gui/popups/statuspopup.h
+++ b/src/gui/popups/statuspopup.h
@@ -25,7 +25,6 @@
#define GUI_POPUPS_STATUSPOPUP_H
#include "input/inputaction.h"
-#include "input/inputactiondata.h"
#include "gui/widgets/popup.h"
diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp
index 94c34f483..d0ac02d4c 100644
--- a/src/gui/viewport.cpp
+++ b/src/gui/viewport.cpp
@@ -33,7 +33,6 @@
#include "resources/map/map.h"
#include "resources/map/mapitem.h"
-#include "resources/map/maptype.h"
#include "resources/map/speciallayer.h"
#include "being/localplayer.h"
@@ -46,14 +45,8 @@
#include "gui/fonts/font.h"
-#include "gui/popups/beingpopup.h"
-#include "gui/popups/popupmenu.h"
-#include "gui/popups/textpopup.h"
-
#include "gui/windows/ministatuswindow.h"
-#include "utils/delete2.h"
-
#include "debug.h"
Viewport *viewport = nullptr;
diff --git a/src/gui/viewport.h b/src/gui/viewport.h
index 0347a3f98..329b88074 100644
--- a/src/gui/viewport.h
+++ b/src/gui/viewport.h
@@ -32,21 +32,11 @@
#include "listeners/mouselistener.h"
class ActorSprite;
-class Button;
class Being;
-class BeingPopup;
-class ChatTab;
class FloorItem;
class Graphics;
-class Item;
class Map;
class MapItem;
-class PopupMenu;
-class ProgressBar;
-class TextCommand;
-class TextField;
-class TextPopup;
-class Window;
/** Delay between two mouse calls when dragging mouse and move the player */
const int walkingMouseDelay = 500;
diff --git a/src/gui/widgets/guitable.h b/src/gui/widgets/guitable.h
index d0deb9ba0..e546251fb 100644
--- a/src/gui/widgets/guitable.h
+++ b/src/gui/widgets/guitable.h
@@ -109,7 +109,7 @@ class GuiTable final : public Widget,
* \param linewise: Whether to enable linewise selection mode
*/
void setLinewiseSelection(bool linewise)
- { mLinewiseMode = linewise;}
+ { mLinewiseMode = linewise; }
// Inherited from Widget
void draw(Graphics* graphics) override final;
diff --git a/src/gui/widgets/textfield.cpp b/src/gui/widgets/textfield.cpp
index cdfbac68a..adb455432 100644
--- a/src/gui/widgets/textfield.cpp
+++ b/src/gui/widgets/textfield.cpp
@@ -78,13 +78,10 @@
#include "gui/fonts/font.h"
-#include "gui/popups/popupmenu.h"
-
#include "resources/image.h"
#include "resources/imagerect.h"
#include "utils/copynpaste.h"
-#include "utils/delete2.h"
#include "utils/stringutils.h"
#include "utils/timer.h"
@@ -111,7 +108,6 @@ TextField::TextField(const Widget2 *restrict const widget,
mCaretPosition(0),
mXScroll(0),
mCaretColor(&getThemeColor(Theme::CARET)),
- mPopupMenu(nullptr),
mMinimum(0),
mMaximum(0),
mLastEventPaste(false),
@@ -162,8 +158,6 @@ TextField::~TextField()
if (gui)
gui->removeDragged(this);
- delete2(mPopupMenu);
-
instances--;
if (instances == 0)
{
diff --git a/src/gui/widgets/textfield.h b/src/gui/widgets/textfield.h
index d2cdcd473..e3a893edc 100644
--- a/src/gui/widgets/textfield.h
+++ b/src/gui/widgets/textfield.h
@@ -74,8 +74,6 @@
#include "localconsts.h"
-class PopupMenu;
-
/**
* A text field.
*
@@ -252,7 +250,6 @@ class TextField notfinal : public Widget,
int mXScroll;
const Color *mCaretColor;
- PopupMenu *mPopupMenu;
static int instances;
static float mAlpha;
static ImageRect skin;
diff --git a/src/gui/windows/buydialog.cpp b/src/gui/windows/buydialog.cpp
index 02c9b5f2e..ce22252a0 100644
--- a/src/gui/windows/buydialog.cpp
+++ b/src/gui/windows/buydialog.cpp
@@ -51,7 +51,6 @@
#include "resources/iteminfo.h"
#include "utils/delete2.h"
-#include "utils/gettext.h"
#include <algorithm>
diff --git a/src/gui/windows/outfitwindow.cpp b/src/gui/windows/outfitwindow.cpp
index 82ce553f7..09cf1a95c 100644
--- a/src/gui/windows/outfitwindow.cpp
+++ b/src/gui/windows/outfitwindow.cpp
@@ -75,7 +75,6 @@ OutfitWindow::OutfitWindow() :
mKeyLabel(new Label(this, strprintf(_("Key: %s"),
keyName(0).c_str()))),
mBorderColor(getThemeColor(Theme::BORDER, 64)),
- mBackgroundColor(getThemeColor(Theme::BACKGROUND, 32)),
mCurrentOutfit(0),
mBoxWidth(33),
mBoxHeight(33),
@@ -92,6 +91,8 @@ OutfitWindow::OutfitWindow() :
setCloseButton(true);
setStickyButtonLock(true);
+ mBackgroundColor = getThemeColor(Theme::BACKGROUND, 32);
+
setDefaultSize(250, 400, 150, 290);
setMinWidth(145);
setMinHeight(220);
diff --git a/src/gui/windows/outfitwindow.h b/src/gui/windows/outfitwindow.h
index cf60c32ad..4bfaa3e84 100644
--- a/src/gui/windows/outfitwindow.h
+++ b/src/gui/windows/outfitwindow.h
@@ -107,7 +107,6 @@ class OutfitWindow final : public Window,
Label *mKeyLabel;
Color mBorderColor;
- Color mBackgroundColor;
int mCurrentOutfit;
int mBoxWidth;
diff --git a/src/gui/windows/statuswindow.cpp b/src/gui/windows/statuswindow.cpp
index 6fa51c568..a49545df3 100644
--- a/src/gui/windows/statuswindow.cpp
+++ b/src/gui/windows/statuswindow.cpp
@@ -36,8 +36,6 @@
#include "being/localplayer.h"
#include "being/playerinfo.h"
-#include "gui/viewport.h"
-
#include "gui/windows/equipmentwindow.h"
#include "gui/windows/setupwindow.h"
@@ -50,6 +48,7 @@
#include "gui/widgets/scrollarea.h"
#include "gui/widgets/statuswindowattrs.h"
#include "gui/widgets/vertcontainer.h"
+#include "gui/widgets/windowcontainer.h"
#include "net/net.h"
#include "net/playerhandler.h"