mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-04-02 21:47:40 -05:00
impr: Clean up old layout stuff
This commit is contained in:
@@ -493,14 +493,8 @@ namespace hex {
|
||||
using DrawCallback = std::function<void()>;
|
||||
using MenuCallback = std::function<void()>;
|
||||
using EnabledCallback = std::function<bool()>;
|
||||
using LayoutFunction = std::function<void(u32)>;
|
||||
using ClickCallback = std::function<void()>;
|
||||
|
||||
struct Layout {
|
||||
std::string unlocalizedName;
|
||||
LayoutFunction callback;
|
||||
};
|
||||
|
||||
struct MainMenuItem {
|
||||
std::string unlocalizedName;
|
||||
};
|
||||
@@ -535,8 +529,6 @@ namespace hex {
|
||||
std::vector<impl::SidebarItem> &getSidebarItems();
|
||||
std::vector<impl::TitleBarButton> &getTitleBarButtons();
|
||||
|
||||
std::vector<impl::Layout> &getLayouts();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -608,14 +600,6 @@ namespace hex {
|
||||
*/
|
||||
void addTitleBarButton(const std::string &icon, const std::string &unlocalizedTooltip, const impl::ClickCallback &function);
|
||||
|
||||
|
||||
/**
|
||||
* @brief Adds a new layout definition to the Layout menu
|
||||
* @param unlocalizedName The unlocalized name of the layout
|
||||
* @param function The function to call to setup the layout
|
||||
*/
|
||||
void addLayout(const std::string &unlocalizedName, const impl::LayoutFunction &function);
|
||||
|
||||
}
|
||||
|
||||
/* Provider Registry. Allows adding new data providers to be created from the UI */
|
||||
|
||||
@@ -26,6 +26,7 @@ namespace hex {
|
||||
|
||||
static void process();
|
||||
static void reload();
|
||||
static void reset();
|
||||
|
||||
private:
|
||||
LayoutManager() = default;
|
||||
|
||||
@@ -581,12 +581,6 @@ namespace hex {
|
||||
impl::getTitleBarButtons().push_back({ icon, unlocalizedTooltip, function });
|
||||
}
|
||||
|
||||
void addLayout(const std::string &unlocalizedName, const impl::LayoutFunction &function) {
|
||||
log::debug("Added new layout: {}", unlocalizedName);
|
||||
|
||||
impl::getLayouts().push_back({ unlocalizedName, function });
|
||||
}
|
||||
|
||||
namespace impl {
|
||||
|
||||
std::multimap<u32, impl::MainMenuItem> &getMainMenuItems() {
|
||||
@@ -626,12 +620,6 @@ namespace hex {
|
||||
return buttons;
|
||||
}
|
||||
|
||||
std::vector<impl::Layout> &getLayouts() {
|
||||
static std::vector<impl::Layout> layouts;
|
||||
|
||||
return layouts;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
|
||||
#include <imgui.h>
|
||||
|
||||
#include <fmt/format.h>
|
||||
|
||||
namespace hex {
|
||||
|
||||
std::optional<std::fs::path> LayoutManager::s_layoutPathToLoad;
|
||||
@@ -72,4 +74,10 @@ namespace hex {
|
||||
}
|
||||
}
|
||||
|
||||
void LayoutManager::reset() {
|
||||
s_layoutPathToLoad.reset();
|
||||
s_layoutStringToLoad.reset();
|
||||
s_layouts.clear();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user