mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-05-28 17:16:29 +03:00
Several minor improvements.
This commit is contained in:
@@ -1460,7 +1460,7 @@ Sets the scrollbar style (for the moment defines if it contains buttons at its e
|
||||
|
||||
Sets the element state as selected when supported by the specific widget.
|
||||
|
||||
* Applicable to: EE::UI::UICheckBox (CheckBox), EE::UI::UIRadioButton (RadioButton)
|
||||
* Applicable to: EE::UI::UICheckBox (CheckBox), EE::UI::UIRadioButton (RadioButton), EE::UI::SelectButton (SelectButton)
|
||||
* Data Type: [boolean](#boolean-data-type)
|
||||
* Default value: `false`
|
||||
* Aliases: `active`
|
||||
@@ -1514,6 +1514,16 @@ Sets the text selection color on a text element that suports text selection.
|
||||
|
||||
---
|
||||
|
||||
### select-on-click
|
||||
|
||||
Enables the selection state toggle on element click.
|
||||
|
||||
* Applicable to: EE::UI::SelectButton (SelectButton)
|
||||
* Data Type: [boolean](#boolean-data-type)
|
||||
* Default value: `false`
|
||||
|
||||
---
|
||||
|
||||
### shadow-color
|
||||
|
||||
Sets the text shadow color.
|
||||
@@ -1687,6 +1697,16 @@ Read [text-align](https://developer.mozilla.org/en-US/docs/Web/CSS/text-align) d
|
||||
|
||||
---
|
||||
|
||||
### text-as-fallback
|
||||
|
||||
When enabled will only display text if the icon is not set/found.
|
||||
|
||||
* Applicable to: EE::UI::UIPushButton (PushButton)
|
||||
* Data Type: [boolean](#boolean-data-type)
|
||||
* Default value: `false`
|
||||
|
||||
---
|
||||
|
||||
### text-selection
|
||||
|
||||
Enables/disables text selection in any element that contains text.
|
||||
@@ -1944,7 +1964,7 @@ Multiple values are separated with a `|` (as a logical or).
|
||||
* `close`: Adds a close button to the titlebar.
|
||||
* `maximize`: Adds a maximize button to the titlebar.
|
||||
* `minimize`: Adds a minimize button to the titlebar.
|
||||
* `dragable`: Makes the window background dragable.
|
||||
* `draggable`: Makes the window background draggable.
|
||||
* `shadow`: The window will project a shadow.
|
||||
* `modal`: Makes the window modal (blocks interacting any element ouside the window).
|
||||
* `undecorated`: Creates an undecorated window (no borders and titlebar).
|
||||
|
||||
@@ -198,7 +198,9 @@ enum class PropertyId : Uint32 {
|
||||
TabAllowSwitchTabsInEmptySpaces = String::hash( "tabbar-allow-switch-tabs-in-empty-spaces" ),
|
||||
SplitterPartition = String::hash( "splitter-partition" ),
|
||||
SplitterAlwaysShow = String::hash( "splitter-always-show" ),
|
||||
DroppableHoveringColor = String::hash( "droppable-hovering-color" )
|
||||
DroppableHoveringColor = String::hash( "droppable-hovering-color" ),
|
||||
TextAsFallback = String::hash( "text-as-fallback" ),
|
||||
SelectOnClick = String::hash( "select-on-click" ),
|
||||
};
|
||||
|
||||
enum class PropertyType : Uint32 {
|
||||
|
||||
@@ -28,7 +28,7 @@ class EE_API UIPushButton : public UIWidget {
|
||||
|
||||
virtual void setTheme( UITheme* Theme );
|
||||
|
||||
virtual UIPushButton* setIcon( Drawable* icon );
|
||||
virtual UIPushButton* setIcon( Drawable* icon, bool ownIt = false );
|
||||
|
||||
virtual UIImage* getIcon() const;
|
||||
|
||||
@@ -61,11 +61,16 @@ class EE_API UIPushButton : public UIWidget {
|
||||
|
||||
virtual Sizef updateLayout();
|
||||
|
||||
bool isTextAsFallback() const;
|
||||
|
||||
void setTextAsFallback( bool textAsFallback );
|
||||
|
||||
protected:
|
||||
UIImage* mIcon;
|
||||
UITextView* mTextBox;
|
||||
Sizei mIconMinSize;
|
||||
InnerWidgetOrientation mInnerWidgetOrientation{ InnerWidgetOrientation::Right };
|
||||
bool mTextAsFallback{ false };
|
||||
|
||||
explicit UIPushButton( const std::string& tag );
|
||||
|
||||
@@ -91,6 +96,8 @@ class EE_API UIPushButton : public UIWidget {
|
||||
|
||||
virtual Uint32 onKeyUp( const KeyEvent& Event );
|
||||
|
||||
void updateTextBox();
|
||||
|
||||
Vector2f packLayout( const std::vector<UIWidget*>& widgets, const Rectf& padding );
|
||||
|
||||
Vector2f calcLayoutSize( const std::vector<UIWidget*>& widgets, const Rectf& padding ) const;
|
||||
|
||||
@@ -27,7 +27,21 @@ class EE_API UISelectButton : public UIPushButton {
|
||||
|
||||
virtual void select();
|
||||
|
||||
void toggleSelection();
|
||||
|
||||
virtual bool applyProperty( const StyleSheetProperty& attribute );
|
||||
|
||||
virtual std::string getPropertyString( const PropertyDefinition* propertyDef,
|
||||
const Uint32& propertyIndex ) const;
|
||||
|
||||
virtual void setSelected( bool set );
|
||||
|
||||
void setSelectOnClick( bool set );
|
||||
|
||||
bool hasSelectOnClick() const;
|
||||
protected:
|
||||
Uint32 mSelectOnClickCbId{ 0 };
|
||||
|
||||
virtual void onStateChange();
|
||||
};
|
||||
|
||||
|
||||
@@ -6,6 +6,8 @@ namespace EE { namespace System {
|
||||
|
||||
FunctionString FunctionString::parse( const std::string& function ) {
|
||||
size_t posFuncStart = function.find_first_of( '(' );
|
||||
if ( posFuncStart == std::string::npos )
|
||||
return FunctionString( "", {}, {} );
|
||||
size_t posFuncEnd = function.find_last_of( ')' );
|
||||
std::string funcName;
|
||||
std::vector<std::string> parameters;
|
||||
|
||||
@@ -29,15 +29,15 @@ Drawable* DrawableImageParser::createDrawable( const std::string& value, const S
|
||||
Drawable* res = NULL;
|
||||
ownIt = false;
|
||||
|
||||
if ( "none" == value ) {
|
||||
if ( "none" == value )
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if ( !functionType.isEmpty() ) {
|
||||
if ( exists( functionType.getName() ) ) {
|
||||
if ( exists( functionType.getName() ) )
|
||||
return mFuncs[functionType.getName()]( functionType, size, ownIt, node );
|
||||
}
|
||||
} else if ( NULL != ( res = DrawableSearcher::searchByName( value ) ) ) {
|
||||
if ( res->getDrawableType() == Drawable::SPRITE )
|
||||
ownIt = true;
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -314,9 +314,8 @@ void DrawableImageParser::registerBaseParsers() {
|
||||
mFuncs["url"] = []( const FunctionString& functionType, const Sizef& /*size*/, bool& /*ownIt*/,
|
||||
UINode*
|
||||
/*node*/ ) -> Drawable* {
|
||||
if ( functionType.getParameters().size() < 1 ) {
|
||||
if ( functionType.getParameters().size() < 1 )
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return DrawableSearcher::searchByName( functionType.getParameters().at( 0 ) );
|
||||
};
|
||||
|
||||
@@ -374,6 +374,9 @@ void StyleSheetSpecification::registerDefaultProperties() {
|
||||
|
||||
registerProperty( "droppable-hovering-color", "#FFFFFF20" ).setType( PropertyType::Color );
|
||||
|
||||
registerProperty( "text-as-fallback", "false" ).setType( PropertyType::Bool );
|
||||
registerProperty( "select-on-click", "false" ).setType( PropertyType::Bool );
|
||||
|
||||
// Shorthands
|
||||
registerShorthand( "margin", { "margin-top", "margin-right", "margin-bottom", "margin-left" },
|
||||
"box" );
|
||||
|
||||
@@ -271,6 +271,11 @@ void SyntaxDefinitionManager::addC() {
|
||||
{
|
||||
{ { "//.-\n" }, "comment" },
|
||||
{ { "/%*", "%*/" }, "comment" },
|
||||
{ { "^%s*(#include)%s+([<%\"][%w%d%.%\\%/]+[>%\"])" },
|
||||
{ "keyword", "keyword", "literal" } },
|
||||
{ { "^%s*(#e?l?n?d?ifn?d?e?f?)%s+" }, { "keyword", "keyword", "literal" } },
|
||||
{ { "^%s*(#define)%s*" }, { "keyword", "keyword", "literal" } },
|
||||
{ { "^%s*(#else)%s*" }, { "keyword", "keyword", "literal" } },
|
||||
{ { "#", "[^\\]\n" }, "comment" },
|
||||
{ { "\"", "\"", "\\" }, "string" },
|
||||
{ { "'", "'", "\\" }, "string" },
|
||||
@@ -502,8 +507,8 @@ void SyntaxDefinitionManager::addBash() {
|
||||
|
||||
void SyntaxDefinitionManager::addCPP() {
|
||||
add( { "C++",
|
||||
{ "%.cpp$", "%.cc$", "%.C$", "%.cxx$", "%.c++$", "%.hh$", "%.H$", "%.h$", "%.inl$",
|
||||
"%.hxx$", "%.hpp$", "%.h++$" },
|
||||
{ "%.cpp$", "%.cc$", "%.C$", "%.cxx$", "%.c++$", "%.hh$", "%.inl$", "%.hxx$", "%.hpp$",
|
||||
"%.h++$" },
|
||||
{
|
||||
{ { "R%\"xml%(", "%)xml%\"" }, "function", "XML" },
|
||||
{ { "R%\"css%(", "%)css%\"" }, "function", "CSS" },
|
||||
@@ -511,9 +516,14 @@ void SyntaxDefinitionManager::addCPP() {
|
||||
{ { "R\"[%a-\"]+%(", "%)[%a-\"]+%\"" }, "string" },
|
||||
{ { "//.-\n" }, "comment" },
|
||||
{ { "/%*", "%*/" }, "comment" },
|
||||
{ { "#", "[^\\]\n" }, "keyword2" },
|
||||
{ { "\"", "\"", "\\" }, "string" },
|
||||
{ { "'", "'", "\\" }, "string" },
|
||||
{ { "^%s*(#include)%s+([<%\"][%w%d%.%\\%/]+[>%\"])" },
|
||||
{ "keyword", "keyword", "literal" } },
|
||||
{ { "^%s*(#e?l?n?d?ifn?d?e?f?)%s+" }, { "keyword", "keyword", "literal" } },
|
||||
{ { "^%s*(#define)%s*" }, { "keyword", "keyword", "literal" } },
|
||||
{ { "^%s*(#else)%s*" }, { "keyword", "keyword", "literal" } },
|
||||
{ { "#", "[^\\]\n" }, "comment" },
|
||||
{ { "-?0x%x+" }, "number" },
|
||||
{ { "-?%d+[%d%.eE]*f?" }, "number" },
|
||||
{ { "-?%.?%d+f?" }, "number" },
|
||||
|
||||
@@ -226,7 +226,6 @@ std::string UICheckBox::getPropertyString( const PropertyDefinition* propertyDef
|
||||
switch ( propertyDef->getPropertyId() ) {
|
||||
case PropertyId::Selected:
|
||||
return isChecked() ? "true" : "false";
|
||||
break;
|
||||
default:
|
||||
return UITextView::getPropertyString( propertyDef, propertyIndex );
|
||||
}
|
||||
|
||||
@@ -146,8 +146,11 @@ const Color& UIImage::getColor() const {
|
||||
}
|
||||
|
||||
UIImage* UIImage::setColor( const Color& col ) {
|
||||
mColor = col;
|
||||
setAlpha( col.a );
|
||||
if ( mColor != col ) {
|
||||
mColor = col;
|
||||
setAlpha( col.a );
|
||||
invalidateDraw();
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -247,24 +250,24 @@ bool UIImage::applyProperty( const StyleSheetProperty& attribute ) {
|
||||
setDrawable( createdDrawable, ownIt );
|
||||
} else {
|
||||
Drawable* res = NULL;
|
||||
if ( NULL != ( res = DrawableSearcher::searchByName( path ) ) ) {
|
||||
if ( res->getDrawableType() == Drawable::SPRITE )
|
||||
mDrawableOwner = true;
|
||||
|
||||
setDrawable( res );
|
||||
}
|
||||
if ( NULL != ( res = DrawableSearcher::searchByName( path ) ) )
|
||||
setDrawable( res, res->getDrawableType() == Drawable::SPRITE );
|
||||
}
|
||||
break;
|
||||
}
|
||||
case PropertyId::Icon: {
|
||||
std::string val = attribute.asString();
|
||||
Drawable* icon = NULL;
|
||||
bool ownIt;
|
||||
UIIcon* iconF = getUISceneNode()->findIcon( val );
|
||||
if ( iconF ) {
|
||||
setDrawable(
|
||||
iconF->getSize( mSize.getHeight() - mPaddingPx.Top - mPadding.Bottom ) );
|
||||
} else if ( NULL != ( icon = DrawableSearcher::searchByName( val ) ) ) {
|
||||
setDrawable( icon );
|
||||
} else if ( NULL !=
|
||||
( icon = CSS::StyleSheetSpecification::instance()
|
||||
->getDrawableImageParser()
|
||||
.createDrawable( val, getPixelsSize(), ownIt, this ) ) ) {
|
||||
setDrawable( icon, ownIt );
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -251,6 +251,17 @@ Sizef UIPushButton::updateLayout() {
|
||||
return size.ceil();
|
||||
}
|
||||
|
||||
bool UIPushButton::isTextAsFallback() const {
|
||||
return mTextAsFallback;
|
||||
}
|
||||
|
||||
void UIPushButton::setTextAsFallback( bool textAsFallback ) {
|
||||
if ( mTextAsFallback != textAsFallback ) {
|
||||
mTextAsFallback = textAsFallback;
|
||||
updateTextBox();
|
||||
}
|
||||
}
|
||||
|
||||
void UIPushButton::onPaddingChange() {
|
||||
onSizeChange();
|
||||
|
||||
@@ -278,14 +289,20 @@ void UIPushButton::onThemeLoaded() {
|
||||
UIWidget::onThemeLoaded();
|
||||
}
|
||||
|
||||
UIPushButton* UIPushButton::setIcon( Drawable* icon ) {
|
||||
if ( mIcon->getDrawable() != icon ) {
|
||||
mIcon->setPixelsSize( icon->getPixelsSize() );
|
||||
mIcon->setDrawable( icon );
|
||||
mTextBox->setVisible( !getText().empty() );
|
||||
void UIPushButton::updateTextBox() {
|
||||
if ( mTextBox->isVisible() != ( !getText().empty() && !mTextAsFallback ) ) {
|
||||
mTextBox->setVisible( !getText().empty() && !mTextAsFallback );
|
||||
onAutoSize();
|
||||
updateLayout();
|
||||
}
|
||||
}
|
||||
|
||||
UIPushButton* UIPushButton::setIcon( Drawable* icon, bool ownIt ) {
|
||||
if ( mIcon->getDrawable() != icon ) {
|
||||
mIcon->setPixelsSize( icon->getPixelsSize() );
|
||||
mIcon->setDrawable( icon, ownIt );
|
||||
updateTextBox();
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -431,6 +448,10 @@ std::string UIPushButton::getPropertyString( const PropertyDefinition* propertyD
|
||||
? "center"
|
||||
: ( Font::getHorizontalAlign( getFlags() ) == UI_HALIGN_RIGHT ? "right"
|
||||
: "left" );
|
||||
case PropertyId::TextAsFallback:
|
||||
return mTextAsFallback ? "true" : "false";
|
||||
case PropertyId::Tint:
|
||||
return mIcon->getColor().toHexString();
|
||||
case PropertyId::Color:
|
||||
case PropertyId::ShadowColor:
|
||||
case PropertyId::SelectionColor:
|
||||
@@ -464,13 +485,17 @@ bool UIPushButton::applyProperty( const StyleSheetProperty& attribute ) {
|
||||
case PropertyId::Icon: {
|
||||
std::string val = attribute.asString();
|
||||
Drawable* icon = NULL;
|
||||
bool ownIt;
|
||||
UIIcon* iconF = getUISceneNode()->findIcon( val );
|
||||
if ( iconF ) {
|
||||
setIcon( iconF->getSize(
|
||||
eemax<size_t>( mSize.getHeight() - mPaddingPx.Top - mPadding.Bottom,
|
||||
PixelDensity::dpToPxI( 16 ) ) ) );
|
||||
} else if ( NULL != ( icon = DrawableSearcher::searchByName( val ) ) ) {
|
||||
setIcon( icon );
|
||||
} else if ( NULL !=
|
||||
( icon = StyleSheetSpecification::instance()
|
||||
->getDrawableImageParser()
|
||||
.createDrawable( val, getPixelsSize(), ownIt, this ) ) ) {
|
||||
setIcon( icon, ownIt );
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -487,6 +512,12 @@ bool UIPushButton::applyProperty( const StyleSheetProperty& attribute ) {
|
||||
setTextAlign( UI_HALIGN_RIGHT );
|
||||
break;
|
||||
}
|
||||
case PropertyId::TextAsFallback:
|
||||
setTextAsFallback( attribute.asBool() );
|
||||
break;
|
||||
case PropertyId::Tint:
|
||||
mIcon->setColor( attribute.asColor() );
|
||||
break;
|
||||
case PropertyId::Color:
|
||||
case PropertyId::ShadowColor:
|
||||
case PropertyId::SelectionColor:
|
||||
|
||||
@@ -36,13 +36,22 @@ void UISelectButton::select() {
|
||||
if ( !wasSelected ) {
|
||||
NodeMessage tMsg( this, NodeMessage::Selected, 0 );
|
||||
messagePost( &tMsg );
|
||||
|
||||
sendCommonEvent( Event::OnSelectionChanged );
|
||||
}
|
||||
}
|
||||
|
||||
void UISelectButton::toggleSelection() {
|
||||
setSelected( !isSelected() );
|
||||
}
|
||||
|
||||
void UISelectButton::unselect() {
|
||||
if ( mNodeFlags & NODE_FLAG_SELECTED )
|
||||
if ( mNodeFlags & NODE_FLAG_SELECTED ) {
|
||||
mNodeFlags &= ~NODE_FLAG_SELECTED;
|
||||
|
||||
sendCommonEvent( Event::OnSelectionChanged );
|
||||
}
|
||||
|
||||
popState( UIState::StateSelected );
|
||||
}
|
||||
|
||||
@@ -63,4 +72,64 @@ void UISelectButton::onStateChange() {
|
||||
}
|
||||
}
|
||||
|
||||
bool UISelectButton::applyProperty( const StyleSheetProperty& attribute ) {
|
||||
bool attributeSet = true;
|
||||
|
||||
if ( attribute.getPropertyDefinition() == NULL ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
switch ( attribute.getPropertyDefinition()->getPropertyId() ) {
|
||||
case PropertyId::SelectOnClick:
|
||||
setSelectOnClick( attribute.asBool() );
|
||||
break;
|
||||
case PropertyId::Selected:
|
||||
setSelected( attribute.asBool() );
|
||||
break;
|
||||
default:
|
||||
attributeSet = UIPushButton::applyProperty( attribute );
|
||||
break;
|
||||
}
|
||||
|
||||
return attributeSet;
|
||||
}
|
||||
|
||||
std::string UISelectButton::getPropertyString( const PropertyDefinition* propertyDef,
|
||||
const Uint32& propertyIndex ) const {
|
||||
if ( NULL == propertyDef )
|
||||
return "";
|
||||
|
||||
switch ( propertyDef->getPropertyId() ) {
|
||||
case PropertyId::SelectOnClick:
|
||||
return hasSelectOnClick() ? "true" : "false";
|
||||
case PropertyId::Selected:
|
||||
return isSelected() ? "true" : "false";
|
||||
default:
|
||||
return UIPushButton::getPropertyString( propertyDef, propertyIndex );
|
||||
}
|
||||
}
|
||||
|
||||
void UISelectButton::setSelected( bool set ) {
|
||||
if ( set ) {
|
||||
select();
|
||||
} else {
|
||||
unselect();
|
||||
}
|
||||
}
|
||||
|
||||
void UISelectButton::setSelectOnClick( bool set ) {
|
||||
if ( set ) {
|
||||
if ( mSelectOnClickCbId == 0 )
|
||||
mSelectOnClickCbId =
|
||||
addEventListener( Event::MouseClick, [&]( const Event* ) { toggleSelection(); } );
|
||||
} else {
|
||||
if ( mSelectOnClickCbId != 0 )
|
||||
removeEventListener( mSelectOnClickCbId );
|
||||
}
|
||||
}
|
||||
|
||||
bool UISelectButton::hasSelectOnClick() const {
|
||||
return 0 != mSelectOnClickCbId;
|
||||
}
|
||||
|
||||
}} // namespace EE::UI
|
||||
|
||||
@@ -265,21 +265,23 @@ Vector2f UIWidget::getTooltipPosition() {
|
||||
if ( NULL == eventDispatcher || NULL == themeManager )
|
||||
return Vector2f::Zero;
|
||||
|
||||
Vector2f Pos = eventDispatcher->getMousePosf();
|
||||
Pos.x += themeManager->getCursorSize().x;
|
||||
Pos.y += themeManager->getCursorSize().y;
|
||||
UISceneNode* uiSceneNode = getUISceneNode();
|
||||
Vector2f pos = eventDispatcher->getMousePosf();
|
||||
pos -= uiSceneNode->getScreenPos(); // TODO: Fix UISceneNode inside UISceneNode position
|
||||
pos.x += themeManager->getCursorSize().x;
|
||||
pos.y += themeManager->getCursorSize().y;
|
||||
|
||||
if ( Pos.x + mTooltip->getPixelsSize().getWidth() >
|
||||
if ( pos.x + mTooltip->getPixelsSize().getWidth() >
|
||||
eventDispatcher->getSceneNode()->getPixelsSize().getWidth() ) {
|
||||
Pos.x = eventDispatcher->getMousePos().x - mTooltip->getPixelsSize().getWidth();
|
||||
pos.x = eventDispatcher->getMousePos().x - mTooltip->getPixelsSize().getWidth();
|
||||
}
|
||||
|
||||
if ( Pos.y + mTooltip->getPixelsSize().getHeight() >
|
||||
if ( pos.y + mTooltip->getPixelsSize().getHeight() >
|
||||
eventDispatcher->getSceneNode()->getPixelsSize().getHeight() ) {
|
||||
Pos.y = eventDispatcher->getMousePos().y - mTooltip->getPixelsSize().getHeight();
|
||||
pos.y = eventDispatcher->getMousePos().y - mTooltip->getPixelsSize().getHeight();
|
||||
}
|
||||
|
||||
return Pos;
|
||||
return pos;
|
||||
}
|
||||
|
||||
void UIWidget::createStyle() {
|
||||
|
||||
@@ -102,6 +102,7 @@ void UIWidgetCreator::createBaseWidgetList() {
|
||||
registeredWidget["vscrollbar"] = UIScrollBar::NewVertical;
|
||||
registeredWidget["hscrollbar"] = UIScrollBar::NewHorizontal;
|
||||
registeredWidget["button"] = UIPushButton::New;
|
||||
registeredWidget["rlay"] = UIRelativeLayout::New;
|
||||
|
||||
sBaseListCreated = true;
|
||||
}
|
||||
|
||||
@@ -669,8 +669,9 @@ void UIWindow::fixChildsSize() {
|
||||
Sizei( getSize().getWidth(), mWindowDecoration->getSkinSize().getHeight() );
|
||||
}
|
||||
|
||||
mWindowDecoration->setPixelsSize(
|
||||
mSize.getWidth(), PixelDensity::dpToPx( mStyleConfig.TitlebarSize.getHeight() ) );
|
||||
if ( mWindowDecoration )
|
||||
mWindowDecoration->setPixelsSize(
|
||||
mSize.getWidth(), PixelDensity::dpToPx( mStyleConfig.TitlebarSize.getHeight() ) );
|
||||
|
||||
if ( mStyleConfig.BorderAutoSize ) {
|
||||
mBorderBottom->setPixelsSize(
|
||||
@@ -1541,7 +1542,7 @@ std::string UIWindow::getWindowFlagsString() const {
|
||||
if ( getWinFlags() & UI_WIN_MAXIMIZE_BUTTON )
|
||||
flags.push_back( "maximize" );
|
||||
if ( getWinFlags() & UI_WIN_DRAGABLE_CONTAINER )
|
||||
flags.push_back( "dragable" );
|
||||
flags.push_back( "draggable" );
|
||||
if ( getWinFlags() & UI_WIN_SHADOW )
|
||||
flags.push_back( "shadow" );
|
||||
if ( getWinFlags() & UI_WIN_MODAL )
|
||||
@@ -1641,7 +1642,7 @@ bool UIWindow::applyProperty( const StyleSheetProperty& attribute ) {
|
||||
winflags |= UI_WIN_MAXIMIZE_BUTTON;
|
||||
else if ( "minimize" == cur )
|
||||
winflags |= UI_WIN_MINIMIZE_BUTTON;
|
||||
else if ( "dragable" == cur )
|
||||
else if ( "draggable" == cur )
|
||||
winflags |= UI_WIN_DRAGABLE_CONTAINER;
|
||||
else if ( "shadow" == cur )
|
||||
winflags |= UI_WIN_SHADOW;
|
||||
|
||||
@@ -3626,78 +3626,86 @@ void App::init( const LogLevel& logLevel, std::string file, const Float& pidelDe
|
||||
{ "help", 0xf045 },
|
||||
{ "terminal", 0xf1f6 },
|
||||
{ "earth", 0xec7a },
|
||||
{ "arrow-down", 0xea4c },
|
||||
{ "arrow-up", 0xea76 },
|
||||
{ "arrow-down-s", 0xea4e },
|
||||
{ "arrow-right-s", 0xea6e },
|
||||
{ "match-case", 0xed8d },
|
||||
};
|
||||
for ( const auto& icon : icons )
|
||||
iconTheme->add( UIGlyphIcon::New( icon.first, iconFont, icon.second ) );
|
||||
|
||||
if ( mimeIconFont && mimeIconFont->loaded() ) {
|
||||
std::unordered_map<std::string, Uint32> mimeIcons = { { "filetype-lua", 61826 },
|
||||
{ "filetype-c", 61718 },
|
||||
{ "filetype-h", 61792 },
|
||||
{ "filetype-cs", 61720 },
|
||||
{ "filetype-cpp", 61719 },
|
||||
{ "filetype-css", 61743 },
|
||||
{ "filetype-conf", 61781 },
|
||||
{ "filetype-cfg", 61781 },
|
||||
{ "filetype-desktop", 61781 },
|
||||
{ "filetype-service", 61781 },
|
||||
{ "filetype-env", 61781 },
|
||||
{ "filetype-properties", 61781 },
|
||||
{ "filetype-ini", 61781 },
|
||||
{ "filetype-dart", 61744 },
|
||||
{ "filetype-diff", 61752 },
|
||||
{ "filetype-zip", 61775 },
|
||||
{ "filetype-go", 61789 },
|
||||
{ "filetype-htm", 61799 },
|
||||
{ "filetype-html", 61799 },
|
||||
{ "filetype-java", 61809 },
|
||||
{ "filetype-js", 61810 },
|
||||
{ "filetype-json", 61811 },
|
||||
{ "filetype-kt", 61814 },
|
||||
{ "filetype-md", 61829 },
|
||||
{ "filetype-perl", 61853 },
|
||||
{ "filetype-php", 61855 },
|
||||
{ "filetype-py", 61863 },
|
||||
{ "filetype-pyc", 61863 },
|
||||
{ "filetype-pyd", 61863 },
|
||||
{ "filetype-swift", 61906 },
|
||||
{ "filetype-rb", 61880 },
|
||||
{ "filetype-rs", 61881 },
|
||||
{ "filetype-ts", 61923 },
|
||||
{ "filetype-yaml", 61945 },
|
||||
{ "filetype-yml", 61945 },
|
||||
{ "filetype-jpg", 61801 },
|
||||
{ "filetype-png", 61801 },
|
||||
{ "filetype-jpeg", 61801 },
|
||||
{ "filetype-bmp", 61801 },
|
||||
{ "filetype-tga", 61801 },
|
||||
{ "filetype-sh", 61911 },
|
||||
{ "filetype-bash", 61911 },
|
||||
{ "filetype-fish", 61911 },
|
||||
{ "filetype-scala", 61882 },
|
||||
{ "filetype-r", 61866 },
|
||||
{ "filetype-rake", 61880 },
|
||||
{ "filetype-rss", 61879 },
|
||||
{ "filetype-sql", 61746 },
|
||||
{ "filetype-elm", 61763 },
|
||||
{ "filetype-ex", 61971 },
|
||||
{ "filetype-exs", 61971 },
|
||||
{ "filetype-awk", 61971 },
|
||||
{ "filetype-nim", 61734 },
|
||||
{ "filetype-xml", 61769 },
|
||||
{ "filetype-dockerfile", 61758 },
|
||||
{ "filetype-ruby", 61880 },
|
||||
{ "filetype-scala", 61882 },
|
||||
{ "filetype-perl", 61853 },
|
||||
{ "file", 61766 },
|
||||
{ "file-symlink", 61774 },
|
||||
{ "folder", 0xF23B },
|
||||
{ "folder-open", 0xF23C },
|
||||
{ "tree-expanded", 0xF11E },
|
||||
{ "tree-contracted", 0xF120 },
|
||||
{ "github", 0xF184 },
|
||||
{ "package", 61846 },
|
||||
{ "tab-close", 61944 } };
|
||||
std::unordered_map<std::string, Uint32> mimeIcons =
|
||||
|
||||
{ { "filetype-lua", 61826 },
|
||||
{ "filetype-c", 61718 },
|
||||
{ "filetype-h", 61792 },
|
||||
{ "filetype-cs", 61720 },
|
||||
{ "filetype-cpp", 61719 },
|
||||
{ "filetype-css", 61743 },
|
||||
{ "filetype-conf", 61781 },
|
||||
{ "filetype-cfg", 61781 },
|
||||
{ "filetype-desktop", 61781 },
|
||||
{ "filetype-service", 61781 },
|
||||
{ "filetype-env", 61781 },
|
||||
{ "filetype-properties", 61781 },
|
||||
{ "filetype-ini", 61781 },
|
||||
{ "filetype-dart", 61744 },
|
||||
{ "filetype-diff", 61752 },
|
||||
{ "filetype-zip", 61775 },
|
||||
{ "filetype-go", 61789 },
|
||||
{ "filetype-htm", 61799 },
|
||||
{ "filetype-html", 61799 },
|
||||
{ "filetype-java", 61809 },
|
||||
{ "filetype-js", 61810 },
|
||||
{ "filetype-json", 61811 },
|
||||
{ "filetype-kt", 61814 },
|
||||
{ "filetype-md", 61829 },
|
||||
{ "filetype-perl", 61853 },
|
||||
{ "filetype-php", 61855 },
|
||||
{ "filetype-py", 61863 },
|
||||
{ "filetype-pyc", 61863 },
|
||||
{ "filetype-pyd", 61863 },
|
||||
{ "filetype-swift", 61906 },
|
||||
{ "filetype-rb", 61880 },
|
||||
{ "filetype-rs", 61881 },
|
||||
{ "filetype-ts", 61923 },
|
||||
{ "filetype-yaml", 61945 },
|
||||
{ "filetype-yml", 61945 },
|
||||
{ "filetype-jpg", 61801 },
|
||||
{ "filetype-png", 61801 },
|
||||
{ "filetype-jpeg", 61801 },
|
||||
{ "filetype-bmp", 61801 },
|
||||
{ "filetype-tga", 61801 },
|
||||
{ "filetype-sh", 61911 },
|
||||
{ "filetype-bash", 61911 },
|
||||
{ "filetype-fish", 61911 },
|
||||
{ "filetype-scala", 61882 },
|
||||
{ "filetype-r", 61866 },
|
||||
{ "filetype-rake", 61880 },
|
||||
{ "filetype-rss", 61879 },
|
||||
{ "filetype-sql", 61746 },
|
||||
{ "filetype-elm", 61763 },
|
||||
{ "filetype-ex", 61971 },
|
||||
{ "filetype-exs", 61971 },
|
||||
{ "filetype-awk", 61971 },
|
||||
{ "filetype-nim", 61734 },
|
||||
{ "filetype-xml", 61769 },
|
||||
{ "filetype-dockerfile", 61758 },
|
||||
{ "filetype-ruby", 61880 },
|
||||
{ "filetype-scala", 61882 },
|
||||
{ "filetype-perl", 61853 },
|
||||
{ "file", 61766 },
|
||||
{ "file-symlink", 61774 },
|
||||
{ "folder", 0xF23B },
|
||||
{ "folder-open", 0xF23C },
|
||||
{ "tree-expanded", 0xF11E },
|
||||
{ "tree-contracted", 0xF120 },
|
||||
{ "github", 0xF184 },
|
||||
{ "package", 61846 },
|
||||
{ "tab-close", 61944 } };
|
||||
|
||||
for ( const auto& icon : mimeIcons )
|
||||
iconTheme->add( UIGlyphIcon::New( icon.first, mimeIconFont, icon.second ) );
|
||||
}
|
||||
|
||||
@@ -1328,6 +1328,11 @@ void App::init( const Float& pixelDensityConf, const bool& useAppTheme, const st
|
||||
{ "help", 0xf045 },
|
||||
{ "terminal", 0xf1f6 },
|
||||
{ "earth", 0xec7a },
|
||||
{ "arrow-down", 0xea4c },
|
||||
{ "arrow-up", 0xea76 },
|
||||
{ "arrow-down-s", 0xea4e },
|
||||
{ "arrow-right-s", 0xea6e },
|
||||
{ "match-case", 0xed8d },
|
||||
};
|
||||
for ( const auto& icon : icons ) {
|
||||
iconTheme->add( UIGlyphIcon::New( icon.first, iconFont, icon.second ) );
|
||||
|
||||
Reference in New Issue
Block a user