feat: Turn provider settings into sidebar
This commit is contained in:
parent
33e20df511
commit
b78435c881
@ -1,6 +1,7 @@
|
|||||||
#include "content/views/view_provider_settings.hpp"
|
#include "content/views/view_provider_settings.hpp"
|
||||||
|
|
||||||
#include <content/popups/popup_notification.hpp>
|
#include <content/popups/popup_notification.hpp>
|
||||||
|
#include <hex/api/content_registry.hpp>
|
||||||
|
|
||||||
namespace hex::plugin::builtin {
|
namespace hex::plugin::builtin {
|
||||||
|
|
||||||
@ -9,6 +10,18 @@ namespace hex::plugin::builtin {
|
|||||||
if (provider->hasLoadInterface() && !provider->shouldSkipLoadInterface())
|
if (provider->hasLoadInterface() && !provider->shouldSkipLoadInterface())
|
||||||
EventManager::post<RequestOpenPopup>(View::toWindowName("hex.builtin.view.provider_settings.load_popup"));
|
EventManager::post<RequestOpenPopup>(View::toWindowName("hex.builtin.view.provider_settings.load_popup"));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
ContentRegistry::Interface::addSidebarItem(ICON_VS_SERVER_PROCESS, [] {
|
||||||
|
auto provider = hex::ImHexApi::Provider::get();
|
||||||
|
|
||||||
|
if (provider != nullptr)
|
||||||
|
provider->drawInterface();
|
||||||
|
},
|
||||||
|
[] {
|
||||||
|
auto provider = hex::ImHexApi::Provider::get();
|
||||||
|
|
||||||
|
return provider != nullptr && provider->hasInterface() && provider->isAvailable();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
ViewProviderSettings::~ViewProviderSettings() {
|
ViewProviderSettings::~ViewProviderSettings() {
|
||||||
@ -16,13 +29,7 @@ namespace hex::plugin::builtin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ViewProviderSettings::drawContent() {
|
void ViewProviderSettings::drawContent() {
|
||||||
if (ImGui::Begin(this->getName().c_str(), &this->getWindowOpenState(), ImGuiWindowFlags_NoCollapse)) {
|
|
||||||
auto provider = hex::ImHexApi::Provider::get();
|
|
||||||
|
|
||||||
if (provider != nullptr)
|
|
||||||
provider->drawInterface();
|
|
||||||
}
|
|
||||||
ImGui::End();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ViewProviderSettings::drawAlwaysVisible() {
|
void ViewProviderSettings::drawAlwaysVisible() {
|
||||||
@ -68,13 +75,11 @@ namespace hex::plugin::builtin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool ViewProviderSettings::hasViewMenuItemEntry() const {
|
bool ViewProviderSettings::hasViewMenuItemEntry() const {
|
||||||
return this->isAvailable();
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ViewProviderSettings::isAvailable() const {
|
bool ViewProviderSettings::isAvailable() const {
|
||||||
auto provider = hex::ImHexApi::Provider::get();
|
return false;
|
||||||
|
|
||||||
return provider != nullptr && provider->hasInterface() && provider->isAvailable();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user