diff --git a/docs/articles/cssspecification.md b/docs/articles/cssspecification.md index c4796a424..f81f8898b 100644 --- a/docs/articles/cssspecification.md +++ b/docs/articles/cssspecification.md @@ -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). diff --git a/include/eepp/ui/css/propertydefinition.hpp b/include/eepp/ui/css/propertydefinition.hpp index 6eb79eded..41192efe9 100644 --- a/include/eepp/ui/css/propertydefinition.hpp +++ b/include/eepp/ui/css/propertydefinition.hpp @@ -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 { diff --git a/include/eepp/ui/uipushbutton.hpp b/include/eepp/ui/uipushbutton.hpp index bfea5578f..e423f966d 100644 --- a/include/eepp/ui/uipushbutton.hpp +++ b/include/eepp/ui/uipushbutton.hpp @@ -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& widgets, const Rectf& padding ); Vector2f calcLayoutSize( const std::vector& widgets, const Rectf& padding ) const; diff --git a/include/eepp/ui/uiselectbutton.hpp b/include/eepp/ui/uiselectbutton.hpp index e2ae8bc20..7dfa4517e 100644 --- a/include/eepp/ui/uiselectbutton.hpp +++ b/include/eepp/ui/uiselectbutton.hpp @@ -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(); }; diff --git a/src/eepp/system/functionstring.cpp b/src/eepp/system/functionstring.cpp index 2fc13960a..4d9929301 100644 --- a/src/eepp/system/functionstring.cpp +++ b/src/eepp/system/functionstring.cpp @@ -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 parameters; diff --git a/src/eepp/ui/css/drawableimageparser.cpp b/src/eepp/ui/css/drawableimageparser.cpp index ece9e0729..373f22a15 100644 --- a/src/eepp/ui/css/drawableimageparser.cpp +++ b/src/eepp/ui/css/drawableimageparser.cpp @@ -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 ) ); }; diff --git a/src/eepp/ui/css/stylesheetspecification.cpp b/src/eepp/ui/css/stylesheetspecification.cpp index 420965163..ab4b5f769 100644 --- a/src/eepp/ui/css/stylesheetspecification.cpp +++ b/src/eepp/ui/css/stylesheetspecification.cpp @@ -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" ); diff --git a/src/eepp/ui/doc/syntaxdefinitionmanager.cpp b/src/eepp/ui/doc/syntaxdefinitionmanager.cpp index 634590eb6..ad1562773 100644 --- a/src/eepp/ui/doc/syntaxdefinitionmanager.cpp +++ b/src/eepp/ui/doc/syntaxdefinitionmanager.cpp @@ -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" }, diff --git a/src/eepp/ui/uicheckbox.cpp b/src/eepp/ui/uicheckbox.cpp index a4fa4b948..78cb0d3b7 100644 --- a/src/eepp/ui/uicheckbox.cpp +++ b/src/eepp/ui/uicheckbox.cpp @@ -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 ); } diff --git a/src/eepp/ui/uiimage.cpp b/src/eepp/ui/uiimage.cpp index 203d078e7..01e235c9e 100644 --- a/src/eepp/ui/uiimage.cpp +++ b/src/eepp/ui/uiimage.cpp @@ -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; } diff --git a/src/eepp/ui/uipushbutton.cpp b/src/eepp/ui/uipushbutton.cpp index 98677e27b..3f2e0a878 100644 --- a/src/eepp/ui/uipushbutton.cpp +++ b/src/eepp/ui/uipushbutton.cpp @@ -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( 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: diff --git a/src/eepp/ui/uiselectbutton.cpp b/src/eepp/ui/uiselectbutton.cpp index 649eeb50a..60bb24666 100644 --- a/src/eepp/ui/uiselectbutton.cpp +++ b/src/eepp/ui/uiselectbutton.cpp @@ -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 diff --git a/src/eepp/ui/uiwidget.cpp b/src/eepp/ui/uiwidget.cpp index 92179c11e..ea13edc69 100644 --- a/src/eepp/ui/uiwidget.cpp +++ b/src/eepp/ui/uiwidget.cpp @@ -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() { diff --git a/src/eepp/ui/uiwidgetcreator.cpp b/src/eepp/ui/uiwidgetcreator.cpp index 2e433b0a8..175d4bd83 100644 --- a/src/eepp/ui/uiwidgetcreator.cpp +++ b/src/eepp/ui/uiwidgetcreator.cpp @@ -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; } diff --git a/src/eepp/ui/uiwindow.cpp b/src/eepp/ui/uiwindow.cpp index ed468952c..50a4beea3 100644 --- a/src/eepp/ui/uiwindow.cpp +++ b/src/eepp/ui/uiwindow.cpp @@ -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; diff --git a/src/tools/ecode/ecode.cpp b/src/tools/ecode/ecode.cpp index daf5ed092..62937f8f1 100644 --- a/src/tools/ecode/ecode.cpp +++ b/src/tools/ecode/ecode.cpp @@ -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 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 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 ) ); } diff --git a/src/tools/uieditor/uieditor.cpp b/src/tools/uieditor/uieditor.cpp index 49f25fa1c..b500ec63c 100644 --- a/src/tools/uieditor/uieditor.cpp +++ b/src/tools/uieditor/uieditor.cpp @@ -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 ) );