From b4cbfa02cf9b8cf3f19e3006d711c318aaee8f89 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Sun, 31 Jan 2021 00:04:33 +0100 Subject: [PATCH] Added latest release link to welcome screen --- source/views/view_pattern.cpp | 10 ---------- source/window.cpp | 16 +++++++++++++--- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/source/views/view_pattern.cpp b/source/views/view_pattern.cpp index 553c82776..8ce13cf1e 100644 --- a/source/views/view_pattern.cpp +++ b/source/views/view_pattern.cpp @@ -172,16 +172,6 @@ namespace hex { /* Settings */ { - ContentRegistry::Settings::add("Interface", "Color theme", 0, [](nlohmann::json &setting) { - static int selection = setting; - if (ImGui::Combo("##nolabel", &selection, "Dark\0Light\0Classic\0")) { - setting = selection; - return true; - } - - return false; - }); - View::subscribeEvent(Events::SettingsChanged, [this](auto) { int theme = ContentRegistry::Settings::getSettingsData()["Interface"]["Color theme"]; diff --git a/source/window.cpp b/source/window.cpp index 9458b7ad5..cb0f06ff9 100644 --- a/source/window.cpp +++ b/source/window.cpp @@ -69,10 +69,19 @@ namespace hex { this->initGLFW(); this->initImGui(); + ContentRegistry::Settings::add("Interface", "Color theme", 0, [](nlohmann::json &setting) { + static int selection = setting; + if (ImGui::Combo("##nolabel", &selection, "Dark\0Light\0Classic\0")) { + setting = selection; + return true; + } + + return false; + }); + ImGui::GetStyle().Colors[ImGuiCol_DockingEmptyBg] = ImGui::GetStyle().Colors[ImGuiCol_WindowBg]; EventManager::subscribe(Events::SettingsChanged, this, [](auto) -> std::any { int theme = ContentRegistry::Settings::getSettingsData()["Interface"]["Color theme"]; - switch (theme) { default: case 0: /* Dark theme */ @@ -85,7 +94,6 @@ namespace hex { ImGui::StyleColorsClassic(); break; } - ImGui::GetStyle().Colors[ImGuiCol_DockingEmptyBg] = ImGui::GetStyle().Colors[ImGuiCol_WindowBg]; return { }; @@ -200,7 +208,7 @@ namespace hex { if (ImGui::BeginMenu("View")) { for (auto &view : ContentRegistry::Views::getEntries()) { - if (view->isAvailable() && view->hasViewMenuItemEntry()) + if (view->hasViewMenuItemEntry()) ImGui::MenuItem((std::string(view->getName()) + " View").c_str(), "", &view->getWindowOpenState()); } ImGui::EndMenu(); @@ -328,6 +336,8 @@ namespace hex { ImGui::TableNextColumn(); ImGui::Text("Learn"); { + if (ImGui::DescriptionButton("Latest Release", "Get the latest version of ImHex or read the current changelog", ImVec2(ImGui::GetContentRegionAvail().x * 0.8, 0))) + hex::openWebpage("https://github.com/WerWolv/ImHex/releases/latest"); if (ImGui::DescriptionButton("Pattern Language Documentation", "Learn how to write ImHex patterns with our extensive documentation", ImVec2(ImGui::GetContentRegionAvail().x * 0.8, 0))) hex::openWebpage("https://github.com/WerWolv/ImHex/wiki/Pattern-Language-Guide"); if (ImGui::DescriptionButton("Plugins API", "Extend ImHex with additional features using plugins", ImVec2(ImGui::GetContentRegionAvail().x * 0.8, 0)))