ObsidianDragon - DragonX ImGui Wallet
Full-node GUI wallet for DragonX cryptocurrency. Built with Dear ImGui, SDL3, and OpenGL3/DX11. Features: - Send/receive shielded and transparent transactions - Autoshield with merged transaction display - Built-in CPU mining (xmrig) - Peer management and network monitoring - Wallet encryption with PIN lock - QR code generation for receive addresses - Transaction history with pagination - Console for direct RPC commands - Cross-platform (Linux, Windows)
This commit is contained in:
180
src/ui/windows/about_dialog.cpp
Normal file
180
src/ui/windows/about_dialog.cpp
Normal file
@@ -0,0 +1,180 @@
|
||||
// DragonX Wallet - ImGui Edition
|
||||
// Copyright 2024-2026 The Hush Developers
|
||||
// Released under the GPLv3
|
||||
|
||||
#include "about_dialog.h"
|
||||
#include "../../app.h"
|
||||
#include "../../config/version.h"
|
||||
#include "../theme.h"
|
||||
#include "../effects/imgui_acrylic.h"
|
||||
#include "../schema/ui_schema.h"
|
||||
#include "../material/type.h"
|
||||
#include "../material/draw_helpers.h"
|
||||
#include "imgui.h"
|
||||
|
||||
namespace dragonx {
|
||||
namespace ui {
|
||||
|
||||
void RenderAboutDialog(App* app, bool* p_open)
|
||||
{
|
||||
(void)app;
|
||||
auto& S = schema::UI();
|
||||
auto win = S.window("dialogs.about");
|
||||
auto linkBtn = S.button("dialogs.about", "link-button");
|
||||
auto closeBtn = S.button("dialogs.about", "close-button");
|
||||
auto versionLbl = S.label("dialogs.about", "version-label");
|
||||
auto editionLbl = S.label("dialogs.about", "edition-label");
|
||||
|
||||
ImGui::SetNextWindowSize(ImVec2(win.width, win.height), ImGuiCond_FirstUseEver);
|
||||
ImVec2 center = ImGui::GetMainViewport()->GetCenter();
|
||||
ImGui::SetNextWindowPos(center, ImGuiCond_Appearing, ImVec2(0.5f, 0.5f));
|
||||
|
||||
// Use acrylic modal popup from current theme
|
||||
const auto& acrylicTheme = GetCurrentAcrylicTheme();
|
||||
ImGui::OpenPopup("About ObsidianDragon");
|
||||
if (!effects::ImGuiAcrylic::BeginAcrylicPopupModal("About ObsidianDragon", p_open,
|
||||
ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoTitleBar, acrylicTheme.popup)) {
|
||||
effects::ImGuiAcrylic::EndAcrylicPopup();
|
||||
return;
|
||||
}
|
||||
|
||||
// Use Body2 font for all dialog text
|
||||
ImGui::PushFont(Type().body2());
|
||||
|
||||
// Logo/Title area
|
||||
ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(0.3f, 0.69f, 0.31f, 1.0f)); // Green
|
||||
ImGui::PushFont(Type().h4());
|
||||
ImGui::Text("ObsidianDragon");
|
||||
ImGui::PopFont();
|
||||
ImGui::PopStyleColor();
|
||||
|
||||
ImGui::SameLine(ImGui::GetWindowWidth() - editionLbl.position);
|
||||
ImGui::TextDisabled("ImGui Edition");
|
||||
|
||||
ImGui::Spacing();
|
||||
ImGui::Separator();
|
||||
ImGui::Spacing();
|
||||
|
||||
// Version info
|
||||
ImGui::Text("Version:");
|
||||
ImGui::SameLine(versionLbl.position);
|
||||
ImGui::Text("%s", DRAGONX_VERSION);
|
||||
|
||||
ImGui::Text("ImGui:");
|
||||
ImGui::SameLine(versionLbl.position);
|
||||
ImGui::Text("%s", IMGUI_VERSION);
|
||||
|
||||
ImGui::Text("Build Date:");
|
||||
ImGui::SameLine(versionLbl.position);
|
||||
ImGui::Text("%s %s", __DATE__, __TIME__);
|
||||
|
||||
#ifdef DRAGONX_DEBUG
|
||||
ImGui::Text("Build Type:");
|
||||
ImGui::SameLine(versionLbl.position);
|
||||
ImGui::TextColored(ImVec4(1.0f, 0.6f, 0.0f, 1.0f), "Debug");
|
||||
#else
|
||||
ImGui::Text("Build Type:");
|
||||
ImGui::SameLine(versionLbl.position);
|
||||
ImGui::Text("Release");
|
||||
#endif
|
||||
|
||||
// Daemon info
|
||||
if (app && app->isConnected()) {
|
||||
ImGui::Spacing();
|
||||
ImGui::Separator();
|
||||
ImGui::Spacing();
|
||||
|
||||
ImGui::Text("Daemon:");
|
||||
ImGui::SameLine(versionLbl.position);
|
||||
ImGui::TextColored(ImVec4(0.3f, 0.8f, 0.3f, 1.0f), "Connected");
|
||||
|
||||
const auto& state = app->getWalletState();
|
||||
ImGui::Text("Chain:");
|
||||
ImGui::SameLine(versionLbl.position);
|
||||
ImGui::Text("ObsidianDragon");
|
||||
|
||||
ImGui::Text("Block Height:");
|
||||
ImGui::SameLine(versionLbl.position);
|
||||
ImGui::Text("%d", state.sync.blocks);
|
||||
|
||||
ImGui::Text("Connections:");
|
||||
ImGui::SameLine(versionLbl.position);
|
||||
ImGui::Text("%zu peers", state.peers.size());
|
||||
}
|
||||
|
||||
ImGui::Spacing();
|
||||
ImGui::Separator();
|
||||
ImGui::Spacing();
|
||||
|
||||
// Credits
|
||||
ImGui::TextColored(ImVec4(0.7f, 0.7f, 0.7f, 1.0f), "Credits");
|
||||
ImGui::Spacing();
|
||||
|
||||
ImGui::BulletText("The Hush Developers");
|
||||
ImGui::BulletText("ObsidianDragon Community");
|
||||
ImGui::BulletText("Dear ImGui by Omar Cornut");
|
||||
ImGui::BulletText("ImPlot by Evan Pezent");
|
||||
ImGui::BulletText("SDL3 by Sam Lantinga");
|
||||
|
||||
ImGui::Spacing();
|
||||
ImGui::Separator();
|
||||
ImGui::Spacing();
|
||||
|
||||
// License
|
||||
ImGui::TextColored(ImVec4(0.7f, 0.7f, 0.7f, 1.0f), "License");
|
||||
ImGui::Spacing();
|
||||
ImGui::TextWrapped(
|
||||
"This software is released under the GNU General Public License v3 (GPLv3). "
|
||||
"You are free to use, modify, and distribute this software under the terms of the license."
|
||||
);
|
||||
|
||||
ImGui::Spacing();
|
||||
ImGui::Separator();
|
||||
ImGui::Spacing();
|
||||
|
||||
// Links
|
||||
if (material::StyledButton("Website", ImVec2(linkBtn.width, 0), S.resolveFont(linkBtn.font))) {
|
||||
#ifdef _WIN32
|
||||
system("start https://dragonx.is");
|
||||
#elif __APPLE__
|
||||
system("open https://dragonx.is");
|
||||
#else
|
||||
system("xdg-open https://dragonx.is &");
|
||||
#endif
|
||||
}
|
||||
ImGui::SameLine();
|
||||
if (material::StyledButton("GitHub", ImVec2(linkBtn.width, 0), S.resolveFont(linkBtn.font))) {
|
||||
#ifdef _WIN32
|
||||
system("start https://git.hush.is/dragonx/ObsidianDragon");
|
||||
#elif __APPLE__
|
||||
system("open https://git.hush.is/dragonx/ObsidianDragon");
|
||||
#else
|
||||
system("xdg-open https://git.hush.is/dragonx/ObsidianDragon &");
|
||||
#endif
|
||||
}
|
||||
ImGui::SameLine();
|
||||
if (material::StyledButton("Block Explorer", ImVec2(linkBtn.width, 0), S.resolveFont(linkBtn.font))) {
|
||||
#ifdef _WIN32
|
||||
system("start https://explorer.dragonx.is");
|
||||
#elif __APPLE__
|
||||
system("open https://explorer.dragonx.is");
|
||||
#else
|
||||
system("xdg-open https://explorer.dragonx.is &");
|
||||
#endif
|
||||
}
|
||||
|
||||
ImGui::Spacing();
|
||||
|
||||
// Close button
|
||||
float button_width = closeBtn.width;
|
||||
ImGui::SetCursorPosX((ImGui::GetWindowWidth() - button_width) * 0.5f);
|
||||
if (material::StyledButton("Close", ImVec2(button_width, 0), S.resolveFont(closeBtn.font))) {
|
||||
*p_open = false;
|
||||
}
|
||||
|
||||
ImGui::PopFont(); // Body2
|
||||
effects::ImGuiAcrylic::EndAcrylicPopup();
|
||||
}
|
||||
|
||||
} // namespace ui
|
||||
} // namespace dragonx
|
||||
Reference in New Issue
Block a user