mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-10-26 08:08:28 +03:00
More clean up.
--HG-- branch : dev-css
This commit is contained in:
@@ -7,12 +7,6 @@
|
||||
textSelectionBackColor: #969696FF;
|
||||
}
|
||||
|
||||
Tab:selected,
|
||||
Tab:hover,
|
||||
Tab:pressed {
|
||||
textColor: #FFF;
|
||||
}
|
||||
|
||||
TabWidget {
|
||||
tabSeparation: -1dp;
|
||||
drawLineBelowTabs: true;
|
||||
@@ -43,7 +37,11 @@ Menu:hover,
|
||||
PopUpMenu:hover,
|
||||
MenuItem:hover,
|
||||
MenuCheckBox:hover,
|
||||
MenuSubMenu:hover {
|
||||
MenuSubMenu:hover,
|
||||
ListBox::item:hover,
|
||||
Tab:selected,
|
||||
Tab:hover,
|
||||
Tab:pressed {
|
||||
textColor: #FFF;
|
||||
}
|
||||
|
||||
|
||||
@@ -23,19 +23,19 @@ class FontStyleConfig {
|
||||
return ShadowColor;
|
||||
}
|
||||
|
||||
Uint32 getFontCharacterSize() const {
|
||||
const Uint32& getFontCharacterSize() const {
|
||||
return CharacterSize;
|
||||
}
|
||||
|
||||
Uint32 getFontStyle() const {
|
||||
const Uint32& getFontStyle() const {
|
||||
return Style;
|
||||
}
|
||||
|
||||
Float getOutlineThickness() const {
|
||||
const Float& getOutlineThickness() const {
|
||||
return OutlineThickness;
|
||||
}
|
||||
|
||||
Color getOutlineColor() const {
|
||||
const Color& getOutlineColor() const {
|
||||
return OutlineColor;
|
||||
}
|
||||
|
||||
|
||||
@@ -8,6 +8,12 @@ namespace EE { namespace UI {
|
||||
|
||||
class EE_API UIDropDownList : public UITextInput {
|
||||
public:
|
||||
class StyleConfig {
|
||||
public:
|
||||
Uint32 MaxNumVisibleItems = 10;
|
||||
bool PopUpToMainControl = false;
|
||||
};
|
||||
|
||||
static UIDropDownList * New();
|
||||
|
||||
UIDropDownList();
|
||||
@@ -32,9 +38,9 @@ class EE_API UIDropDownList : public UITextInput {
|
||||
|
||||
void setMaxNumVisibleItems(const Uint32 & maxNumVisibleItems);
|
||||
|
||||
UIDropDownListStyleConfig getStyleConfig() const;
|
||||
const StyleConfig& getStyleConfig() const;
|
||||
|
||||
void setStyleConfig(const UIDropDownListStyleConfig & styleConfig);
|
||||
void setStyleConfig(const StyleConfig & styleConfig);
|
||||
|
||||
virtual bool setAttribute( const NodeAttribute& attribute, const Uint32& state = UIState::StateFlagNormal );
|
||||
|
||||
@@ -42,7 +48,7 @@ class EE_API UIDropDownList : public UITextInput {
|
||||
protected:
|
||||
friend class UIComboBox;
|
||||
|
||||
UIDropDownListStyleConfig mStyleConfig;
|
||||
StyleConfig mStyleConfig;
|
||||
UIListBox * mListBox;
|
||||
UINode * mFriendCtrl;
|
||||
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
#ifndef EE_UICUITHEMECONFIG_HPP
|
||||
#define EE_UICUITHEMECONFIG_HPP
|
||||
|
||||
#include <eepp/ui/base.hpp>
|
||||
#include <eepp/ui/uihelper.hpp>
|
||||
#include <eepp/graphics/fontstyleconfig.hpp>
|
||||
|
||||
namespace EE { namespace Graphics {
|
||||
class Font;
|
||||
}}
|
||||
|
||||
namespace EE { namespace UI {
|
||||
|
||||
class UIFontStyleConfig : public FontStyleConfig {
|
||||
public:
|
||||
const Color& getFontSelectedColor() const {
|
||||
return FontSelectedColor;
|
||||
}
|
||||
|
||||
Color getFontSelectionBackColor() const {
|
||||
return FontSelectionBackColor;
|
||||
}
|
||||
|
||||
void setFontSelectedColor( const Color& color ) {
|
||||
FontSelectedColor = color;
|
||||
}
|
||||
|
||||
void setFontSelectionBackColor(const Color& color) {
|
||||
FontSelectionBackColor = color;
|
||||
}
|
||||
|
||||
UIFontStyleConfig() : FontStyleConfig() {}
|
||||
|
||||
UIFontStyleConfig( const UIFontStyleConfig& fontStyleConfig ) :
|
||||
FontStyleConfig( fontStyleConfig ),
|
||||
FontSelectedColor( fontStyleConfig.FontSelectedColor ),
|
||||
FontSelectionBackColor( fontStyleConfig.FontSelectionBackColor )
|
||||
{}
|
||||
|
||||
virtual void updateStyleConfig( const UIFontStyleConfig& fontStyleConfig ) {
|
||||
FontStyleConfig::updateFontStyleConfig( fontStyleConfig );
|
||||
FontSelectedColor = fontStyleConfig.FontSelectedColor;
|
||||
FontSelectionBackColor = fontStyleConfig.FontSelectionBackColor;
|
||||
}
|
||||
|
||||
Color FontSelectedColor = Color(255,255,255,255);
|
||||
Color FontSelectionBackColor = Color(50,50,50,255);
|
||||
};
|
||||
|
||||
}}
|
||||
|
||||
#endif
|
||||
@@ -151,6 +151,15 @@ enum LayoutPositionRules {
|
||||
BOTTOM_OF
|
||||
};
|
||||
|
||||
class UIScaleType {
|
||||
public:
|
||||
enum Type {
|
||||
None,
|
||||
Expand,
|
||||
FitInside
|
||||
};
|
||||
};
|
||||
|
||||
static const Uint32 UI_CONTROL_DEFAULT_ALIGN = UI_HALIGN_LEFT | UI_VALIGN_CENTER;
|
||||
|
||||
static const Uint32 UI_CONTROL_ALIGN_CENTER = UI_HALIGN_CENTER | UI_VALIGN_CENTER;
|
||||
|
||||
@@ -17,7 +17,7 @@ class EE_API UIListBox : public UITouchDragableWidget {
|
||||
|
||||
static UIListBox * NewWithTag( const std::string& tag );
|
||||
|
||||
UIListBox( const std::string& tag );
|
||||
explicit UIListBox( const std::string& tag );
|
||||
|
||||
virtual ~UIListBox();
|
||||
|
||||
@@ -69,10 +69,6 @@ class EE_API UIListBox : public UITouchDragableWidget {
|
||||
|
||||
const Color& getFontColor() const;
|
||||
|
||||
void setFontOverColor( const Color& Color );
|
||||
|
||||
const Color& getFontOverColor() const;
|
||||
|
||||
void setFontSelectedColor( const Color& Color );
|
||||
|
||||
const Color& getFontSelectedColor() const;
|
||||
|
||||
@@ -12,6 +12,15 @@ namespace EE { namespace UI {
|
||||
|
||||
class EE_API UIMenu : public UIWidget {
|
||||
public:
|
||||
class StyleConfig {
|
||||
public:
|
||||
Rectf Padding = Rectf(0, 0, 0, 0);
|
||||
Uint32 MinWidth = 0;
|
||||
Uint32 MinSpaceForIcons = 0;
|
||||
Uint32 MinRightMargin = 0;
|
||||
|
||||
};
|
||||
|
||||
static UIMenu * New();
|
||||
|
||||
static void fixMenuPos( Vector2f& position, UIMenu * Menu, UIMenu * parent = NULL, UIMenuSubMenu * SubMenu = NULL );
|
||||
@@ -62,7 +71,7 @@ class EE_API UIMenu : public UIWidget {
|
||||
|
||||
void setMinRightMargin(const Uint32 & minRightMargin);
|
||||
|
||||
UITooltipStyleConfig getFontStyleConfig() const;
|
||||
const StyleConfig& getStyleConfig() const;
|
||||
|
||||
virtual void loadFromXmlNode( const pugi::xml_node& node );
|
||||
|
||||
@@ -73,7 +82,7 @@ class EE_API UIMenu : public UIWidget {
|
||||
friend class UIMenuSubMenu;
|
||||
|
||||
std::deque<UINode *> mItems;
|
||||
UIMenuStyleConfig mStyleConfig;
|
||||
StyleConfig mStyleConfig;
|
||||
Uint32 mMaxWidth;
|
||||
Uint32 mNextPosY;
|
||||
Uint32 mBiggestIcon;
|
||||
|
||||
@@ -9,6 +9,14 @@ namespace EE { namespace UI {
|
||||
|
||||
class EE_API UIProgressBar : public UIWidget {
|
||||
public:
|
||||
class StyleConfig {
|
||||
public:
|
||||
bool DisplayPercent = false;
|
||||
bool VerticalExpand = true;
|
||||
Vector2f MovementSpeed = Vector2f( 64.f, 0 );
|
||||
Rectf FillerPadding;
|
||||
};
|
||||
|
||||
static UIProgressBar * New();
|
||||
|
||||
UIProgressBar();
|
||||
@@ -52,8 +60,10 @@ class EE_API UIProgressBar : public UIWidget {
|
||||
UITextView * getTextBox() const;
|
||||
|
||||
virtual bool setAttribute( const NodeAttribute& attribute, const Uint32& state = UIState::StateFlagNormal );
|
||||
|
||||
const StyleConfig& getStyleConfig() const;
|
||||
protected:
|
||||
UIProgressBarStyleConfig mStyleConfig;
|
||||
StyleConfig mStyleConfig;
|
||||
Float mProgress;
|
||||
Float mTotalSteps;
|
||||
UITextView * mTextBox;
|
||||
|
||||
@@ -9,6 +9,13 @@ namespace EE { namespace UI {
|
||||
|
||||
class EE_API UIPushButton : public UIWidget {
|
||||
public:
|
||||
class StyleConfig {
|
||||
public:
|
||||
Int32 IconHorizontalMargin = 4;
|
||||
bool IconAutoMargin = true;
|
||||
Sizei IconMinSize;
|
||||
};
|
||||
|
||||
static UIPushButton * New();
|
||||
|
||||
UIPushButton();
|
||||
@@ -35,51 +42,19 @@ class EE_API UIPushButton : public UIWidget {
|
||||
|
||||
UITextView * getTextBox() const;
|
||||
|
||||
void setFont( Font * font );
|
||||
|
||||
Font * getFont();
|
||||
|
||||
const Color& getFontColor() const;
|
||||
|
||||
void setFontColor( const Color& color );
|
||||
|
||||
const Color& getFontOverColor() const;
|
||||
|
||||
void setFontOverColor( const Color& color );
|
||||
|
||||
const Color& getFontShadowColor() const;
|
||||
|
||||
void setFontShadowColor( const Color& color );
|
||||
|
||||
Uint32 getCharacterSize();
|
||||
|
||||
void setCharacterSize( const Uint32& characterSize );
|
||||
|
||||
const Uint32& getFontStyle() const;
|
||||
|
||||
UIPushButton * setFontStyle( const Uint32& fontStyle );
|
||||
|
||||
const Float & getOutlineThickness() const;
|
||||
|
||||
UIPushButton * setOutlineThickness( const Float& outlineThickness );
|
||||
|
||||
const Color& getOutlineColor() const;
|
||||
|
||||
UIPushButton * setOutlineColor( const Color& outlineColor );
|
||||
|
||||
UIFontStyleConfig getStyleConfig() const;
|
||||
const StyleConfig& getStyleConfig() const;
|
||||
|
||||
void setIconMinimumSize( const Sizei& minIconSize );
|
||||
|
||||
void setStyleConfig(const UIPushButtonStyleConfig & styleConfig);
|
||||
void setStyleConfig(const StyleConfig & styleConfig);
|
||||
|
||||
virtual bool setAttribute( const NodeAttribute& attribute, const Uint32& state = UIState::StateFlagNormal );
|
||||
protected:
|
||||
UIPushButtonStyleConfig mStyleConfig;
|
||||
StyleConfig mStyleConfig;
|
||||
UIImage * mIcon;
|
||||
UITextView * mTextBox;
|
||||
|
||||
UIPushButton( const std::string& tag );
|
||||
explicit UIPushButton( const std::string& tag );
|
||||
|
||||
virtual void onSizeChange();
|
||||
|
||||
|
||||
@@ -9,8 +9,12 @@ class EE_API UISelectButton : public UIPushButton {
|
||||
public:
|
||||
static UISelectButton * New();
|
||||
|
||||
static UISelectButton * NewWithTag(const std::string & tag);
|
||||
|
||||
UISelectButton();
|
||||
|
||||
explicit UISelectButton( const std::string& tag );
|
||||
|
||||
virtual ~UISelectButton();
|
||||
|
||||
virtual Uint32 getType() const;
|
||||
@@ -22,15 +26,7 @@ class EE_API UISelectButton : public UIPushButton {
|
||||
virtual void unselect();
|
||||
|
||||
virtual void select();
|
||||
|
||||
void setFontSelectedColor( const Color& color );
|
||||
|
||||
const Color& getFontSelectedColor() const;
|
||||
|
||||
virtual bool setAttribute( const NodeAttribute& attribute, const Uint32& state = UIState::StateFlagNormal );
|
||||
protected:
|
||||
UISelectButton( const std::string& tag );
|
||||
|
||||
virtual void onStateChange();
|
||||
};
|
||||
|
||||
|
||||
@@ -6,6 +6,14 @@
|
||||
|
||||
namespace EE { namespace UI {
|
||||
|
||||
class EE_API UISliderStyleConfig {
|
||||
public:
|
||||
UISliderStyleConfig() {}
|
||||
|
||||
bool AllowHalfSliderOut = false;
|
||||
bool ExpandBackground = false;
|
||||
};
|
||||
|
||||
class EE_API UISlider : public UIWidget {
|
||||
public:
|
||||
static UISlider * New();
|
||||
|
||||
@@ -9,6 +9,21 @@ namespace EE { namespace UI {
|
||||
|
||||
class EE_API UITabWidget : public UIWidget {
|
||||
public:
|
||||
class StyleConfig {
|
||||
public:
|
||||
Int32 TabSeparation = 0;
|
||||
Uint32 MaxTextLength = 30;
|
||||
Uint32 TabWidgetHeight = 0;
|
||||
Uint32 TabTextAlign = ( UI_HALIGN_CENTER | UI_VALIGN_CENTER );
|
||||
Uint32 MinTabWidth = 32;
|
||||
Uint32 MaxTabWidth = 300;
|
||||
bool TabsClosable = false;
|
||||
bool SpecialBorderTabs = false; //! Indicates if the periferical tabs ( the left and right border tab ) are different from the central tabs.
|
||||
bool DrawLineBelowTabs = false;
|
||||
Color LineBelowTabsColor;
|
||||
Int32 LineBelowTabsYOffset = 0;
|
||||
};
|
||||
|
||||
static UITabWidget * New();
|
||||
|
||||
UITabWidget();
|
||||
@@ -91,11 +106,9 @@ class EE_API UITabWidget : public UIWidget {
|
||||
|
||||
void setLineBelowTabsYOffset(const Int32 & lineBelowTabsYOffset);
|
||||
|
||||
UITooltipStyleConfig getFontStyleConfig() const;
|
||||
const StyleConfig & getStyleConfig() const;
|
||||
|
||||
UITabWidgetStyleConfig getStyleConfig() const;
|
||||
|
||||
void setStyleConfig(const UITabWidgetStyleConfig & styleConfig);
|
||||
void setStyleConfig(const StyleConfig & styleConfig);
|
||||
|
||||
virtual bool setAttribute( const NodeAttribute& attribute, const Uint32& state = UIState::StateFlagNormal );
|
||||
protected:
|
||||
@@ -103,7 +116,7 @@ class EE_API UITabWidget : public UIWidget {
|
||||
|
||||
UIWidget * mCtrlContainer;
|
||||
UIWidget * mTabContainer;
|
||||
UITabWidgetStyleConfig mStyleConfig;
|
||||
StyleConfig mStyleConfig;
|
||||
std::deque<UITab*> mTabs;
|
||||
UITab * mTabSelected;
|
||||
Uint32 mTabSelectedIndex;
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
#ifndef EE_UICUITEXTEDIT_HPP
|
||||
#define EE_UICUITEXTEDIT_HPP
|
||||
|
||||
#include <eepp/ui/uinode.hpp>
|
||||
#include <eepp/ui/uitextinput.hpp>
|
||||
#include <eepp/ui/uiscrollbar.hpp>
|
||||
|
||||
namespace EE { namespace UI {
|
||||
|
||||
class UIScrollBar;
|
||||
|
||||
class EE_API UITextEdit : public UIWidget {
|
||||
public:
|
||||
static UITextEdit * New();
|
||||
|
||||
@@ -21,8 +21,6 @@ class EE_API UITextInputPassword : public UITextInput
|
||||
virtual UITextView * setText( const String& text );
|
||||
|
||||
Text * getPassCache() const;
|
||||
|
||||
void setFontStyleConfig( const UITooltipStyleConfig& fontStyleConfig );
|
||||
protected:
|
||||
Text * mPassCache;
|
||||
|
||||
@@ -31,6 +29,10 @@ class EE_API UITextInputPassword : public UITextInput
|
||||
void updateText();
|
||||
|
||||
void updatePass( const String& pass );
|
||||
|
||||
void updateFontStyleConfig();
|
||||
|
||||
virtual void onStateChange();
|
||||
};
|
||||
|
||||
}}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#define EE_UICUITEXTBOX_H
|
||||
|
||||
#include <eepp/ui/uiwidget.hpp>
|
||||
#include <eepp/ui/uithemeconfig.hpp>
|
||||
#include <eepp/ui/uifontstyleconfig.hpp>
|
||||
#include <eepp/graphics/text.hpp>
|
||||
|
||||
namespace EE { namespace UI {
|
||||
@@ -77,13 +77,13 @@ class EE_API UITextView : public UIWidget {
|
||||
|
||||
bool isTextSelectionEnabled() const;
|
||||
|
||||
UITooltipStyleConfig getFontStyleConfig() const;
|
||||
const UIFontStyleConfig & getFontStyleConfig() const;
|
||||
|
||||
virtual bool setAttribute( const NodeAttribute& attribute, const Uint32& state = UIState::StateFlagNormal );
|
||||
protected:
|
||||
Text * mTextCache;
|
||||
String mString;
|
||||
UITooltipStyleConfig mFontStyleConfig;
|
||||
UIFontStyleConfig mFontStyleConfig;
|
||||
Vector2f mAlignOffset;
|
||||
Vector2f mRealAlignOffset;
|
||||
Int32 mSelCurInit;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#define EE_UICUITHEME_HPP
|
||||
|
||||
#include <eepp/ui/base.hpp>
|
||||
#include <eepp/ui/uithemeconfig.hpp>
|
||||
#include <eepp/ui/uifontstyleconfig.hpp>
|
||||
#include <eepp/ui/uihelper.hpp>
|
||||
#include <eepp/ui/uiskin.hpp>
|
||||
#include <eepp/ui/css/stylesheet.hpp>
|
||||
|
||||
@@ -1,210 +0,0 @@
|
||||
#ifndef EE_UICUITHEMECONFIG_HPP
|
||||
#define EE_UICUITHEMECONFIG_HPP
|
||||
|
||||
#include <eepp/ui/base.hpp>
|
||||
#include <eepp/ui/uihelper.hpp>
|
||||
#include <eepp/graphics/fontstyleconfig.hpp>
|
||||
|
||||
namespace EE { namespace Graphics {
|
||||
class Font;
|
||||
}}
|
||||
|
||||
namespace EE { namespace UI {
|
||||
|
||||
class UIFontStyleConfig : public FontStyleConfig {
|
||||
public:
|
||||
const Color& getFontOverColor() const {
|
||||
return FontOverColor;
|
||||
}
|
||||
|
||||
const Color& getFontSelectedColor() const {
|
||||
return FontSelectedColor;
|
||||
}
|
||||
|
||||
Color getFontSelectionBackColor() const {
|
||||
return FontSelectionBackColor;
|
||||
}
|
||||
|
||||
void setFontShadowColor( const Color& color ) {
|
||||
ShadowColor = color;
|
||||
}
|
||||
|
||||
void setFontOverColor( const Color& color ) {
|
||||
FontOverColor = color;
|
||||
}
|
||||
|
||||
void setFontSelectedColor( const Color& color ) {
|
||||
FontSelectedColor = color;
|
||||
}
|
||||
|
||||
void setFontSelectionBackColor(const Color& color) {
|
||||
FontSelectionBackColor = color;
|
||||
}
|
||||
|
||||
UIFontStyleConfig() : FontStyleConfig() {}
|
||||
|
||||
UIFontStyleConfig( const UIFontStyleConfig& fontStyleConfig ) :
|
||||
FontStyleConfig( fontStyleConfig ),
|
||||
FontOverColor( fontStyleConfig.FontOverColor ),
|
||||
FontSelectedColor( fontStyleConfig.FontSelectedColor ),
|
||||
FontSelectionBackColor( fontStyleConfig.FontSelectionBackColor )
|
||||
{}
|
||||
|
||||
virtual void updateStyleConfig( const UIFontStyleConfig& fontStyleConfig ) {
|
||||
FontStyleConfig::updateFontStyleConfig( fontStyleConfig );
|
||||
FontOverColor = fontStyleConfig.FontOverColor;
|
||||
FontSelectedColor = fontStyleConfig.FontSelectedColor;
|
||||
FontSelectionBackColor = fontStyleConfig.FontSelectionBackColor;
|
||||
}
|
||||
|
||||
Color FontOverColor = Color(255,255,255,255);
|
||||
Color FontSelectedColor = Color(255,255,255,255);
|
||||
Color FontSelectionBackColor = Color(255,255,255,255);
|
||||
};
|
||||
|
||||
class UITabWidgetStyleConfig : public UIFontStyleConfig {
|
||||
public:
|
||||
UITabWidgetStyleConfig() {}
|
||||
|
||||
explicit UITabWidgetStyleConfig( UIFontStyleConfig fontStyleConfig ) :
|
||||
UIFontStyleConfig( fontStyleConfig )
|
||||
{}
|
||||
|
||||
Int32 TabSeparation = 0;
|
||||
Uint32 MaxTextLength = 30;
|
||||
Uint32 TabWidgetHeight = 0;
|
||||
Uint32 TabTextAlign = ( UI_HALIGN_CENTER | UI_VALIGN_CENTER );
|
||||
Uint32 MinTabWidth = 32;
|
||||
Uint32 MaxTabWidth = 300;
|
||||
bool TabsClosable = false;
|
||||
bool SpecialBorderTabs = false; //! Indicates if the periferical tabs ( the left and right border tab ) are different from the central tabs.
|
||||
bool DrawLineBelowTabs = false;
|
||||
Color LineBelowTabsColor;
|
||||
Int32 LineBelowTabsYOffset = 0;
|
||||
};
|
||||
|
||||
class UIProgressBarStyleConfig : public UIFontStyleConfig {
|
||||
public:
|
||||
UIProgressBarStyleConfig() {}
|
||||
|
||||
UIProgressBarStyleConfig( UIFontStyleConfig fontStyleConfig ) :
|
||||
UIFontStyleConfig( fontStyleConfig )
|
||||
{}
|
||||
|
||||
bool DisplayPercent = false;
|
||||
bool VerticalExpand = true;
|
||||
Vector2f MovementSpeed = Vector2f( 64.f, 0 );
|
||||
Rectf FillerPadding;
|
||||
};
|
||||
|
||||
class UIWinMenuStyleConfig : public UIFontStyleConfig {
|
||||
public:
|
||||
UIWinMenuStyleConfig() {}
|
||||
|
||||
UIWinMenuStyleConfig( UIFontStyleConfig fontStyleConfig ) :
|
||||
UIFontStyleConfig( fontStyleConfig )
|
||||
{}
|
||||
|
||||
Uint32 MarginBetweenButtons = 0;
|
||||
Uint32 ButtonMargin = 4;
|
||||
Uint32 MenuHeight = 0;
|
||||
Uint32 FirstButtonMargin = 1;
|
||||
};
|
||||
|
||||
class UIDropDownListStyleConfig : public UIFontStyleConfig {
|
||||
public:
|
||||
UIDropDownListStyleConfig() {}
|
||||
|
||||
explicit UIDropDownListStyleConfig( UIFontStyleConfig fontStyleConfig ) :
|
||||
UIFontStyleConfig( fontStyleConfig )
|
||||
{}
|
||||
|
||||
Uint32 MaxNumVisibleItems = 10;
|
||||
bool PopUpToMainControl = false;
|
||||
};
|
||||
|
||||
class UIWindowStyleConfig : public UIFontStyleConfig {
|
||||
public:
|
||||
UIWindowStyleConfig() {}
|
||||
|
||||
UIWindowStyleConfig( Uint32 winFlags, UIFontStyleConfig fontStyleConfig = UIFontStyleConfig() ) :
|
||||
UIFontStyleConfig( fontStyleConfig ),
|
||||
WinFlags( winFlags )
|
||||
{
|
||||
}
|
||||
|
||||
UIWindowStyleConfig( UIFontStyleConfig fontStyleConfig ) :
|
||||
UIFontStyleConfig( fontStyleConfig )
|
||||
{}
|
||||
|
||||
Uint32 WinFlags = UI_WIN_DEFAULT_FLAGS;
|
||||
Sizei DecorationSize;
|
||||
Sizei BorderSize;
|
||||
Sizef MinWindowSize;
|
||||
Vector2i ButtonsPositionFixer;
|
||||
Uint32 ButtonsSeparation = 4;
|
||||
Int32 MinCornerDistance = 24;
|
||||
Uint8 BaseAlpha = 255;
|
||||
bool DecorationAutoSize = true;
|
||||
bool BorderAutoSize = true;
|
||||
};
|
||||
|
||||
class UIMenuStyleConfig : public UIFontStyleConfig {
|
||||
public:
|
||||
UIMenuStyleConfig() {}
|
||||
|
||||
UIMenuStyleConfig( UIFontStyleConfig fontStyleConfig ) :
|
||||
UIFontStyleConfig( fontStyleConfig )
|
||||
{}
|
||||
|
||||
Rectf Padding = Rectf(0, 0, 0, 0);
|
||||
Uint32 MinWidth = 0;
|
||||
Uint32 MinSpaceForIcons = 0;
|
||||
Uint32 MinRightMargin = 0;
|
||||
|
||||
};
|
||||
|
||||
class UIPushButtonStyleConfig : public UIFontStyleConfig {
|
||||
public:
|
||||
UIPushButtonStyleConfig() {}
|
||||
|
||||
UIPushButtonStyleConfig( UIFontStyleConfig fontStyleConfig ) :
|
||||
UIFontStyleConfig( fontStyleConfig )
|
||||
{}
|
||||
|
||||
Int32 IconHorizontalMargin = 4;
|
||||
bool IconAutoMargin = true;
|
||||
Sizei IconMinSize;
|
||||
};
|
||||
|
||||
class UISliderStyleConfig {
|
||||
public:
|
||||
UISliderStyleConfig() {}
|
||||
|
||||
bool AllowHalfSliderOut = false;
|
||||
bool ExpandBackground = false;
|
||||
};
|
||||
|
||||
class UITooltipStyleConfig : public UIFontStyleConfig {
|
||||
public:
|
||||
UITooltipStyleConfig() {}
|
||||
|
||||
UITooltipStyleConfig( UIFontStyleConfig fontStyleConfig ) :
|
||||
UIFontStyleConfig( fontStyleConfig )
|
||||
{}
|
||||
|
||||
Rectf Padding;
|
||||
};
|
||||
|
||||
class UIScaleType {
|
||||
public:
|
||||
enum Type {
|
||||
None,
|
||||
Expand,
|
||||
FitInside
|
||||
};
|
||||
};
|
||||
|
||||
}}
|
||||
|
||||
#endif
|
||||
@@ -2,9 +2,11 @@
|
||||
#define EE_UICUITOOLTIP_HPP
|
||||
|
||||
#include <eepp/ui/uiwidget.hpp>
|
||||
#include <eepp/ui/uifontstyleconfig.hpp>
|
||||
|
||||
namespace EE { namespace Graphics {
|
||||
class Text;
|
||||
class Font;
|
||||
}}
|
||||
|
||||
namespace EE { namespace UI {
|
||||
@@ -49,10 +51,6 @@ class EE_API UITooltip : public UIWidget {
|
||||
|
||||
virtual void onFontChanged();
|
||||
|
||||
virtual void setPadding( const Rectf& padding );
|
||||
|
||||
const Rectf& getPadding() const;
|
||||
|
||||
Text * getTextCache();
|
||||
|
||||
Float getTextWidth();
|
||||
@@ -73,9 +71,9 @@ class EE_API UITooltip : public UIWidget {
|
||||
|
||||
void setTooltipOf(UINode * tooltipOf);
|
||||
|
||||
UITooltipStyleConfig getStyleConfig() const;
|
||||
const UIFontStyleConfig & getFontStyleConfig() const;
|
||||
|
||||
void setStyleConfig(const UITooltipStyleConfig & styleConfig);
|
||||
void setFontStyleConfig(const UIFontStyleConfig & styleConfig);
|
||||
|
||||
Uint32 getCharacterSize() const;
|
||||
|
||||
@@ -96,7 +94,7 @@ class EE_API UITooltip : public UIWidget {
|
||||
virtual bool setAttribute( const NodeAttribute& attribute, const Uint32& state = UIState::StateFlagNormal );
|
||||
protected:
|
||||
Text * mTextCache;
|
||||
UITooltipStyleConfig mStyleConfig;
|
||||
UIFontStyleConfig mStyleConfig;
|
||||
Vector2f mAlignOffset;
|
||||
Rectf mRealPadding;
|
||||
Time mTooltipTime;
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
#include <eepp/scene/nodeattribute.hpp>
|
||||
#include <eepp/ui/uinode.hpp>
|
||||
#include <eepp/ui/css/stylesheetelement.hpp>
|
||||
#include <eepp/ui/uithemeconfig.hpp>
|
||||
|
||||
namespace pugi {
|
||||
class xml_node;
|
||||
|
||||
@@ -15,17 +15,37 @@ class UISceneNode;
|
||||
|
||||
class EE_API UIWindow : public UIWidget {
|
||||
public:
|
||||
class StyleConfig {
|
||||
public:
|
||||
StyleConfig() {}
|
||||
|
||||
StyleConfig( Uint32 winFlags ) :
|
||||
WinFlags( winFlags )
|
||||
{}
|
||||
|
||||
Uint32 WinFlags = UI_WIN_DEFAULT_FLAGS;
|
||||
Sizei DecorationSize;
|
||||
Sizei BorderSize;
|
||||
Sizef MinWindowSize;
|
||||
Vector2i ButtonsPositionFixer;
|
||||
Uint32 ButtonsSeparation = 4;
|
||||
Int32 MinCornerDistance = 24;
|
||||
Uint8 BaseAlpha = 255;
|
||||
bool DecorationAutoSize = true;
|
||||
bool BorderAutoSize = true;
|
||||
};
|
||||
|
||||
enum WindowBaseContainerType {
|
||||
SIMPLE_LAYOUT,
|
||||
LINEAR_LAYOUT,
|
||||
RELATIVE_LAYOUT
|
||||
};
|
||||
|
||||
static UIWindow * NewOpt( WindowBaseContainerType type, const UIWindowStyleConfig& windowStyleConfig );
|
||||
static UIWindow * NewOpt( WindowBaseContainerType type, const StyleConfig& windowStyleConfig );
|
||||
|
||||
static UIWindow * New();
|
||||
|
||||
explicit UIWindow( WindowBaseContainerType type, const UIWindowStyleConfig& windowStyleConfig );
|
||||
explicit UIWindow( WindowBaseContainerType type, const StyleConfig& windowStyleConfig );
|
||||
|
||||
explicit UIWindow( WindowBaseContainerType type = SIMPLE_LAYOUT );
|
||||
|
||||
@@ -95,9 +115,9 @@ class EE_API UIWindow : public UIWidget {
|
||||
|
||||
UIWindow * setWinFlags(const Uint32 & winFlags);
|
||||
|
||||
UIWindowStyleConfig getStyleConfig() const;
|
||||
const StyleConfig& getStyleConfig() const;
|
||||
|
||||
UIWindow * setStyleConfig(const UIWindowStyleConfig & styleConfig);
|
||||
UIWindow * setStyleConfig(const StyleConfig & styleConfig);
|
||||
|
||||
UIWindow * setMinWindowSize( Sizef size );
|
||||
|
||||
@@ -155,7 +175,7 @@ class EE_API UIWindow : public UIWidget {
|
||||
};
|
||||
|
||||
FrameBuffer * mFrameBuffer;
|
||||
UIWindowStyleConfig mStyleConfig;
|
||||
StyleConfig mStyleConfig;
|
||||
UINode * mWindowDecoration;
|
||||
UINode * mBorderLeft;
|
||||
UINode * mBorderRight;
|
||||
|
||||
@@ -10,6 +10,14 @@ namespace EE { namespace UI {
|
||||
|
||||
class EE_API UIWinMenu : public UIWidget {
|
||||
public:
|
||||
class StyleConfig {
|
||||
public:
|
||||
Uint32 MarginBetweenButtons = 0;
|
||||
Uint32 ButtonMargin = 4;
|
||||
Uint32 MenuHeight = 0;
|
||||
Uint32 FirstButtonMargin = 1;
|
||||
};
|
||||
|
||||
static UIWinMenu * New();
|
||||
|
||||
UIWinMenu();
|
||||
@@ -46,9 +54,9 @@ class EE_API UIWinMenu : public UIWidget {
|
||||
|
||||
void setFirstButtonMargin( const Uint32& buttonMargin );
|
||||
|
||||
UIWinMenuStyleConfig getStyleConfig() const;
|
||||
const StyleConfig& getStyleConfig() const;
|
||||
|
||||
void setStyleConfig(const UIWinMenuStyleConfig & styleConfig);
|
||||
void setStyleConfig(const StyleConfig & styleConfig);
|
||||
|
||||
virtual bool setAttribute( const NodeAttribute& attribute, const Uint32& state = UIState::StateFlagNormal );
|
||||
|
||||
@@ -56,7 +64,7 @@ class EE_API UIWinMenu : public UIWidget {
|
||||
protected:
|
||||
typedef std::list< std::pair< UISelectButton *, UIPopUpMenu * > > WinMenuList;
|
||||
|
||||
UIWinMenuStyleConfig mStyleConfig;
|
||||
StyleConfig mStyleConfig;
|
||||
UIPopUpMenu * mCurrentMenu;
|
||||
WinMenuList mButtons;
|
||||
|
||||
|
||||
@@ -309,6 +309,7 @@
|
||||
../../include/eepp/ui/uicommondialog.hpp
|
||||
../../include/eepp/ui/uidropdownlist.hpp
|
||||
../../include/eepp/ui/uieventdispatcher.hpp
|
||||
../../include/eepp/ui/uifontstyleconfig.hpp
|
||||
../../include/eepp/ui/uigridlayout.hpp
|
||||
../../include/eepp/ui/uihelper.hpp
|
||||
../../include/eepp/ui/uiimage.hpp
|
||||
@@ -352,7 +353,6 @@
|
||||
../../include/eepp/ui/uitextinputpassword.hpp
|
||||
../../include/eepp/ui/uitextureregion.hpp
|
||||
../../include/eepp/ui/uitextview.hpp
|
||||
../../include/eepp/ui/uithemeconfig.hpp
|
||||
../../include/eepp/ui/uitheme.hpp
|
||||
../../include/eepp/ui/uithememanager.hpp
|
||||
../../include/eepp/ui/uitooltip.hpp
|
||||
|
||||
@@ -138,7 +138,7 @@ void MapLayerProperties::loadProperties() {
|
||||
}
|
||||
}
|
||||
|
||||
void MapLayerProperties::onOKClick( const Event * Event ) {
|
||||
void MapLayerProperties::onOKClick( const Event * ) {
|
||||
saveProperties();
|
||||
|
||||
mLayer->setName( mUIInput->getText().toUtf8() );
|
||||
@@ -150,15 +150,15 @@ void MapLayerProperties::onOKClick( const Event * Event ) {
|
||||
mUIWindow->closeWindow();
|
||||
}
|
||||
|
||||
void MapLayerProperties::onCancelClick( const Event * Event ) {
|
||||
void MapLayerProperties::onCancelClick( const Event * ) {
|
||||
mUIWindow->closeWindow();
|
||||
}
|
||||
|
||||
void MapLayerProperties::onWindowClose( const Event * Event ) {
|
||||
void MapLayerProperties::onWindowClose( const Event * ) {
|
||||
eeDelete( this );
|
||||
}
|
||||
|
||||
void MapLayerProperties::onAddCellClick( const Event * Event ) {
|
||||
void MapLayerProperties::onAddCellClick( const Event * ) {
|
||||
mGenGrid->add( createCell() );
|
||||
|
||||
Uint32 Index = mGenGrid->getItemSelectedIndex();
|
||||
@@ -168,7 +168,7 @@ void MapLayerProperties::onAddCellClick( const Event * Event ) {
|
||||
}
|
||||
}
|
||||
|
||||
void MapLayerProperties::onRemoveCellClick( const Event * Event ) {
|
||||
void MapLayerProperties::onRemoveCellClick( const Event * ) {
|
||||
Uint32 Index = mGenGrid->getItemSelectedIndex();
|
||||
|
||||
if ( eeINDEX_NOT_FOUND != Index ) {
|
||||
|
||||
@@ -139,7 +139,7 @@ TileMapProperties::TileMapProperties( TileMap * Map ) :
|
||||
TileMapProperties::~TileMapProperties() {
|
||||
}
|
||||
|
||||
void TileMapProperties::onRedChange( const Event * Event ) {
|
||||
void TileMapProperties::onRedChange( const Event * ) {
|
||||
Color Col = mUIBaseColor->getBackground()->getColor();
|
||||
Col.r = (Uint8)mUIRedSlider->getValue();
|
||||
mUIBaseColor->setBackgroundColor( Col );
|
||||
@@ -150,7 +150,7 @@ void TileMapProperties::onRedChange( const Event * Event ) {
|
||||
mMap->setBaseColor( MapCol );
|
||||
}
|
||||
|
||||
void TileMapProperties::onGreenChange( const Event * Event ) {
|
||||
void TileMapProperties::onGreenChange( const Event * ) {
|
||||
Color Col = mUIBaseColor->getBackground()->getColor();
|
||||
Col.g = (Uint8)mUIGreenSlider->getValue();
|
||||
mUIBaseColor->setBackgroundColor( Col );
|
||||
@@ -161,7 +161,7 @@ void TileMapProperties::onGreenChange( const Event * Event ) {
|
||||
mMap->setBaseColor( MapCol );
|
||||
}
|
||||
|
||||
void TileMapProperties::onBlueChange( const Event * Event ) {
|
||||
void TileMapProperties::onBlueChange( const Event * ) {
|
||||
Color Col = mUIBaseColor->getBackground()->getColor();
|
||||
Col.b = (Uint8)mUIBlueSlider->getValue();
|
||||
mUIBaseColor->setBackgroundColor( Col );
|
||||
@@ -204,21 +204,21 @@ void TileMapProperties::loadProperties() {
|
||||
}
|
||||
}
|
||||
|
||||
void TileMapProperties::onOKClick( const Event * Event ) {
|
||||
void TileMapProperties::onOKClick( const Event * ) {
|
||||
saveProperties();
|
||||
|
||||
mUIWindow->closeWindow();
|
||||
}
|
||||
|
||||
void TileMapProperties::onCancelClick( const Event * Event ) {
|
||||
void TileMapProperties::onCancelClick( const Event * ) {
|
||||
mUIWindow->closeWindow();
|
||||
}
|
||||
|
||||
void TileMapProperties::onWindowClose( const Event * Event ) {
|
||||
void TileMapProperties::onWindowClose( const Event * ) {
|
||||
eeDelete( this );
|
||||
}
|
||||
|
||||
void TileMapProperties::onAddCellClick( const Event * Event ) {
|
||||
void TileMapProperties::onAddCellClick( const Event * ) {
|
||||
mGenGrid->add( createCell() );
|
||||
|
||||
Uint32 Index = mGenGrid->getItemSelectedIndex();
|
||||
@@ -228,7 +228,7 @@ void TileMapProperties::onAddCellClick( const Event * Event ) {
|
||||
}
|
||||
}
|
||||
|
||||
void TileMapProperties::onRemoveCellClick( const Event * Event ) {
|
||||
void TileMapProperties::onRemoveCellClick( const Event * ) {
|
||||
Uint32 Index = mGenGrid->getItemSelectedIndex();
|
||||
|
||||
if ( eeINDEX_NOT_FOUND != Index ) {
|
||||
|
||||
@@ -55,7 +55,7 @@ UIGOTypeNew::~UIGOTypeNew() {
|
||||
|
||||
}
|
||||
|
||||
void UIGOTypeNew::onOKClick( const Event * Event ) {
|
||||
void UIGOTypeNew::onOKClick( const Event * ) {
|
||||
if ( mUIInput->getText().size() ) {
|
||||
if ( mCb )
|
||||
mCb( mUIInput->getText().toUtf8(), String::hash( mUIInput->getText().toUtf8() ) );
|
||||
@@ -64,11 +64,11 @@ void UIGOTypeNew::onOKClick( const Event * Event ) {
|
||||
mUIWindow->closeWindow();
|
||||
}
|
||||
|
||||
void UIGOTypeNew::onCancelClick( const Event * Event ) {
|
||||
void UIGOTypeNew::onCancelClick( const Event * ) {
|
||||
mUIWindow->closeWindow();
|
||||
}
|
||||
|
||||
void UIGOTypeNew::onWindowClose( const Event * Event ) {
|
||||
void UIGOTypeNew::onWindowClose( const Event * ) {
|
||||
eeDelete( this );
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ UIMap * UIMap::New( UITheme * Theme, TileMap * Map ) {
|
||||
}
|
||||
|
||||
UIMap::UIMap( UITheme * Theme, TileMap * Map ) :
|
||||
UIWindow( SIMPLE_LAYOUT, UIWindowStyleConfig( UI_WIN_NO_BORDER | UI_WIN_FRAME_BUFFER ) ),
|
||||
UIWindow( SIMPLE_LAYOUT, StyleConfig( UI_WIN_NO_BORDER | UI_WIN_FRAME_BUFFER ) ),
|
||||
mMap( Map ),
|
||||
mCurLayer( NULL ),
|
||||
mEditingMode( 0 ),
|
||||
|
||||
@@ -72,7 +72,7 @@ void UIMapLayerNew::onOnKeyUp( const Event * event ) {
|
||||
}
|
||||
}
|
||||
|
||||
void UIMapLayerNew::onOKClick( const Event * event ) {
|
||||
void UIMapLayerNew::onOKClick( const Event * ) {
|
||||
if ( mUILayerName->getText().size() ) {
|
||||
mLayer = mUIMap->Map()->addLayer( mType, LAYER_FLAG_VISIBLE | LAYER_FLAG_LIGHTS_ENABLED, mUILayerName->getText() );
|
||||
|
||||
@@ -83,11 +83,11 @@ void UIMapLayerNew::onOKClick( const Event * event ) {
|
||||
mUIWindow->closeWindow();
|
||||
}
|
||||
|
||||
void UIMapLayerNew::onCancelClick( const Event * Event ) {
|
||||
void UIMapLayerNew::onCancelClick( const Event * ) {
|
||||
mUIWindow->closeWindow();
|
||||
}
|
||||
|
||||
void UIMapLayerNew::onWindowClose( const Event * Event ) {
|
||||
void UIMapLayerNew::onWindowClose( const Event * ) {
|
||||
eeDelete( this );
|
||||
}
|
||||
|
||||
|
||||
@@ -201,28 +201,28 @@ UIMapNew::UIMapNew( UIMap * Map, std::function<void()> NewMapCb, bool ResizeMap
|
||||
UIMapNew::~UIMapNew() {
|
||||
}
|
||||
|
||||
void UIMapNew::onRedChange( const Event * Event ) {
|
||||
void UIMapNew::onRedChange( const Event * ) {
|
||||
Color Col = mUIBaseColor->getBackground()->getColor();
|
||||
Col.r = (Uint8)mUIRedSlider->getValue();
|
||||
mUIBaseColor->setBackgroundColor( Col );
|
||||
mUIRedTxt->setText( String::toStr( (Int32)mUIRedSlider->getValue() ) );
|
||||
}
|
||||
|
||||
void UIMapNew::onGreenChange( const Event * Event ) {
|
||||
void UIMapNew::onGreenChange( const Event * ) {
|
||||
Color Col = mUIBaseColor->getBackground()->getColor();
|
||||
Col.g = (Uint8)mUIGreenSlider->getValue();
|
||||
mUIBaseColor->setBackgroundColor( Col );
|
||||
mUIGreenTxt->setText( String::toStr( (Uint32)mUIGreenSlider->getValue() ) );
|
||||
}
|
||||
|
||||
void UIMapNew::onBlueChange( const Event * Event ) {
|
||||
void UIMapNew::onBlueChange( const Event * ) {
|
||||
Color Col = mUIBaseColor->getBackground()->getColor();
|
||||
Col.b = (Uint8)mUIBlueSlider->getValue();
|
||||
mUIBaseColor->setBackgroundColor( Col );
|
||||
mUIBlueTxt->setText( String::toStr( (Uint32)mUIBlueSlider->getValue() ) );
|
||||
}
|
||||
|
||||
void UIMapNew::onOKClick( const Event * Event ) {
|
||||
void UIMapNew::onOKClick( const Event * ) {
|
||||
Int32 w = static_cast<Int32>( mUIMapWidth->getValue() );
|
||||
Int32 h = static_cast<Int32>( mUIMapHeight->getValue() );
|
||||
Int32 tw = static_cast<Int32>( mUIMapTWidth->getValue() );
|
||||
@@ -272,11 +272,11 @@ void UIMapNew::onOKClick( const Event * Event ) {
|
||||
mUIWindow->closeWindow();
|
||||
}
|
||||
|
||||
void UIMapNew::onCancelClick( const Event * Event ) {
|
||||
void UIMapNew::onCancelClick( const Event * ) {
|
||||
mUIWindow->closeWindow();
|
||||
}
|
||||
|
||||
void UIMapNew::onWindowClose( const Event * Event ) {
|
||||
void UIMapNew::onWindowClose( const Event * ) {
|
||||
eeDelete( this );
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include <eepp/ui/uispinbox.hpp>
|
||||
#include <eepp/ui/uicheckbox.hpp>
|
||||
#include <eepp/ui/uislider.hpp>
|
||||
#include <eepp/ui/uitextview.hpp>
|
||||
#include <eepp/maps/mapeditor/uimap.hpp>
|
||||
|
||||
using namespace EE::UI;
|
||||
|
||||
@@ -185,11 +185,11 @@ void UIDropDownList::setMaxNumVisibleItems(const Uint32 & maxNumVisibleItems) {
|
||||
mListBox->setSize( mDpSize.getWidth(), mStyleConfig.MaxNumVisibleItems * mDpSize.getHeight() );
|
||||
}
|
||||
|
||||
UIDropDownListStyleConfig UIDropDownList::getStyleConfig() const {
|
||||
const UIDropDownList::StyleConfig& UIDropDownList::getStyleConfig() const {
|
||||
return mStyleConfig;
|
||||
}
|
||||
|
||||
void UIDropDownList::setStyleConfig(const UIDropDownListStyleConfig & styleConfig) {
|
||||
void UIDropDownList::setStyleConfig( const StyleConfig& styleConfig ) {
|
||||
mStyleConfig = styleConfig;
|
||||
|
||||
setMaxNumVisibleItems( mStyleConfig.MaxNumVisibleItems );
|
||||
|
||||
@@ -196,11 +196,10 @@ Uint32 UIListBox::removeListBoxItem( UIListBoxItem * Item ) {
|
||||
void UIListBox::removeListBoxItems( std::vector<Uint32> ItemsIndex ) {
|
||||
if ( ItemsIndex.size() && eeINDEX_NOT_FOUND != ItemsIndex[0] ) {
|
||||
std::vector<UIListBoxItem*> ItemsCpy;
|
||||
bool erase;
|
||||
mTexts.clear();
|
||||
|
||||
for ( Uint32 i = 0; i < mItems.size(); i++ ) {
|
||||
erase = false;
|
||||
bool erase = false;
|
||||
|
||||
for ( Uint32 z = 0; z < ItemsIndex.size(); z++ ) {
|
||||
if ( ItemsIndex[z] == i ) {
|
||||
@@ -730,14 +729,6 @@ const Color& UIListBox::getFontColor() const {
|
||||
return mFontStyleConfig.FontColor;
|
||||
}
|
||||
|
||||
void UIListBox::setFontOverColor( const Color& Color ) {
|
||||
mFontStyleConfig.FontOverColor = Color;
|
||||
}
|
||||
|
||||
const Color& UIListBox::getFontOverColor() const {
|
||||
return mFontStyleConfig.FontOverColor;
|
||||
}
|
||||
|
||||
void UIListBox::setFontSelectedColor( const Color& Color ) {
|
||||
mFontStyleConfig.FontSelectedColor = Color;
|
||||
}
|
||||
@@ -992,8 +983,6 @@ bool UIListBox::setAttribute( const NodeAttribute& attribute, const Uint32& stat
|
||||
setFontColor( attribute.asColor() );
|
||||
} else if ( "textshadowcolor" == name ) {
|
||||
mFontStyleConfig.ShadowColor = ( attribute.asColor() );
|
||||
} else if ( "textovercolor" == name ) {
|
||||
setFontOverColor( attribute.asColor() );
|
||||
} else if ( "textselectedcolor" == name ) {
|
||||
setFontSelectedColor( attribute.asColor() );
|
||||
} else if ( "textselectionbackcolor" == name ) {
|
||||
|
||||
@@ -8,7 +8,7 @@ UIListBoxItem * UIListBoxItem::New() {
|
||||
}
|
||||
|
||||
UIListBoxItem::UIListBoxItem() :
|
||||
UITextView( "listboxitem" )
|
||||
UITextView( "listbox::item" )
|
||||
{
|
||||
setLayoutSizeRules( FIXED, FIXED );
|
||||
applyDefaultTheme();
|
||||
|
||||
+4
-16
@@ -56,14 +56,10 @@ void UIMenu::onThemeLoaded() {
|
||||
}
|
||||
|
||||
UIMenuItem * UIMenu::createMenuItem( const String& Text, Drawable * Icon ) {
|
||||
UIPushButtonStyleConfig styleConfig( mStyleConfig );
|
||||
styleConfig.IconMinSize = Sizei( mStyleConfig.MinSpaceForIcons, mStyleConfig.MinSpaceForIcons );
|
||||
|
||||
UIMenuItem * tCtrl = UIMenuItem::New();
|
||||
tCtrl->setHorizontalAlign( UI_HALIGN_LEFT );
|
||||
tCtrl->setParent( this );
|
||||
//tCtrl->setStyleConfig( styleConfig );
|
||||
tCtrl->setIconMinimumSize( styleConfig.IconMinSize );
|
||||
tCtrl->setIconMinimumSize( Sizei( mStyleConfig.MinSpaceForIcons, mStyleConfig.MinSpaceForIcons ) );
|
||||
tCtrl->setIcon( Icon );
|
||||
tCtrl->setText( Text );
|
||||
|
||||
@@ -75,14 +71,10 @@ Uint32 UIMenu::add( const String& Text, Drawable * Icon ) {
|
||||
}
|
||||
|
||||
UIMenuCheckBox * UIMenu::createMenuCheckBox( const String& Text, const bool &Active ) {
|
||||
UIPushButtonStyleConfig styleConfig( mStyleConfig );
|
||||
styleConfig.IconMinSize = Sizei( mStyleConfig.MinSpaceForIcons, mStyleConfig.MinSpaceForIcons );
|
||||
|
||||
UIMenuCheckBox * tCtrl = UIMenuCheckBox::New();
|
||||
tCtrl->setHorizontalAlign( UI_HALIGN_LEFT );
|
||||
tCtrl->setParent( this );
|
||||
//tCtrl->setStyleConfig( styleConfig );
|
||||
tCtrl->setIconMinimumSize( styleConfig.IconMinSize );
|
||||
tCtrl->setIconMinimumSize( Sizei( mStyleConfig.MinSpaceForIcons, mStyleConfig.MinSpaceForIcons ) );
|
||||
tCtrl->setText( Text );
|
||||
|
||||
if ( Active )
|
||||
@@ -96,14 +88,10 @@ Uint32 UIMenu::addCheckBox( const String& Text, const bool& Active ) {
|
||||
}
|
||||
|
||||
UIMenuSubMenu * UIMenu::createSubMenu( const String& Text, Drawable * Icon, UIMenu * SubMenu ) {
|
||||
UIPushButtonStyleConfig styleConfig( mStyleConfig );
|
||||
styleConfig.IconMinSize = Sizei( mStyleConfig.MinSpaceForIcons, mStyleConfig.MinSpaceForIcons );
|
||||
|
||||
UIMenuSubMenu * tCtrl = UIMenuSubMenu::New();
|
||||
tCtrl->setHorizontalAlign( UI_HALIGN_LEFT );
|
||||
tCtrl->setParent( this );
|
||||
//tCtrl->setStyleConfig( styleConfig );
|
||||
tCtrl->setIconMinimumSize( styleConfig.IconMinSize );
|
||||
tCtrl->setIconMinimumSize( Sizei( mStyleConfig.MinSpaceForIcons, mStyleConfig.MinSpaceForIcons ) );
|
||||
tCtrl->setIcon( Icon );
|
||||
tCtrl->setText( Text );
|
||||
tCtrl->setSubMenu( SubMenu );
|
||||
@@ -520,7 +508,7 @@ void UIMenu::setMinRightMargin(const Uint32 & minRightMargin) {
|
||||
rePosControls();
|
||||
}
|
||||
|
||||
UITooltipStyleConfig UIMenu::getFontStyleConfig() const {
|
||||
const UIMenu::StyleConfig& UIMenu::getStyleConfig() const {
|
||||
return mStyleConfig;
|
||||
}
|
||||
|
||||
|
||||
@@ -238,6 +238,10 @@ bool UIProgressBar::setAttribute( const NodeAttribute& attribute, const Uint32&
|
||||
return true;
|
||||
}
|
||||
|
||||
const UIProgressBar::StyleConfig & UIProgressBar::getStyleConfig() const {
|
||||
return mStyleConfig;
|
||||
}
|
||||
|
||||
void UIProgressBar::onAlphaChange() {
|
||||
UINode::onAlphaChange();
|
||||
|
||||
|
||||
@@ -212,14 +212,6 @@ UITextView * UIPushButton::getTextBox() const {
|
||||
return mTextBox;
|
||||
}
|
||||
|
||||
void UIPushButton::setFont(Font * font) {
|
||||
mTextBox->setFont( font );
|
||||
}
|
||||
|
||||
Font * UIPushButton::getFont() {
|
||||
return mTextBox->getFont();
|
||||
}
|
||||
|
||||
void UIPushButton::onAlphaChange() {
|
||||
UIWidget::onAlphaChange();
|
||||
|
||||
@@ -266,81 +258,8 @@ void UIPushButton::autoIconHorizontalMargin() {
|
||||
setIconHorizontalMargin( RMargin.Left );
|
||||
}
|
||||
}
|
||||
const Color& UIPushButton::getFontColor() const {
|
||||
return mStyleConfig.FontColor;
|
||||
}
|
||||
|
||||
void UIPushButton::setFontColor( const Color& color ) {
|
||||
mStyleConfig.FontColor = color;
|
||||
onStateChange();
|
||||
}
|
||||
|
||||
const Color& UIPushButton::getFontOverColor() const {
|
||||
return mStyleConfig.FontOverColor;
|
||||
}
|
||||
|
||||
void UIPushButton::setFontOverColor( const Color& color ) {
|
||||
mStyleConfig.FontOverColor = color;
|
||||
onStateChange();
|
||||
}
|
||||
|
||||
const Color& UIPushButton::getFontShadowColor() const {
|
||||
return mTextBox->getFontShadowColor();
|
||||
}
|
||||
|
||||
void UIPushButton::setFontShadowColor( const Color& color ) {
|
||||
mTextBox->setFontShadowColor( color );
|
||||
}
|
||||
|
||||
Uint32 UIPushButton::getCharacterSize() {
|
||||
return mTextBox->getCharacterSize();
|
||||
}
|
||||
|
||||
void UIPushButton::setCharacterSize(const Uint32 & characterSize) {
|
||||
mTextBox->setCharacterSize( characterSize );
|
||||
onSizeChange();
|
||||
}
|
||||
|
||||
const Uint32 &UIPushButton::getFontStyle() const {
|
||||
return mStyleConfig.Style;
|
||||
}
|
||||
|
||||
const Float &UIPushButton::getOutlineThickness() const {
|
||||
return mStyleConfig.OutlineThickness;
|
||||
}
|
||||
|
||||
UIPushButton * UIPushButton::setOutlineThickness( const Float & outlineThickness ) {
|
||||
if ( mStyleConfig.OutlineThickness != outlineThickness ) {
|
||||
mTextBox->setOutlineThickness( outlineThickness );
|
||||
mStyleConfig.OutlineThickness = outlineThickness;
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
const Color &UIPushButton::getOutlineColor() const {
|
||||
return mStyleConfig.OutlineColor;
|
||||
}
|
||||
|
||||
UIPushButton * UIPushButton::setOutlineColor(const Color & outlineColor) {
|
||||
if ( mStyleConfig.OutlineColor != outlineColor ) {
|
||||
mTextBox->setOutlineColor( outlineColor );
|
||||
mStyleConfig.OutlineColor = outlineColor;
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
UIPushButton * UIPushButton::setFontStyle(const Uint32 & fontStyle) {
|
||||
if ( mStyleConfig.Style != fontStyle ) {
|
||||
mTextBox->setFontStyle( fontStyle );
|
||||
mStyleConfig.Style = fontStyle;
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
UIFontStyleConfig UIPushButton::getStyleConfig() const {
|
||||
const UIPushButton::StyleConfig& UIPushButton::getStyleConfig() const {
|
||||
return mStyleConfig;
|
||||
}
|
||||
|
||||
@@ -359,7 +278,7 @@ void UIPushButton::setIconMinimumSize( const Sizei & minIconSize ) {
|
||||
}
|
||||
}
|
||||
|
||||
void UIPushButton::setStyleConfig(const UIPushButtonStyleConfig & styleConfig) {
|
||||
void UIPushButton::setStyleConfig(const StyleConfig & styleConfig) {
|
||||
setIconMinimumSize( styleConfig.IconMinSize );
|
||||
mStyleConfig = styleConfig;
|
||||
onStateChange();
|
||||
@@ -373,8 +292,6 @@ bool UIPushButton::setAttribute( const NodeAttribute& attribute, const Uint32& s
|
||||
if ( "text" == name ) {
|
||||
if ( NULL != mSceneNode && mSceneNode->isUISceneNode() )
|
||||
setText( static_cast<UISceneNode*>( mSceneNode )->getTranslatorString( attribute.asString() ) );
|
||||
} else if ( "textovercolor" == name ) {
|
||||
setFontOverColor( attribute.asColor() );
|
||||
} else if ( "icon" == name ) {
|
||||
std::string val = attribute.asString();
|
||||
Drawable * icon = NULL;
|
||||
|
||||
@@ -204,11 +204,11 @@ void UIScrollView::updateScroll() {
|
||||
);
|
||||
}
|
||||
|
||||
void UIScrollView::onValueChangeCb( const Event * Event ) {
|
||||
void UIScrollView::onValueChangeCb( const Event * ) {
|
||||
updateScroll();
|
||||
}
|
||||
|
||||
void UIScrollView::onScrollViewSizeChange(const Event * Event) {
|
||||
void UIScrollView::onScrollViewSizeChange(const Event *) {
|
||||
containerUpdate();
|
||||
}
|
||||
|
||||
|
||||
@@ -8,6 +8,10 @@ UISelectButton * UISelectButton::New() {
|
||||
return eeNew( UISelectButton, () );
|
||||
}
|
||||
|
||||
UISelectButton * UISelectButton::NewWithTag( const std::string& tag ) {
|
||||
return eeNew( UISelectButton, ( tag ) );
|
||||
}
|
||||
|
||||
UISelectButton::UISelectButton( const std::string& tag ) :
|
||||
UIPushButton( tag )
|
||||
{}
|
||||
@@ -64,24 +68,4 @@ void UISelectButton::onStateChange() {
|
||||
mTextBox->setAlpha( mAlpha );
|
||||
}
|
||||
|
||||
void UISelectButton::setFontSelectedColor(const Color & color) {
|
||||
mStyleConfig.FontSelectedColor = color;
|
||||
}
|
||||
|
||||
const Color &UISelectButton::getFontSelectedColor() const {
|
||||
return mStyleConfig.FontSelectedColor;
|
||||
}
|
||||
|
||||
bool UISelectButton::setAttribute( const NodeAttribute& attribute, const Uint32& state ) {
|
||||
const std::string& name = attribute.getName();
|
||||
|
||||
if ( "textselectedcolor" == name ) {
|
||||
setFontSelectedColor( attribute.asColor() );
|
||||
} else {
|
||||
return UIPushButton::setAttribute( attribute, state );
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
}}
|
||||
|
||||
@@ -19,12 +19,6 @@ UITabWidget::UITabWidget() :
|
||||
{
|
||||
setHorizontalAlign( UI_HALIGN_CENTER );
|
||||
|
||||
UITheme * Theme = UIThemeManager::instance()->getDefaultTheme();
|
||||
|
||||
if ( NULL != Theme ) {
|
||||
mStyleConfig.Font = Theme->getDefaultFont();
|
||||
}
|
||||
|
||||
mTabContainer = UIWidget::New();
|
||||
mTabContainer->setPixelsSize( mSize.getWidth(), mStyleConfig.TabWidgetHeight )
|
||||
->setParent( this )->setPosition( 0, 0 );
|
||||
@@ -112,15 +106,11 @@ void UITabWidget::draw() {
|
||||
}
|
||||
}
|
||||
|
||||
UITooltipStyleConfig UITabWidget::getFontStyleConfig() const {
|
||||
return UITooltipStyleConfig( mStyleConfig );
|
||||
}
|
||||
|
||||
UITabWidgetStyleConfig UITabWidget::getStyleConfig() const {
|
||||
const UITabWidget::StyleConfig& UITabWidget::getStyleConfig() const {
|
||||
return mStyleConfig;
|
||||
}
|
||||
|
||||
void UITabWidget::setStyleConfig(const UITabWidgetStyleConfig & styleConfig) {
|
||||
void UITabWidget::setStyleConfig(const StyleConfig & styleConfig) {
|
||||
Uint32 tabWidgetHeight = mStyleConfig.TabWidgetHeight;
|
||||
mStyleConfig = styleConfig;
|
||||
mStyleConfig.TabWidgetHeight = tabWidgetHeight;
|
||||
@@ -321,7 +311,6 @@ UITab * UITabWidget::createTab( const String& Text, UINode * CtrlOwned, Drawable
|
||||
UITab * tCtrl = UITab::New();
|
||||
tCtrl->setParent( mTabContainer );
|
||||
tCtrl->setFlags( UI_VALIGN_CENTER | UI_HALIGN_CENTER | UI_AUTO_SIZE );
|
||||
tCtrl->setStyleConfig( mStyleConfig );
|
||||
tCtrl->setIcon( Icon );
|
||||
tCtrl->setText( Text );
|
||||
tCtrl->setVisible( true );
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include <eepp/ui/uitextedit.hpp>
|
||||
#include <eepp/ui/uiscenenode.hpp>
|
||||
#include <eepp/ui/uiscrollbar.hpp>
|
||||
#include <eepp/graphics/text.hpp>
|
||||
#include <eepp/graphics/font.hpp>
|
||||
#include <pugixml/pugixml.hpp>
|
||||
@@ -25,7 +26,7 @@ UITextEdit::UITextEdit() :
|
||||
mTextInput = UITextInput::New();
|
||||
mTextInput->setLayoutSizeRules( LayoutSizeRules::FIXED, LayoutSizeRules::FIXED );
|
||||
mTextInput->setParent( this );
|
||||
mTextInput->setFlags( UI_TEXT_SELECTION_ENABLED | UI_TEXT_SELECTION_ENABLED | UI_VALIGN_TOP );
|
||||
mTextInput->setFlags( UI_TEXT_SELECTION_ENABLED | UI_VALIGN_TOP );
|
||||
mTextInput->unsetFlags( UI_VALIGN_CENTER | UI_AUTO_SIZE );
|
||||
mTextInput->clipDisable();
|
||||
mTextInput->getInputTextBuffer()->isNewLineEnabled( true );
|
||||
|
||||
@@ -13,7 +13,8 @@ UITextInputPassword::UITextInputPassword() :
|
||||
UITextInput()
|
||||
{
|
||||
mPassCache = Text::New();
|
||||
setFontStyleConfig( mFontStyleConfig );
|
||||
|
||||
updateFontStyleConfig();
|
||||
|
||||
alignFix();
|
||||
}
|
||||
@@ -127,13 +128,18 @@ Text *UITextInputPassword::getPassCache() const {
|
||||
return mPassCache;
|
||||
}
|
||||
|
||||
void UITextInputPassword::setFontStyleConfig(const UITooltipStyleConfig & fontStyleConfig) {
|
||||
void UITextInputPassword::updateFontStyleConfig() {
|
||||
mPassCache->setCharacterSize( mFontStyleConfig.CharacterSize );
|
||||
mPassCache->setFont( mFontStyleConfig.getFont() );
|
||||
mPassCache->setFillColor( mFontStyleConfig.getFontColor() );
|
||||
mPassCache->setShadowColor( mFontStyleConfig.getFontShadowColor() );
|
||||
}
|
||||
|
||||
void UITextInputPassword::onStateChange() {
|
||||
updateFontStyleConfig();
|
||||
UITextInput::onStateChange();
|
||||
}
|
||||
|
||||
const String& UITextInputPassword::getText() {
|
||||
return UITextView::getText();
|
||||
}
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
#include <eepp/ui/uitextview.hpp>
|
||||
#include <eepp/ui/uithememanager.hpp>
|
||||
#include <eepp/ui/uiscenenode.hpp>
|
||||
#include <eepp/graphics/font.hpp>
|
||||
#include <eepp/graphics/primitives.hpp>
|
||||
#include <eepp/graphics/text.hpp>
|
||||
#include <eepp/graphics/fontmanager.hpp>
|
||||
#include <eepp/window/clipboard.hpp>
|
||||
#include <pugixml/pugixml.hpp>
|
||||
#include <eepp/graphics/fontmanager.hpp>
|
||||
#include <eepp/ui/uiscenenode.hpp>
|
||||
|
||||
namespace EE { namespace UI {
|
||||
|
||||
@@ -469,7 +470,7 @@ bool UITextView::isTextSelectionEnabled() const {
|
||||
return 0 != ( mFlags & UI_TEXT_SELECTION_ENABLED );
|
||||
}
|
||||
|
||||
UITooltipStyleConfig UITextView::getFontStyleConfig() const {
|
||||
const UIFontStyleConfig& UITextView::getFontStyleConfig() const {
|
||||
return mFontStyleConfig;
|
||||
}
|
||||
|
||||
@@ -542,8 +543,6 @@ bool UITextView::setAttribute( const NodeAttribute& attribute, const Uint32& sta
|
||||
setFontColor( attribute.asColor() );
|
||||
} else if ( "textshadowcolor" == name ) {
|
||||
setFontShadowColor( attribute.asColor() );
|
||||
} else if ( "textovercolor" == name ) {
|
||||
mFontStyleConfig.FontOverColor = attribute.asColor();
|
||||
} else if ( "textselectedcolor" == name ) {
|
||||
mFontStyleConfig.FontSelectedColor = attribute.asColor();
|
||||
} else if ( "textselectionbackcolor" == name ) {
|
||||
|
||||
@@ -63,7 +63,7 @@ void UITooltip::setTheme( UITheme * Theme ) {
|
||||
}
|
||||
|
||||
void UITooltip::autoPadding() {
|
||||
if ( ( mFlags & UI_AUTO_PADDING ) && mStyleConfig.Padding == Rectf() ) {
|
||||
if ( ( mFlags & UI_AUTO_PADDING ) && mPadding == Rectf() ) {
|
||||
setPadding( makePadding( true, true, true, true ) );
|
||||
}
|
||||
}
|
||||
@@ -208,18 +208,6 @@ void UITooltip::onFontChanged() {
|
||||
invalidateDraw();
|
||||
}
|
||||
|
||||
void UITooltip::setPadding( const Rectf& padding ) {
|
||||
if ( mStyleConfig.Padding != padding ) {
|
||||
mStyleConfig.Padding = padding;
|
||||
mRealPadding = PixelDensity::dpToPx( padding );
|
||||
invalidateDraw();
|
||||
}
|
||||
}
|
||||
|
||||
const Rectf& UITooltip::getPadding() const {
|
||||
return mStyleConfig.Padding;
|
||||
}
|
||||
|
||||
Text * UITooltip::getTextCache() {
|
||||
return mTextCache;
|
||||
}
|
||||
@@ -260,7 +248,7 @@ void UITooltip::setTooltipOf(UINode * tooltipOf) {
|
||||
mTooltipOf = tooltipOf;
|
||||
}
|
||||
|
||||
UITooltipStyleConfig UITooltip::getStyleConfig() const {
|
||||
const UIFontStyleConfig& UITooltip::getFontStyleConfig() const {
|
||||
return mStyleConfig;
|
||||
}
|
||||
|
||||
@@ -326,12 +314,8 @@ UITooltip * UITooltip::setOutlineColor(const Color & outlineColor) {
|
||||
return this;
|
||||
}
|
||||
|
||||
void UITooltip::setStyleConfig(const UITooltipStyleConfig & styleConfig) {
|
||||
void UITooltip::setFontStyleConfig(const UIFontStyleConfig & styleConfig) {
|
||||
mStyleConfig = styleConfig;
|
||||
|
||||
if ( mStyleConfig.Padding != Rectf() )
|
||||
setPadding( mStyleConfig.Padding );
|
||||
|
||||
setFont( mStyleConfig.Font );
|
||||
setFontColor( mStyleConfig.FontColor );
|
||||
setFontShadowColor( mStyleConfig.ShadowColor );
|
||||
|
||||
@@ -133,7 +133,7 @@ void UITouchDragableWidget::update( const Time& time ) {
|
||||
UIWidget::update( time );
|
||||
}
|
||||
|
||||
void UITouchDragableWidget::onTouchDragValueChange( Vector2f diff )
|
||||
void UITouchDragableWidget::onTouchDragValueChange( Vector2f )
|
||||
{}
|
||||
|
||||
bool UITouchDragableWidget::isTouchOverAllowedChilds() {
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
namespace EE { namespace UI {
|
||||
|
||||
UIWindow * UIWindow::NewOpt( UIWindow::WindowBaseContainerType type, const UIWindowStyleConfig& windowStyleConfig ) {
|
||||
UIWindow * UIWindow::NewOpt( UIWindow::WindowBaseContainerType type, const StyleConfig& windowStyleConfig ) {
|
||||
return eeNew( UIWindow, ( type, windowStyleConfig ) );
|
||||
}
|
||||
|
||||
@@ -25,10 +25,10 @@ UIWindow * UIWindow::New() {
|
||||
}
|
||||
|
||||
UIWindow::UIWindow( UIWindow::WindowBaseContainerType type ) :
|
||||
UIWindow( type, UIWindowStyleConfig() )
|
||||
UIWindow( type, StyleConfig() )
|
||||
{}
|
||||
|
||||
UIWindow::UIWindow( UIWindow::WindowBaseContainerType type, const UIWindowStyleConfig& windowStyleConfig ) :
|
||||
UIWindow::UIWindow( UIWindow::WindowBaseContainerType type, const StyleConfig& windowStyleConfig ) :
|
||||
UIWidget( "window" ),
|
||||
mFrameBuffer( NULL ),
|
||||
mStyleConfig( windowStyleConfig ),
|
||||
@@ -1310,11 +1310,11 @@ UIWindow * UIWindow::setWinFlags(const Uint32 & winFlags) {
|
||||
return this;
|
||||
}
|
||||
|
||||
UIWindowStyleConfig UIWindow::getStyleConfig() const {
|
||||
const UIWindow::StyleConfig& UIWindow::getStyleConfig() const {
|
||||
return mStyleConfig;
|
||||
}
|
||||
|
||||
UIWindow * UIWindow::setStyleConfig(const UIWindowStyleConfig & styleConfig) {
|
||||
UIWindow * UIWindow::setStyleConfig(const StyleConfig & styleConfig) {
|
||||
mStyleConfig = styleConfig;
|
||||
|
||||
updateWinFlags();
|
||||
|
||||
@@ -18,11 +18,6 @@ UIWinMenu::UIWinMenu() :
|
||||
if ( !(mFlags & UI_ANCHOR_RIGHT) )
|
||||
mFlags |= UI_ANCHOR_RIGHT;
|
||||
|
||||
UITheme * theme = UIThemeManager::instance()->getDefaultTheme();
|
||||
|
||||
if ( NULL != theme )
|
||||
mStyleConfig.Font = theme->getDefaultFont();
|
||||
|
||||
onParentChange();
|
||||
|
||||
applyDefaultTheme();
|
||||
@@ -43,9 +38,7 @@ bool UIWinMenu::isType( const Uint32& type ) const {
|
||||
void UIWinMenu::addMenuButton( const String& ButtonText, UIPopUpMenu * Menu ) {
|
||||
eeASSERT( NULL != Menu );
|
||||
|
||||
UISelectButton * Button = UISelectButton::New();
|
||||
|
||||
Button->setStyleConfig( mStyleConfig );
|
||||
UISelectButton * Button = UISelectButton::NewWithTag( "winmenu::button" );
|
||||
Button->setParent( this );
|
||||
Button->setText( ButtonText );
|
||||
Button->setVisible( true );
|
||||
@@ -130,11 +123,11 @@ void UIWinMenu::setButtonMargin( const Uint32& buttonMargin ) {
|
||||
refreshButtons();
|
||||
}
|
||||
|
||||
UIWinMenuStyleConfig UIWinMenu::getStyleConfig() const {
|
||||
const UIWinMenu::StyleConfig& UIWinMenu::getStyleConfig() const {
|
||||
return mStyleConfig;
|
||||
}
|
||||
|
||||
void UIWinMenu::setStyleConfig(const UIWinMenuStyleConfig & styleConfig) {
|
||||
void UIWinMenu::setStyleConfig(const StyleConfig & styleConfig) {
|
||||
mStyleConfig = styleConfig;
|
||||
refreshButtons();
|
||||
}
|
||||
@@ -219,7 +212,6 @@ void UIWinMenu::refreshButtons() {
|
||||
UITextView * tbox = pbut->getTextBox();
|
||||
|
||||
pbut->setLayoutSizeRules( FIXED, FIXED );
|
||||
pbut->setStyleConfig( mStyleConfig );
|
||||
pbut->setPixelsSize( tbox->getTextWidth() + PixelDensity::dpToPx( mStyleConfig.ButtonMargin ), getRealSize().getHeight() );
|
||||
pbut->setPosition( xpos, ycenter );
|
||||
|
||||
|
||||
+3
-3
@@ -362,7 +362,7 @@ void EETest::createBaseUI() {
|
||||
/**/
|
||||
UIWindow * tWin = UIWindow::New();
|
||||
tWin->setSize( 530, 405 )->setPosition( 320, 240 );
|
||||
UIWindowStyleConfig windowStyleConfig = tWin->getStyleConfig();
|
||||
UIWindow::StyleConfig windowStyleConfig = tWin->getStyleConfig();
|
||||
windowStyleConfig.WinFlags = UI_WIN_DRAGABLE_CONTAINER | UI_WIN_SHADOW | UI_WIN_FRAME_BUFFER;
|
||||
windowStyleConfig.MinWindowSize = Sizef( 530, 405 );
|
||||
windowStyleConfig.BaseAlpha = 200;
|
||||
@@ -901,7 +901,7 @@ void EETest::createMapEditor() {
|
||||
|
||||
UIWindow * tWin = UIWindow::New();
|
||||
tWin->setSizeWithDecoration( 1024, 768 )->setPosition( 0, 0 );
|
||||
UIWindowStyleConfig windowStyleConfig = tWin->getStyleConfig();
|
||||
UIWindow::StyleConfig windowStyleConfig = tWin->getStyleConfig();
|
||||
windowStyleConfig.WinFlags = UI_WIN_DEFAULT_FLAGS | UI_WIN_MAXIMIZE_BUTTON | UI_WIN_DRAGABLE_CONTAINER | UI_WIN_SHADOW | UI_WIN_FRAME_BUFFER;
|
||||
windowStyleConfig.MinWindowSize = Sizef( 1024, 768 );
|
||||
tWin->setStyleConfig( windowStyleConfig );
|
||||
@@ -918,7 +918,7 @@ void EETest::onMapEditorClose() {
|
||||
void EETest::createETGEditor() {
|
||||
UIWindow * tWin = UIWindow::New();
|
||||
tWin->setSizeWithDecoration( 1024, 768 )->setPosition( 0, 0 );
|
||||
UIWindowStyleConfig windowStyleConfig = tWin->getStyleConfig();
|
||||
UIWindow::StyleConfig windowStyleConfig = tWin->getStyleConfig();
|
||||
windowStyleConfig.WinFlags = UI_WIN_DEFAULT_FLAGS | UI_WIN_MAXIMIZE_BUTTON | UI_WIN_DRAGABLE_CONTAINER | UI_WIN_SHADOW | UI_WIN_FRAME_BUFFER;
|
||||
windowStyleConfig.MinWindowSize = Sizef( 1024, 768 );
|
||||
tWin->setStyleConfig( windowStyleConfig );
|
||||
|
||||
Reference in New Issue
Block a user