Skip to content

Commit affd373

Browse files
committed
Merge branch 'develop' into feature/sdl3
2 parents 70cec91 + 64794b7 commit affd373

37 files changed

Lines changed: 1396 additions & 558 deletions

.ecode/project_build.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,12 @@
369369
"command": "${project_root}/bin/eepp-ui-markdownview-debug",
370370
"name": "eepp-ui-markdownview-debug",
371371
"working_dir": "${project_root}/bin"
372+
},
373+
{
374+
"args": "",
375+
"command": "${project_root}/bin/eepp-ui-dropdownmodellist-debug",
376+
"name": "eepp-ui-dropdownmodellist-debug",
377+
"working_dir": "${project_root}/bin"
372378
}
373379
],
374380
"var": {

bin/assets/plugins/aiassistant.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,10 @@
469469
{
470470
"name": "arcee-ai/trinity-large-preview:free",
471471
"display_name": "Arcee AI: Trinity Large Preview (free)"
472+
},
473+
{
474+
"name": "nvidia/nemotron-3-super-120b-a12b:free",
475+
"display_name": "NVIDIA: Nemotron 3 Super (free)"
472476
}
473477
]
474478
},

bin/assets/ui/breeze.css

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,8 @@ Anchor:hover {
244244

245245
PushButton,
246246
SelectButton,
247-
DropDownList {
247+
DropDownList,
248+
DropDownModelList {
248249
padding-left: var(--base-horizontal-padding);
249250
padding-right: var(--base-horizontal-padding);
250251
padding-top: var(--base-vertical-padding);
@@ -259,6 +260,7 @@ DropDownList {
259260
}
260261

261262
DropDownList,
263+
DropDownModelList,
262264
ComboBox::DropDownList {
263265
max-visible-items: 6;
264266
}
@@ -267,6 +269,8 @@ PushButton:hover,
267269
PushButton:focus,
268270
DropDownList:hover,
269271
DropDownList:focus,
272+
DropDownModelList:hover,
273+
DropDownModelList:focus,
270274
SelectButton:hover,
271275
SelectButton:focus,
272276
ComboBox:hover,
@@ -800,12 +804,14 @@ Window::border::bottom {
800804
background-color: var(--separator);
801805
}
802806

803-
DropDownList {
807+
DropDownList,
808+
DropDownModelList {
804809
padding-right: 16dp;
805810
text-overflow: ellipsis;
806811
}
807812

808813
DropDownList,
814+
DropDownModelList,
809815
ComboBox::Button {
810816
foreground-image: url("data:image/svg,<svg viewBox='0 0 24 24' fill='white'><path d='M12 15.6315L20.9679 10.8838L20.0321 9.11619L12 13.3685L3.96788 9.11619L3.0321 10.8838L12 15.6315Z'></path></svg>");
811817
foreground-position-x: right 6dp;
@@ -816,6 +822,8 @@ ComboBox::Button {
816822

817823
DropDownList:hover,
818824
DropDownList:focus,
825+
DropDownModelList:hover,
826+
DropDownModelList:focus,
819827
ComboBox::Button:focus,
820828
ComboBox::Button:hover {
821829
foreground-tint: var(--icon-active);

include/eepp/core/containers.hpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
#ifndef EE_CONTAINERS_HPP
22
#define EE_CONTAINERS_HPP
33

4-
#ifdef EEPP_NO_THIRDPARTY_CONTAINERS
4+
#include <eepp/config.hpp>
5+
6+
#if defined( EEPP_NO_THIRDPARTY_CONTAINERS ) || ( defined( EE_DEBUG ) && defined( EE_COMPILER_MSVC ) )
57
#include <unordered_map>
68
#include <unordered_set>
79
#else
@@ -11,7 +13,7 @@
1113

1214
namespace EE {
1315

14-
#ifdef EEPP_NO_THIRDPARTY_CONTAINERS
16+
#if defined( EEPP_NO_THIRDPARTY_CONTAINERS ) || ( defined( EE_DEBUG ) && defined( EE_COMPILER_MSVC ) )
1517

1618
template <typename Key, typename Value> using UnorderedMap = std::unordered_map<Key, Value>;
1719

include/eepp/ui/abstract/uiabstracttableview.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ using namespace EE::Math;
1313
namespace EE { namespace UI {
1414
class UIPushButton;
1515
class UILinearLayout;
16+
class UIDropDownModelList;
1617
}} // namespace EE::UI
1718

1819
namespace EE { namespace UI { namespace Abstract {
@@ -146,6 +147,7 @@ class EE_API UIAbstractTableView : public UIAbstractView {
146147

147148
protected:
148149
friend class EE::UI::UITableHeaderColumn;
150+
friend class EE::UI::UIDropDownModelList;
149151

150152
struct ColumnData {
151153
Float minWidth{ 0 };

include/eepp/ui/uidropdown.hpp

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
#ifndef EE_UI_UIDROPDOWN_HPP
2+
#define EE_UI_UIDROPDOWN_HPP
3+
4+
#include <eepp/ui/uitextinput.hpp>
5+
6+
namespace EE { namespace UI {
7+
8+
class EE_API UIDropDown : public UITextInput {
9+
public:
10+
enum class MenuWidthMode {
11+
DropDown,
12+
Contents,
13+
ContentsCentered,
14+
ExpandIfNeeded,
15+
ExpandIfNeededCentered
16+
};
17+
18+
static MenuWidthMode menuWidthModeFromString( std::string_view str );
19+
20+
static std::string menuWidthModeToString( MenuWidthMode rule );
21+
22+
struct StyleConfig {
23+
Uint32 MaxNumVisibleItems = 10;
24+
bool PopUpToRoot = false;
25+
MenuWidthMode menuWidthRule{ MenuWidthMode::DropDown };
26+
};
27+
28+
virtual ~UIDropDown();
29+
30+
virtual Uint32 getType() const;
31+
virtual bool isType( const Uint32& type ) const;
32+
33+
virtual void setTheme( UITheme* Theme );
34+
35+
virtual UIDropDown* showList();
36+
37+
bool getPopUpToRoot() const;
38+
UIDropDown* setPopUpToRoot( bool popUpToRoot );
39+
40+
Uint32 getMaxNumVisibleItems() const;
41+
virtual UIDropDown* setMaxNumVisibleItems( const Uint32& maxNumVisibleItems );
42+
43+
const StyleConfig& getStyleConfig() const;
44+
UIDropDown* setStyleConfig( const StyleConfig& styleConfig );
45+
46+
UIDropDown* setMenuWidthMode( MenuWidthMode rule );
47+
MenuWidthMode getMenuWidthMode() const;
48+
49+
virtual bool applyProperty( const StyleSheetProperty& attribute );
50+
virtual std::string getPropertyString( const PropertyDefinition* propertyDef,
51+
const Uint32& propertyIndex = 0 ) const;
52+
virtual std::vector<PropertyId> getPropertiesImplemented() const;
53+
54+
protected:
55+
StyleConfig mStyleConfig;
56+
UINode* mFriendNode{ nullptr };
57+
58+
UIDropDown( const std::string& tag );
59+
60+
virtual UIWidget* getPopUpWidget() const;
61+
62+
void onPopUpFocusLoss( const Event* Event );
63+
64+
virtual void onItemSelected( const Event* Event );
65+
virtual void show();
66+
virtual void hide();
67+
68+
virtual Uint32 onMouseOver( const Vector2i& position, const Uint32& flags );
69+
virtual Uint32 onMouseLeave( const Vector2i& position, const Uint32& flags );
70+
virtual Uint32 onMouseClick( const Vector2i& position, const Uint32& flags );
71+
72+
virtual void onItemClicked( const Event* Event );
73+
virtual void onItemKeyDown( const Event* Event );
74+
virtual void onWidgetClear( const Event* Event );
75+
virtual Uint32 onKeyDown( const KeyEvent& Event );
76+
77+
virtual void onSizeChange();
78+
virtual void onAutoSize();
79+
virtual void onThemeLoaded();
80+
81+
void setFriendNode( UINode* friendNode );
82+
83+
Float getPopUpWidth( Float contentsWidth ) const;
84+
void alignPopUp( UIWidget* widget );
85+
};
86+
87+
}} // namespace EE::UI
88+
89+
#endif

include/eepp/ui/uidropdownlist.hpp

Lines changed: 6 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,15 @@
11
#ifndef EE_UICUIDROPDOWNLIST_HPP
22
#define EE_UICUIDROPDOWNLIST_HPP
33

4+
#include <eepp/ui/uidropdown.hpp>
45
#include <eepp/ui/uilistbox.hpp>
5-
#include <eepp/ui/uitextinput.hpp>
66

77
namespace EE { namespace UI {
88

9-
class EE_API UIDropDownList : public UITextInput {
9+
class EE_API UIDropDownList : public UIDropDown {
1010
public:
11-
enum class MenuWidthMode {
12-
DropDown,
13-
Contents,
14-
ContentsCentered,
15-
ExpandIfNeeded,
16-
ExpandIfNeededCentered
17-
};
18-
19-
static MenuWidthMode menuWidthModeFromString( std::string_view str );
20-
21-
static std::string menuWidthModeToString( MenuWidthMode rule );
22-
23-
struct StyleConfig {
24-
Uint32 MaxNumVisibleItems = 10;
25-
bool PopUpToRoot = false;
26-
MenuWidthMode menuWidthRule{ MenuWidthMode::DropDown };
27-
};
11+
using MenuWidthMode = UIDropDown::MenuWidthMode;
12+
using StyleConfig = UIDropDown::StyleConfig;
2813

2914
static UIDropDownList* NewWithTag( const std::string& tag );
3015

@@ -33,84 +18,39 @@ class EE_API UIDropDownList : public UITextInput {
3318
virtual ~UIDropDownList();
3419

3520
virtual Uint32 getType() const;
36-
3721
virtual bool isType( const Uint32& type ) const;
3822

39-
virtual void setTheme( UITheme* Theme );
40-
4123
UIListBox* getListBox() const;
4224

4325
UIDropDownList* showList();
4426

45-
bool getPopUpToRoot() const;
46-
47-
UIDropDownList* setPopUpToRoot( bool popUpToRoot );
48-
49-
Uint32 getMaxNumVisibleItems() const;
50-
51-
UIDropDownList* setMaxNumVisibleItems( const Uint32& maxNumVisibleItems );
52-
53-
const StyleConfig& getStyleConfig() const;
54-
55-
UIDropDownList* setStyleConfig( const StyleConfig& styleConfig );
27+
virtual UIDropDownList* setMaxNumVisibleItems( const Uint32& maxNumVisibleItems );
5628

5729
virtual bool applyProperty( const StyleSheetProperty& attribute );
58-
5930
virtual std::string getPropertyString( const PropertyDefinition* propertyDef,
6031
const Uint32& propertyIndex = 0 ) const;
61-
6232
virtual std::vector<PropertyId> getPropertiesImplemented() const;
6333

6434
virtual void loadFromXmlNode( const pugi::xml_node& node );
6535

66-
UIDropDownList* setMenuWidthMode( MenuWidthMode rule );
67-
68-
MenuWidthMode getMenuWidthMode() const;
69-
7036
protected:
7137
friend class UIComboBox;
7238

73-
StyleConfig mStyleConfig;
7439
UIListBox* mListBox;
75-
UINode* mFriendNode;
7640
Uint32 mListBoxCloseCb{ 0 };
7741

7842
UIDropDownList( const std::string& tag = "dropdownlist" );
7943

80-
void onListBoxFocusLoss( const Event* Event );
44+
virtual UIWidget* getPopUpWidget() const;
8145

8246
virtual void onItemSelected( const Event* Event );
8347

84-
virtual void show();
85-
86-
virtual void hide();
87-
88-
virtual Uint32 onMouseOver( const Vector2i& position, const Uint32& flags );
89-
90-
virtual Uint32 onMouseLeave( const Vector2i& position, const Uint32& flags );
91-
9248
virtual Uint32 onMouseUp( const Vector2i& position, const Uint32& flags );
9349

94-
virtual Uint32 onMouseClick( const Vector2i& position, const Uint32& flags );
95-
96-
virtual void onItemClicked( const Event* Event );
97-
98-
virtual void onItemKeyDown( const Event* Event );
99-
100-
virtual void onWidgetClear( const Event* Event );
101-
10250
virtual Uint32 onKeyDown( const KeyEvent& Event );
10351

10452
virtual void onClassChange();
10553

106-
virtual void onSizeChange();
107-
108-
virtual void onAutoSize();
109-
110-
virtual void onThemeLoaded();
111-
112-
void setFriendNode( UINode* friendNode );
113-
11454
void destroyListBox();
11555
};
11656

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
#ifndef EE_UI_UIDROPDOWNMODELLIST_HPP
2+
#define EE_UI_UIDROPDOWNMODELLIST_HPP
3+
4+
#include <eepp/ui/abstract/uiabstracttableview.hpp>
5+
#include <eepp/ui/uidropdown.hpp>
6+
7+
namespace EE { namespace UI {
8+
9+
class EE_API UIDropDownModelList : public UIDropDown {
10+
public:
11+
using MenuWidthMode = UIDropDown::MenuWidthMode;
12+
using StyleConfig = UIDropDown::StyleConfig;
13+
14+
static UIDropDownModelList* NewWithTag( const std::string& tag );
15+
16+
static UIDropDownModelList* New();
17+
18+
virtual ~UIDropDownModelList();
19+
20+
virtual Uint32 getType() const;
21+
virtual bool isType( const Uint32& type ) const;
22+
23+
UIAbstractTableView* getListView() const;
24+
25+
void setListView( UIAbstractTableView* listView );
26+
27+
std::shared_ptr<Model> getModel() const;
28+
29+
virtual void setModel( std::shared_ptr<Model> model );
30+
31+
UIDropDownModelList* showList();
32+
33+
virtual UIDropDownModelList* setMaxNumVisibleItems( const Uint32& maxNumVisibleItems );
34+
35+
virtual std::string getPropertyString( const PropertyDefinition* propertyDef,
36+
const Uint32& propertyIndex = 0 ) const;
37+
38+
virtual std::vector<PropertyId> getPropertiesImplemented() const;
39+
40+
protected:
41+
UIAbstractTableView* mListView;
42+
Uint32 mListViewCloseCb{ 0 };
43+
std::shared_ptr<Model> mModel;
44+
45+
UIDropDownModelList( const std::string& tag = "dropdownmodellist" );
46+
47+
virtual UIWidget* getPopUpWidget() const;
48+
49+
virtual void onItemSelected( const Event* Event );
50+
51+
virtual Uint32 onMouseUp( const Vector2i& position, const Uint32& flags );
52+
53+
virtual Uint32 onKeyDown( const KeyEvent& Event );
54+
55+
virtual void onItemClicked( const Event* Event );
56+
57+
virtual void onClassChange();
58+
59+
void destroyListView();
60+
61+
UIWidget* createDefaultListView();
62+
63+
void updateSelectionIndex();
64+
};
65+
66+
}} // namespace EE::UI
67+
68+
#endif

0 commit comments

Comments
 (0)