mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-05-30 10:06:35 +03:00
Added Icon possibility to cUIPushButton. Added default fonts for ui themes and global default font for all ui themes. Changed how cUIGfx get shapes, now accept a new instance without shape. Fixed how padding works on cUITextBox and cUITextInput. Fixed font rendering in cTextCache when some text rendered with angle or/and scale ( it was breaking the model view matrix ). Fixed a miscounting of the number of vertex for the cached text. Fixed HaikuTTF destroy singleton ( now release fine the memory ).
82 lines
1.5 KiB
C++
82 lines
1.5 KiB
C++
#include "cuiskin.hpp"
|
|
|
|
namespace EE { namespace UI {
|
|
|
|
const char * UISkinStatesNames[] = {
|
|
"normal",
|
|
"focus",
|
|
"selected",
|
|
"menter",
|
|
"mexit",
|
|
"mdown"
|
|
};
|
|
|
|
const char * cUISkin::GetSkinStateName( const Uint32& State ) {
|
|
return UISkinStatesNames[ State ];
|
|
}
|
|
|
|
cUISkin::cUISkin( const std::string& Name, const Uint32& Type ) :
|
|
mType( Type ),
|
|
mName( Name ),
|
|
mNameHash( MakeHash( mName ) ),
|
|
mTheme(NULL)
|
|
{
|
|
mColorDefault = 0xFFFFFFFF;
|
|
|
|
for ( Int32 i = 0; i < cUISkinState::StateCount; i++ )
|
|
mColor[ i ] = eeColorA( 0xFFFFFFFF );
|
|
}
|
|
|
|
cUISkin::~cUISkin() {
|
|
}
|
|
|
|
void cUISkin::SetColor( const Uint32& State, const eeColorA& Color ) {
|
|
eeASSERT ( State < cUISkinState::StateCount );
|
|
|
|
Write32BitKey( &mColorDefault, State, 0 );
|
|
|
|
mColor[ State ] = Color;
|
|
}
|
|
|
|
const eeColorA& cUISkin::GetColor( const Uint32& State ) const {
|
|
eeASSERT ( State < cUISkinState::StateCount );
|
|
|
|
return mColor[ State ];
|
|
}
|
|
|
|
const std::string& cUISkin::Name() const {
|
|
return mName;
|
|
}
|
|
|
|
void cUISkin::Name( const std::string& name ) {
|
|
mName = name;
|
|
mNameHash = MakeHash( mName );
|
|
}
|
|
|
|
const Uint32& cUISkin::Id() const {
|
|
return mNameHash;
|
|
}
|
|
|
|
void cUISkin::SetSkins() {
|
|
for ( Int32 i = 0; i < cUISkinState::StateCount; i++ )
|
|
SetSkin( i );
|
|
}
|
|
|
|
cUITheme * cUISkin::Theme() const {
|
|
return mTheme;
|
|
}
|
|
|
|
void cUISkin::Theme( cUITheme * theme ) {
|
|
mTheme = theme;
|
|
}
|
|
|
|
const Uint32& cUISkin::GetType() const {
|
|
return mType;
|
|
}
|
|
|
|
bool cUISkin::GetColorDefault( const Uint32& State ) {
|
|
return Read32BitKey( &mColorDefault, State );
|
|
}
|
|
|
|
}}
|