mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-04-02 05:27:41 -05:00
impr: Make sidebars disableable and resizable
This commit is contained in:
@@ -633,6 +633,7 @@ namespace hex {
|
||||
struct SidebarItem {
|
||||
std::string icon;
|
||||
DrawCallback callback;
|
||||
EnabledCallback enabledCallback;
|
||||
};
|
||||
|
||||
struct TitleBarButton {
|
||||
@@ -712,8 +713,9 @@ namespace hex {
|
||||
* @brief Adds a new sidebar item
|
||||
* @param icon The icon to use for the item
|
||||
* @param function The function to call to draw the item
|
||||
* @param enabledCallback The function
|
||||
*/
|
||||
void addSidebarItem(const std::string &icon, const impl::DrawCallback &function);
|
||||
void addSidebarItem(const std::string &icon, const impl::DrawCallback &function, const impl::EnabledCallback &enabledCallback = []{ return true; });
|
||||
|
||||
/**
|
||||
* @brief Adds a new title bar button
|
||||
|
||||
@@ -748,8 +748,8 @@ namespace hex {
|
||||
impl::getToolbarItems().push_back(function);
|
||||
}
|
||||
|
||||
void addSidebarItem(const std::string &icon, const impl::DrawCallback &function) {
|
||||
impl::getSidebarItems().push_back({ icon, function });
|
||||
void addSidebarItem(const std::string &icon, const impl::DrawCallback &function, const impl::EnabledCallback &enabledCallback) {
|
||||
impl::getSidebarItems().push_back({ icon, function, enabledCallback });
|
||||
}
|
||||
|
||||
void addTitleBarButton(const std::string &icon, const std::string &unlocalizedTooltip, const impl::ClickCallback &function) {
|
||||
|
||||
Reference in New Issue
Block a user