1
0
mirror of synced 2024-11-25 00:00:27 +01:00

ui: Fix size of settings window

This commit is contained in:
WerWolv 2021-12-12 13:35:23 +01:00
parent 41ce0f57ed
commit d1ce8a5f9b

View File

@ -23,7 +23,8 @@ namespace hex::plugin::builtin {
ImGui::SetNextWindowSizeConstraints(ImVec2(0, 0), ImVec2(FLT_MAX, FLT_MAX)); ImGui::SetNextWindowSizeConstraints(ImVec2(0, 0), ImVec2(FLT_MAX, FLT_MAX));
if (ImGui::BeginPopupModal(View::toWindowName("hex.builtin.view.settings.name").c_str(), &this->getWindowOpenState(), ImGuiWindowFlags_AlwaysAutoResize)) { ImGui::SetNextWindowSize(ImVec2(500, 300) * SharedData::globalScale, ImGuiCond_Always);
if (ImGui::BeginPopupModal(View::toWindowName("hex.builtin.view.settings.name").c_str(), &this->getWindowOpenState(), ImGuiWindowFlags_NoResize)) {
if (ImGui::BeginTabBar("settings")) { if (ImGui::BeginTabBar("settings")) {
for (auto &[category, entries] : ContentRegistry::Settings::getEntries()) { for (auto &[category, entries] : ContentRegistry::Settings::getEntries()) {
if (ImGui::BeginTabItem(LangEntry(category))) { if (ImGui::BeginTabItem(LangEntry(category))) {
@ -49,6 +50,9 @@ namespace hex::plugin::builtin {
void ViewSettings::drawMenu() { void ViewSettings::drawMenu() {
if (ImGui::BeginMenu("hex.menu.help"_lang)) { if (ImGui::BeginMenu("hex.menu.help"_lang)) {
ImGui::Separator();
if (ImGui::MenuItem("hex.builtin.view.settings.name"_lang)) { if (ImGui::MenuItem("hex.builtin.view.settings.name"_lang)) {
View::doLater([]{ ImGui::OpenPopup(View::toWindowName("hex.builtin.view.settings.name").c_str()); }); View::doLater([]{ ImGui::OpenPopup(View::toWindowName("hex.builtin.view.settings.name").c_str()); });
this->getWindowOpenState() = true; this->getWindowOpenState() = true;