Sun, 28 Jan 2024 17:05:46 +0100
add more toolbar items
application/application.c | file | annotate | diff | comparison | revisions | |
ui/ui/toolbar.h | file | annotate | diff | comparison | revisions |
--- a/application/application.c Sun Jan 28 16:31:34 2024 +0100 +++ b/application/application.c Sun Jan 28 17:05:46 2024 +0100 @@ -54,14 +54,38 @@ // toolbar - ui_toolbar_item("Home", .label = "Home", .icon = "Home"); - + ui_toolbar_item("Home", .icon = "Home"); + ui_toolbar_item("NewWindow", .icon = "NewWindow"); ui_toolbar_menu("Repo", .label = "Repository") { ui_menu_itemlist(.varname = "repolist"); } + ui_toolbar_item("Refresh", .icon = "Refresh"); + ui_toolbar_item("NewFolder", .icon = "NewFolder"); + ui_toolbar_item("NewFile", .icon = "Add"); + ui_toolbar_item("Upload", .label = "Upload", .icon = "Upload"); + ui_toolbar_item("Download", .icon = "SaveLocal"); + ui_toolbar_item("Remove", .icon = "Delete"); + ui_toolbar_item("LocalBrowser", .icon = "DockLeft", .label = "Local Browser"); + ui_toolbar_item("PreviewPane", .icon = "DockRight"); + + ui_toolbar_appmenu() { + ui_menuitem("TODO", NULL); + } + ui_toolbar_add_default("Home", UI_TOOLBAR_LEFT); + ui_toolbar_add_default("NewWindow", UI_TOOLBAR_LEFT); ui_toolbar_add_default("Repo", UI_TOOLBAR_LEFT); + + ui_toolbar_add_default("NewFolder", UI_TOOLBAR_CENTER); + ui_toolbar_add_default("NewFile", UI_TOOLBAR_CENTER); + ui_toolbar_add_default("Remove", UI_TOOLBAR_CENTER); + ui_toolbar_add_default("Download", UI_TOOLBAR_CENTER); + ui_toolbar_add_default("Upload", UI_TOOLBAR_CENTER); + + ui_toolbar_add_default("LocalBrowser", UI_TOOLBAR_RIGHT); + ui_toolbar_add_default("PreviewPane", UI_TOOLBAR_RIGHT); + ui_toolbar_add_default("PreviewPane", UI_TOOLBAR_RIGHT); }
--- a/ui/ui/toolbar.h Sun Jan 28 16:31:34 2024 +0100 +++ b/ui/ui/toolbar.h Sun Jan 28 17:05:46 2024 +0100 @@ -70,7 +70,8 @@ #define ui_toolbar_item(name, ...) ui_toolbar_item_create(name, (UiToolbarItemArgs){ __VA_ARGS__ } ) #define ui_toolbar_toggleitem(name, ...) ui_toolbar_toggleitem_create(name, (UiToolbarToggleItemArgs){ __VA_ARGS__ } ) -#define ui_toolbar_menu(obj, ...) for(ui_toolbar_menu_create(obj, (UiToolbarMenuArgs){ __VA_ARGS__ });ui_menu_is_open();ui_menu_close()) +#define ui_toolbar_menu(name, ...) for(ui_toolbar_menu_create(name, (UiToolbarMenuArgs){ __VA_ARGS__ });ui_menu_is_open();ui_menu_close()) +#define ui_toolbar_appmenu() for(ui_toolbar_menu_create(NULL, (UiToolbarMenuArgs){ 0 });ui_menu_is_open();ui_menu_close()) UIEXPORT void ui_toolbar_item_create(const char* name, UiToolbarItemArgs args);