1
0
mirror of synced 2025-02-07 06:31:24 +01:00

ui: Added ImHex logo to about page

This commit is contained in:
WerWolv 2022-01-23 20:46:19 +01:00
parent 8397af5c9b
commit 053c897056
3 changed files with 32 additions and 13 deletions

@ -1 +1 @@
Subproject commit 0842d22deb13e036eb1fb15df368b6cad552abfe
Subproject commit 5d3273443a47f4a2f295cc476b5266a84e836206

View File

@ -37,6 +37,8 @@ namespace hex::plugin::builtin {
void drawLibraryCreditsPage();
void drawPathsPage();
void drawLicensePage();
ImGui::Texture m_logoTexture;
};
}

View File

@ -3,6 +3,7 @@
#include <hex/helpers/fmt.hpp>
#include <hex/helpers/utils.hpp>
#include <hex/helpers/logger.hpp>
#include <romfs/romfs.hpp>
@ -25,15 +26,27 @@ namespace hex::plugin::builtin {
}
ViewHelp::~ViewHelp() {
ImGui::UnloadImage(this->m_logoTexture);
}
static void link(const std::string &label, const std::string &url) {
if (ImGui::BulletHyperlink(label.data()))
hex::openWebpage(url.data());
hex::openWebpage(url);
}
void ViewHelp::drawAboutMainPage() {
if (ImGui::BeginTable("about_table", 2, ImGuiTableFlags_SizingFixedFit)) {
ImGui::TableNextRow();
ImGui::TableNextColumn();
if (!this->m_logoTexture.valid()) {
auto logo = romfs::get("logo.png");
this->m_logoTexture = ImGui::LoadImageFromMemory(reinterpret_cast<const ImU8*>(logo.data()), logo.size());
}
ImGui::Image(this->m_logoTexture.textureId, scaled(this->m_logoTexture.size()));
ImGui::TableNextColumn();
ImGui::TextFormatted("ImHex Hex Editor v{} by WerWolv - " ICON_FA_CODE_BRANCH, IMHEX_VERSION);
#if defined(GIT_BRANCH) && defined(GIT_COMMIT_HASH)
@ -47,6 +60,10 @@ namespace hex::plugin::builtin {
ImGui::TextUnformatted("hex.builtin.view.help.about.source"_lang); ImGui::SameLine();
if (ImGui::Hyperlink("WerWolv/ImHex"))
hex::openWebpage("https://github.com/WerWolv/ImHex");
ImGui::EndTable();
}
ImGui::NewLine();
ImGui::TextUnformatted("hex.builtin.view.help.about.donations"_lang);