More clean up.

--HG--
branch : dev-css
This commit is contained in:
Martín Lucas Golini
2019-01-01 15:39:18 -03:00
parent 4ff16b51d9
commit 5f7281e808
46 changed files with 273 additions and 530 deletions

View File

@@ -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 ) {

View File

@@ -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 ) {

View File

@@ -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 );
}

View File

@@ -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 ),

View File

@@ -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 );
}

View File

@@ -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 );
}

View File

@@ -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;

View File

@@ -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 );

View File

@@ -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 ) {

View File

@@ -8,7 +8,7 @@ UIListBoxItem * UIListBoxItem::New() {
}
UIListBoxItem::UIListBoxItem() :
UITextView( "listboxitem" )
UITextView( "listbox::item" )
{
setLayoutSizeRules( FIXED, FIXED );
applyDefaultTheme();

View File

@@ -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;
}

View File

@@ -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();

View File

@@ -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;

View File

@@ -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();
}

View File

@@ -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;
}
}}

View File

@@ -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 );

View File

@@ -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 );

View File

@@ -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();
}

View File

@@ -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 ) {

View File

@@ -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 );

View File

@@ -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() {

View File

@@ -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();

View File

@@ -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 );

View File

@@ -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 );