style refactor
This commit is contained in:
+18
-18
@@ -5,13 +5,13 @@
|
||||
#include <iostream>
|
||||
#include <unordered_map>
|
||||
|
||||
SerialApp::SerialApp() : should_close(false) {}
|
||||
SerialApp::SerialApp() : shouldClose(false) {}
|
||||
|
||||
void SerialApp::Initialize() {
|
||||
connection_window.Initialize();
|
||||
void SerialApp::initialize() {
|
||||
connectionWindow.initialize();
|
||||
|
||||
// Загружаем тему при старте. Если лежит в корне сборки — просто имя файла.
|
||||
if (!LoadTheme("dracula.theme")) {
|
||||
if (!loadTheme("dracula.theme")) {
|
||||
// Если файла нет, оставляем стандартную тему ImGui, чтобы приложение не упало
|
||||
ImGui::StyleColorsDark();
|
||||
}
|
||||
@@ -31,7 +31,7 @@ static ImVec4 HexToImVec4(const std::string& hex_str) {
|
||||
return ImVec4(r / 255.0f, g / 255.0f, b / 255.0f, a / 255.0f);
|
||||
}
|
||||
|
||||
bool SerialApp::LoadTheme(const std::string& filepath) {
|
||||
bool SerialApp::loadTheme(const std::string& filepath) {
|
||||
std::ifstream file(filepath);
|
||||
if (!file.is_open()) {
|
||||
std::cerr << "[THEME ERROR] Файл темы не найден: " << filepath << std::endl;
|
||||
@@ -100,33 +100,33 @@ bool SerialApp::LoadTheme(const std::string& filepath) {
|
||||
return true;
|
||||
}
|
||||
|
||||
void SerialApp::RenderUI() {
|
||||
RenderMainMenuBar();
|
||||
void SerialApp::renderUI() {
|
||||
renderMainMenuBar();
|
||||
|
||||
if (show_connection_window) {
|
||||
connection_window.Render(&show_connection_window);
|
||||
if (showConnectionWindow) {
|
||||
connectionWindow.render(&showConnectionWindow);
|
||||
}
|
||||
if (show_payload_window) {
|
||||
payload_window.Render(&show_payload_window, connection_window);
|
||||
if (showPayloadWindow) {
|
||||
payloadWindow.render(&showPayloadWindow, connectionWindow);
|
||||
}
|
||||
if (show_log_window) {
|
||||
log_window.Render(&show_log_window, connection_window);
|
||||
if (showLogWindow) {
|
||||
logWindow.render(&showLogWindow, connectionWindow);
|
||||
}
|
||||
}
|
||||
|
||||
void SerialApp::RenderMainMenuBar() {
|
||||
void SerialApp::renderMainMenuBar() {
|
||||
if (ImGui::BeginMainMenuBar()) {
|
||||
if (ImGui::BeginMenu("File")) {
|
||||
if (ImGui::MenuItem("Exit", "Alt+F4")) {
|
||||
should_close = true;
|
||||
shouldClose = true;
|
||||
}
|
||||
ImGui::EndMenu();
|
||||
}
|
||||
|
||||
if (ImGui::BeginMenu("Windows")) {
|
||||
ImGui::MenuItem("1. Connection Settings", nullptr, &show_connection_window);
|
||||
ImGui::MenuItem("2. Raw Payload Terminal", nullptr, &show_payload_window);
|
||||
ImGui::MenuItem("3. Transaction Log", nullptr, &show_log_window);
|
||||
ImGui::MenuItem("1. Connection Settings", nullptr, &showConnectionWindow);
|
||||
ImGui::MenuItem("2. Raw Payload Terminal", nullptr, &showPayloadWindow);
|
||||
ImGui::MenuItem("3. Transaction Log", nullptr, &showLogWindow);
|
||||
ImGui::EndMenu();
|
||||
}
|
||||
ImGui::EndMainMenuBar();
|
||||
|
||||
Reference in New Issue
Block a user