mirror of
https://github.com/edubart/otclient.git
synced 2025-10-14 11:34:54 +02:00
rect fix and some ui new classes
This commit is contained in:
@@ -35,7 +35,7 @@ bool Configs::load(const std::string& fileName)
|
||||
return false;
|
||||
|
||||
std::string fileContents = g_resources.loadTextFile(fileName);
|
||||
if(fileContents.size())
|
||||
if(!fileContents.size())
|
||||
return false;
|
||||
|
||||
std::istringstream fin(fileContents);
|
||||
|
@@ -133,7 +133,7 @@ void Engine::onClose()
|
||||
void Engine::onResize(const Size& size)
|
||||
{
|
||||
g_graphics.resize(size);
|
||||
UIContainer::getRootContainer()->setSize(Size(size.width()-1, size.height()-1));
|
||||
UIContainer::getRootContainer()->setSize(size);
|
||||
|
||||
if(m_currentState)
|
||||
m_currentState->onResize(size);
|
||||
|
7
src/framework/ui/uicheckbox.cpp
Normal file
7
src/framework/ui/uicheckbox.cpp
Normal file
@@ -0,0 +1,7 @@
|
||||
#include "uicheckbox.h"
|
||||
|
||||
UICheckBox::UICheckBox(UI::EElementType type): UIElement(type)
|
||||
{
|
||||
|
||||
}
|
||||
|
14
src/framework/ui/uicheckbox.h
Normal file
14
src/framework/ui/uicheckbox.h
Normal file
@@ -0,0 +1,14 @@
|
||||
#ifndef UICHECKBOX_H
|
||||
#define UICHECKBOX_H
|
||||
|
||||
#include <ui/uielement.h>
|
||||
|
||||
|
||||
class UICheckBox : public UIElement
|
||||
{
|
||||
|
||||
public:
|
||||
UICheckBox(UI::EElementType type = UI::Element);
|
||||
};
|
||||
|
||||
#endif // UICHECKBOX_H
|
2
src/framework/ui/uicheckboxskin.cpp
Normal file
2
src/framework/ui/uicheckboxskin.cpp
Normal file
@@ -0,0 +1,2 @@
|
||||
#include "uicheckboxskin.h"
|
||||
|
8
src/framework/ui/uicheckboxskin.h
Normal file
8
src/framework/ui/uicheckboxskin.h
Normal file
@@ -0,0 +1,8 @@
|
||||
#ifndef UICHECKBOXSKIN_H
|
||||
#define UICHECKBOXSKIN_H
|
||||
|
||||
class UICheckBoxSkin
|
||||
{
|
||||
};
|
||||
|
||||
#endif // UICHECKBOXSKIN_H
|
2
src/framework/ui/uilinedecoration.cpp
Normal file
2
src/framework/ui/uilinedecoration.cpp
Normal file
@@ -0,0 +1,2 @@
|
||||
#include "uilinedecoration.h"
|
||||
|
8
src/framework/ui/uilinedecoration.h
Normal file
8
src/framework/ui/uilinedecoration.h
Normal file
@@ -0,0 +1,8 @@
|
||||
#ifndef UILINEDECORATION_H
|
||||
#define UILINEDECORATION_H
|
||||
|
||||
class UILineDecoration
|
||||
{
|
||||
};
|
||||
|
||||
#endif // UILINEDECORATION_H
|
2
src/framework/ui/uilinedecorationskin.cpp
Normal file
2
src/framework/ui/uilinedecorationskin.cpp
Normal file
@@ -0,0 +1,2 @@
|
||||
#include "uilinedecorationskin.h"
|
||||
|
8
src/framework/ui/uilinedecorationskin.h
Normal file
8
src/framework/ui/uilinedecorationskin.h
Normal file
@@ -0,0 +1,8 @@
|
||||
#ifndef UILINEDECORATIONSKIN_H
|
||||
#define UILINEDECORATIONSKIN_H
|
||||
|
||||
class UILineDecorationSkin
|
||||
{
|
||||
};
|
||||
|
||||
#endif // UILINEDECORATIONSKIN_H
|
@@ -77,8 +77,8 @@ public:
|
||||
inline void setBottomLeft(const TPoint<T> &p) { x1 = p.x; y2 = p.y; }
|
||||
inline void setWidth(T width) { x2 = x1 + width - 1; }
|
||||
inline void setHeight(T height) { y2 = y1 + height- 1; }
|
||||
inline void setSize(T width, T height) { x2 = x1 + width; y2 = y1 + height; }
|
||||
inline void setSize(const TSize<T>& size) { x2 = x1 + size.width(); y2 = y1 + size.height(); }
|
||||
inline void setSize(T width, T height) { x2 = x1 + width - 1; y2 = y1 + height - 1; }
|
||||
inline void setSize(const TSize<T>& size) { x2 = x1 + size.width() - 1; y2 = y1 + size.height() - 1; }
|
||||
inline void setRect(T x, T y, T width, T height) { x1 = x; y1 = y; x2 = (x + width - 1); y2 = (y + height - 1); }
|
||||
inline void setCoords(int left, int top, int right, int bottom) { x1 = left; y1 = top; x2 = right; y2 = bottom; }
|
||||
|
||||
|
@@ -38,7 +38,7 @@ template <class T>
|
||||
class TSize
|
||||
{
|
||||
public:
|
||||
inline TSize() : wd(-1), ht(-1) {};
|
||||
inline TSize() : wd(0), ht(0) {};
|
||||
inline TSize(T width, T height) : wd(width), ht(height) { };
|
||||
inline TSize(const TSize<T>& other) : wd(other.wd), ht(other.ht) { };
|
||||
|
||||
|
Reference in New Issue
Block a user