summaryrefslogtreecommitdiff
path: root/src/gui/widgets
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-03-08 13:51:57 +0300
committerAndrei Karas <akaras@inbox.ru>2014-03-08 17:55:40 +0300
commit9247c5a23757e01ef7ee91dd5655fcab177e5e6d (patch)
tree38e947cdaa6f1ec33651560b81851b7a255a58ac /src/gui/widgets
parentfcf53dd7d524c2204f39269be5768a1919daef42 (diff)
downloadmanaverse-9247c5a23757e01ef7ee91dd5655fcab177e5e6d.tar.gz
manaverse-9247c5a23757e01ef7ee91dd5655fcab177e5e6d.tar.bz2
manaverse-9247c5a23757e01ef7ee91dd5655fcab177e5e6d.tar.xz
manaverse-9247c5a23757e01ef7ee91dd5655fcab177e5e6d.zip
fix code style.
Diffstat (limited to 'src/gui/widgets')
-rw-r--r--src/gui/widgets/basiccontainer.h6
-rw-r--r--src/gui/widgets/basiccontainer2.cpp2
-rw-r--r--src/gui/widgets/basiccontainer2.h6
-rw-r--r--src/gui/widgets/button.cpp1
-rw-r--r--src/gui/widgets/checkbox.cpp2
-rw-r--r--src/gui/widgets/label.cpp2
-rw-r--r--src/gui/widgets/listbox.cpp4
-rw-r--r--src/gui/widgets/playerbox.h2
-rw-r--r--src/gui/widgets/radiobutton.cpp2
-rw-r--r--src/gui/widgets/slider.cpp2
-rw-r--r--src/gui/widgets/slider.h5
-rw-r--r--src/gui/widgets/tabbedarea.cpp2
-rw-r--r--src/gui/widgets/textbox.cpp11
-rw-r--r--src/gui/widgets/textfield.cpp2
14 files changed, 11 insertions, 38 deletions
diff --git a/src/gui/widgets/basiccontainer.h b/src/gui/widgets/basiccontainer.h
index bf018e0de..6e753a445 100644
--- a/src/gui/widgets/basiccontainer.h
+++ b/src/gui/widgets/basiccontainer.h
@@ -61,8 +61,8 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef GCN_BASICCONTAINER_HPP
-#define GCN_BASICCONTAINER_HPP
+#ifndef GUI_WIDGETS_BASICCONTAINER_H
+#define GUI_WIDGETS_BASICCONTAINER_H
#include <vector>
@@ -212,4 +212,4 @@ class BasicContainer : public Widget,
WidgetList mWidgets;
};
-#endif // end GCN_BASICCONTAINER_HPP
+#endif // GUI_WIDGETS_BASICCONTAINER_H
diff --git a/src/gui/widgets/basiccontainer2.cpp b/src/gui/widgets/basiccontainer2.cpp
index 5a34ee0dc..9bd4d1593 100644
--- a/src/gui/widgets/basiccontainer2.cpp
+++ b/src/gui/widgets/basiccontainer2.cpp
@@ -67,8 +67,6 @@
#include "gui/widgets/basiccontainer2.h"
-#include "render/graphics.h"
-
#include "debug.h"
BasicContainer2::BasicContainer2(const Widget2 *const widget) :
diff --git a/src/gui/widgets/basiccontainer2.h b/src/gui/widgets/basiccontainer2.h
index 16078016f..c6f1d996b 100644
--- a/src/gui/widgets/basiccontainer2.h
+++ b/src/gui/widgets/basiccontainer2.h
@@ -61,8 +61,8 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef GUI_WIDGETS_BASICCONTAINER2_HPP
-#define GUI_WIDGETS_BASICCONTAINER2_HPP
+#ifndef GUI_WIDGETS_BASICCONTAINER2_H
+#define GUI_WIDGETS_BASICCONTAINER2_H
#include "gui/widgets/basiccontainer.h"
@@ -171,4 +171,4 @@ class BasicContainer2: public BasicContainer
bool mOpaque;
};
-#endif // GUI_WIDGETS_BASICCONTAINER2_HPP
+#endif // GUI_WIDGETS_BASICCONTAINER2_H
diff --git a/src/gui/widgets/button.cpp b/src/gui/widgets/button.cpp
index 8e020370f..308c75413 100644
--- a/src/gui/widgets/button.cpp
+++ b/src/gui/widgets/button.cpp
@@ -220,7 +220,6 @@ Button::Button(const Widget2 *const widget,
mStick(false),
mPressed(false)
{
-
init();
loadImageSet(imageName);
adjustSize();
diff --git a/src/gui/widgets/checkbox.cpp b/src/gui/widgets/checkbox.cpp
index c905ae0c4..f01495bcf 100644
--- a/src/gui/widgets/checkbox.cpp
+++ b/src/gui/widgets/checkbox.cpp
@@ -67,8 +67,6 @@
#include "client.h"
-#include "events/keyevent.h"
-
#include "input/keydata.h"
#include "resources/image.h"
diff --git a/src/gui/widgets/label.cpp b/src/gui/widgets/label.cpp
index 64dce1a84..b500ec7bb 100644
--- a/src/gui/widgets/label.cpp
+++ b/src/gui/widgets/label.cpp
@@ -88,7 +88,7 @@ Label::Label(const Widget2 *const widget,
mAlignment(Graphics::LEFT),
mPadding(0)
{
- Font *const font = getFont();
+ const Font *const font = getFont();
if (font)
{
setWidth(font->getWidth(caption));
diff --git a/src/gui/widgets/listbox.cpp b/src/gui/widgets/listbox.cpp
index c12a3fe53..6f0c192c6 100644
--- a/src/gui/widgets/listbox.cpp
+++ b/src/gui/widgets/listbox.cpp
@@ -67,8 +67,6 @@
#include "client.h"
-#include "events/keyevent.h"
-
#include "input/keydata.h"
#include "listeners/selectionlistener.h"
@@ -79,8 +77,6 @@
#include "gui/models/listmodel.h"
-#include "render/graphics.h"
-
#include "debug.h"
float ListBox::mAlpha = 1.0;
diff --git a/src/gui/widgets/playerbox.h b/src/gui/widgets/playerbox.h
index aae2eefe6..1a9067378 100644
--- a/src/gui/widgets/playerbox.h
+++ b/src/gui/widgets/playerbox.h
@@ -23,7 +23,7 @@
#ifndef GUI_WIDGETS_PLAYERBOX_H
#define GUI_WIDGETS_PLAYERBOX_H
-#include "gui/widgets/scrollarea.h"
+#include "gui/widgets/widget.h"
#include "listeners/mouselistener.h"
diff --git a/src/gui/widgets/radiobutton.cpp b/src/gui/widgets/radiobutton.cpp
index 1aa77a0db..411216455 100644
--- a/src/gui/widgets/radiobutton.cpp
+++ b/src/gui/widgets/radiobutton.cpp
@@ -67,8 +67,6 @@
#include "client.h"
-#include "events/keyevent.h"
-
#include "input/keydata.h"
#include "resources/image.h"
diff --git a/src/gui/widgets/slider.cpp b/src/gui/widgets/slider.cpp
index 8da4f34ae..700d31416 100644
--- a/src/gui/widgets/slider.cpp
+++ b/src/gui/widgets/slider.cpp
@@ -100,7 +100,6 @@ Slider::Slider(Widget2 *const widget,
mOrientation(HORIZONTAL),
mVertexes(new ImageCollection),
mMarkerLength(10),
- mDragged(false),
mHasMouse(false),
mRedraw(true)
{
@@ -120,7 +119,6 @@ Slider::Slider(Widget2 *const widget,
mOrientation(HORIZONTAL),
mVertexes(new ImageCollection),
mMarkerLength(10),
- mDragged(false),
mHasMouse(false),
mRedraw(true)
{
diff --git a/src/gui/widgets/slider.h b/src/gui/widgets/slider.h
index 3fbb66a5c..23d06de48 100644
--- a/src/gui/widgets/slider.h
+++ b/src/gui/widgets/slider.h
@@ -348,11 +348,6 @@ class Slider final : public Widget,
*/
int mMarkerLength;
- /**
- * True if the slider is dragged, false otherwise.
- */
- bool mDragged;
-
bool mHasMouse;
bool mRedraw;
};
diff --git a/src/gui/widgets/tabbedarea.cpp b/src/gui/widgets/tabbedarea.cpp
index c075cbc62..445f17982 100644
--- a/src/gui/widgets/tabbedarea.cpp
+++ b/src/gui/widgets/tabbedarea.cpp
@@ -75,8 +75,6 @@
#include "gui/widgets/scrollarea.h"
#include "gui/widgets/tabs/tab.h"
-#include "gui/widgets/basiccontainer2.h"
-
#include "debug.h"
TabbedArea::TabbedArea(const Widget2 *const widget) :
diff --git a/src/gui/widgets/textbox.cpp b/src/gui/widgets/textbox.cpp
index a00d0ccf8..5f565259b 100644
--- a/src/gui/widgets/textbox.cpp
+++ b/src/gui/widgets/textbox.cpp
@@ -65,8 +65,6 @@
#include "gui/widgets/textbox.h"
-#include "events/keyevent.h"
-
#include "input/keydata.h"
#include "gui/font.h"
@@ -567,16 +565,13 @@ void TextBox::setCaretRowColumn(const int row, const int column)
void TextBox::scrollToCaret()
{
+ const Font *const font = getFont();
Rect scroll;
- Font *const font = getFont();
- scroll.x = font->getWidth(
- mTextRows[mCaretRow].substr(0, mCaretColumn));
+ scroll.x = font->getWidth(mTextRows[mCaretRow].substr(0, mCaretColumn));
scroll.y = font->getHeight() * mCaretRow;
scroll.width = font->getWidth(" ");
-
// add 2 for some extra space
scroll.height = font->getHeight() + 2;
-
showPart(scroll);
}
@@ -619,7 +614,7 @@ void TextBox::drawCaret(Graphics *const graphics, const int x, const int y)
void TextBox::adjustSize()
{
int width = 0;
- Font *const font = getFont();
+ const Font *const font = getFont();
for (size_t i = 0, sz = mTextRows.size(); i < sz; ++i)
{
const int w = font->getWidth(mTextRows[i]);
diff --git a/src/gui/widgets/textfield.cpp b/src/gui/widgets/textfield.cpp
index 98e852b00..7fe8c1bf3 100644
--- a/src/gui/widgets/textfield.cpp
+++ b/src/gui/widgets/textfield.cpp
@@ -69,8 +69,6 @@
#include "input/inputmanager.h"
-#include "events/keyevent.h"
-
#include "gui/font.h"
#include "gui/gui.h"
#include "gui/viewport.h"