3#include <ftxui/component/component.hpp>
4#include <ftxui/dom/elements.hpp>
9#include "absl/strings/str_format.h"
17 : rom_context_(rom_context) {
66 auto container = Container::Vertical({
73 return Renderer(container, [
this] {
75 text(
"📊 Status Panel") | bold | center,
91 return Renderer([
this] {
97 return Renderer([
this] {
103 return Renderer([
this] {
109 return Renderer([
this] {
115 if (event == Event::Character(
'e')) {
120 if (event == Event::Character(
'd')) {
131 text(
"🎮 ROM Information") | bold | color(Color::Red),
132 text(
"No ROM loaded") | color(Color::Red),
133 text(
"Load a ROM to see information") | dim
138 text(
"🎮 ROM Information") | bold | color(Color::Green),
139 text(absl::StrFormat(
"Title: %s",
rom_info_.
title)) | color(Color::White),
140 text(absl::StrFormat(
"Size: %s",
rom_info_.
size)) | color(Color::Cyan),
141 text(absl::StrFormat(
"Checksum: %s",
rom_info_.
checksum)) | color(Color::Yellow),
142 text(absl::StrFormat(
"Region: %s",
rom_info_.
region)) | color(Color::Magenta)
148 text(
"💻 System Information") | bold | color(Color::Blue),
158 text(
"🖥️ Layout Information") | bold | color(Color::Magenta),
169 text(
"✅ No Errors") | color(Color::Green)
174 text(
"⚠️ Error") | bold | color(Color::Red),
181 text(
"e: Expand | d: Details | q: Quit") | dim,
183 text(
expanded_ ?
"EXPANDED" :
"COLLAPSED") | color(Color::Cyan),
204 uint32_t checksum = 0;
215 switch (region_byte) {
227 auto now = std::chrono::system_clock::now();
228 auto time_t = std::chrono::system_clock::to_time_t(now);
229 auto tm = *std::localtime(&time_t);
231 std::stringstream ss;
232 ss << std::put_time(&tm,
"%H:%M:%S");
The Rom class is used to load, save, and modify Rom data.
std::function< bool(const ftxui::Event &)> status_event_handler_
ftxui::Component CreateStatusContainer()
ftxui::Element RenderLayoutInfo()
struct yaze::cli::EnhancedStatusPanel::LayoutInfo layout_info_
ftxui::Component error_section_
ftxui::Element RenderRomInfo()
std::string current_error_
bool HandleStatusEvents(const ftxui::Event &event)
ftxui::Component GetComponent()
ftxui::Component CreateSystemInfoSection()
void SetShowDetailedInfo(bool show)
ftxui::Component CreateLayoutInfoSection()
ftxui::Component system_info_section_
ftxui::Component rom_info_section_
ftxui::Component status_container_
ftxui::Component layout_info_section_
struct yaze::cli::EnhancedStatusPanel::SystemInfo system_info_
ftxui::Element RenderErrorInfo()
void SetError(const std::string &error)
ftxui::Component CreateErrorSection()
void SetExpanded(bool expanded)
ftxui::Component CreateRomInfoSection()
void SetRomContext(Rom *rom_context)
EnhancedStatusPanel(Rom *rom_context=nullptr)
ftxui::Element RenderStatusBar()
ftxui::Element RenderSystemInfo()
struct yaze::cli::EnhancedStatusPanel::RomInfo rom_info_
Main namespace for the application.