add wip about window to start and main screen
Some checks are pending
ContinuousDelivery / linux-ubuntu (push) Waiting to run
ContinuousDelivery / android (map[ndk_abi:arm64-v8a vcpkg_toolkit:arm64-android-23]) (push) Waiting to run
ContinuousDelivery / android (map[ndk_abi:armeabi-v7a vcpkg_toolkit:arm-neon-android-23]) (push) Waiting to run
ContinuousDelivery / android (map[ndk_abi:x86_64 vcpkg_toolkit:x64-android-23]) (push) Waiting to run
ContinuousDelivery / windows (windows-2022, ) (push) Waiting to run
ContinuousDelivery / windows (windows-2022, asan) (push) Waiting to run
ContinuousDelivery / dumpsyms (push) Blocked by required conditions
ContinuousDelivery / release (push) Blocked by required conditions
ContinuousIntegration / on ubuntu-24.04-arm (push) Waiting to run
ContinuousIntegration / asan on ubuntu-24.04-arm (push) Waiting to run
ContinuousIntegration / on ubuntu-latest (push) Waiting to run
ContinuousIntegration / asan on ubuntu-latest (push) Waiting to run
ContinuousIntegration / android (map[ndk_abi:arm64-v8a vcpkg_toolkit:arm64-android-23]) (push) Waiting to run
ContinuousIntegration / android (map[ndk_abi:armeabi-v7a vcpkg_toolkit:arm-neon-android-23]) (push) Waiting to run
ContinuousIntegration / android (map[ndk_abi:x86_64 vcpkg_toolkit:x64-android-23]) (push) Waiting to run
ContinuousIntegration / macos (push) Waiting to run
ContinuousIntegration / windows (push) Waiting to run

This commit is contained in:
Green Sky
2025-08-06 20:50:03 +02:00
parent 8e805522d5
commit 2353d57dd3
6 changed files with 82 additions and 0 deletions

View File

@@ -82,6 +82,8 @@ target_sources(tomato PUBLIC
./sys_tray.cpp
./string_formatter_utils.hpp
./chat_gui/about.hpp
./chat_gui/about.cpp
./chat_gui/theme.hpp
./chat_gui/theme.cpp
./chat_gui/icons/direct.hpp

54
src/chat_gui/about.cpp Normal file
View File

@@ -0,0 +1,54 @@
#include "./about.hpp"
#include "./version.hpp"
#include <imgui.h>
#include <string>
void ImGuiTomatoAbout(void) {
if (ImGui::BeginTabBar("about")) {
if (ImGui::BeginTabItem("tomato")) {
std::string tomato_version_string {"tomato " TOMATO_VERSION_STR};
if (TOMATO_GIT_DEPTH != 0) {
tomato_version_string += "-" + std::to_string(TOMATO_GIT_DEPTH);
}
if (std::string_view{TOMATO_GIT_COMMIT} != "UNK") {
tomato_version_string += "+git.";
tomato_version_string += TOMATO_GIT_COMMIT;
}
ImGui::TextUnformatted(tomato_version_string.c_str());
ImGui::SameLine();
if (ImGui::SmallButton("click to copy")) {
ImGui::SetClipboardText(tomato_version_string.c_str());
}
ImGui::Separator();
ImGui::TextUnformatted("TODO: tomato license");
ImGui::EndTabItem();
}
if (ImGui::BeginTabItem("imgui")) {
ImGui::ShowAboutWindow();
ImGui::EndTabItem();
}
if (ImGui::BeginTabItem("others")) {
ImGui::TextUnformatted("TODO: list all the other libs and their licenses");
ImGui::EndTabItem();
}
if (ImGui::BeginTabItem("funding")) {
ImGui::TextWrapped("Your Help is needed, to keep the project alive, expand it's features and to inspire new features!");
ImGui::TextLinkOpenURL("https://github.com/sponsors/Green-Sky");
ImGui::TextUnformatted("Contact Me for more ways to help the project. :)");
ImGui::EndTabItem();
}
ImGui::EndTabBar();
}
}

5
src/chat_gui/about.hpp Normal file
View File

@@ -0,0 +1,5 @@
#pragma once
// not a window, just the content
void ImGuiTomatoAbout(void);

View File

@@ -5,6 +5,8 @@
#include <solanaceae/contact/components.hpp>
#include "./chat_gui/about.hpp"
#include "./frame_streams/sdl/sdl_audio2_frame_stream2.hpp"
#include "./frame_streams/sdl/sdl_video_frame_stream2.hpp"
@@ -433,6 +435,9 @@ Screen* MainScreen::render(float time_delta, bool&) {
ImGui::EndMenu();
}
if (ImGui::MenuItem("About", nullptr, _show_about)) {
_show_about = !_show_about;
}
ImGui::EndMenuBar();
}
@@ -467,6 +472,13 @@ Screen* MainScreen::render(float time_delta, bool&) {
ImGui::ShowDemoWindow(&_show_tool_demo);
}
if (_show_about) {
if (ImGui::Begin("About", &_show_about, ImGuiWindowFlags_AlwaysAutoResize)) {
ImGuiTomatoAbout();
}
ImGui::End();
}
_compute_lower_limit_hit_rendered = true;
float tc_unfinished_queue_interval;

View File

@@ -117,6 +117,7 @@ struct MainScreen final : public Screen {
bool _show_tool_debug_log {false};
bool _show_tool_id_stack {false};
bool _show_tool_demo {false};
bool _show_about {false};
bool _window_focused {true};
bool _window_hidden {false};

View File

@@ -4,6 +4,8 @@
#include "./json_to_config.hpp"
#include "./chat_gui/about.hpp"
#include <nlohmann/json.hpp>
#include <imgui.h>
@@ -393,6 +395,12 @@ Screen* StartScreen::render(float, bool&) {
ImGui::EndTabItem();
}
if (ImGui::BeginTabItem("about")) {
ImGuiTomatoAbout();
ImGui::EndTabItem();
}
ImGui::EndTabBar();
}
}