mirror of
https://github.com/m1ngsama/TUT.git
synced 2026-02-08 00:54:05 +00:00
Major architectural refactoring from ncurses to FTXUI framework with professional engineering structure. Project Structure: - src/core/: Browser engine, URL parser, HTTP client - src/ui/: FTXUI components (main window, address bar, content view, panels) - src/renderer/: HTML renderer, text formatter, style parser - src/utils/: Logger, config manager, theme manager - tests/unit/: Unit tests for core components - tests/integration/: Integration tests - assets/: Default configs, themes, keybindings New Features: - btop-style four-panel layout with rounded borders - TOML-based configuration system - Multiple color themes (default, nord, gruvbox, solarized) - Comprehensive logging system - Modular architecture with clear separation of concerns Build System: - Updated CMakeLists.txt for modular build - Prefer system packages (Homebrew) over FetchContent - Google Test integration for testing - Version info generation via cmake/version.hpp.in Configuration: - Default config.toml with browser settings - Four built-in themes - Default keybindings configuration - Config stored in ~/.config/tut/ Removed: - Legacy v1 source files (ncurses-based) - Old render/ directory - Duplicate and obsolete test files - Old documentation files Binary: ~827KB (well under 5MB goal) Dependencies: FTXUI, cpp-httplib, toml11, gumbo-parser, OpenSSL
74 lines
1.1 KiB
C++
74 lines
1.1 KiB
C++
/**
|
|
* @file status_bar.hpp
|
|
* @brief 状态栏组件
|
|
* @author m1ngsama
|
|
* @date 2024-12-29
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <string>
|
|
#include <memory>
|
|
|
|
namespace tut {
|
|
|
|
/**
|
|
* @brief 加载状态
|
|
*/
|
|
struct LoadingStatus {
|
|
bool is_loading{false};
|
|
size_t bytes_downloaded{0};
|
|
size_t bytes_total{0};
|
|
double elapsed_time{0.0};
|
|
int link_count{0};
|
|
};
|
|
|
|
/**
|
|
* @brief 状态栏组件类
|
|
*/
|
|
class StatusBar {
|
|
public:
|
|
StatusBar();
|
|
~StatusBar();
|
|
|
|
/**
|
|
* @brief 设置消息
|
|
*/
|
|
void setMessage(const std::string& message);
|
|
|
|
/**
|
|
* @brief 获取消息
|
|
*/
|
|
std::string getMessage() const;
|
|
|
|
/**
|
|
* @brief 设置加载状态
|
|
*/
|
|
void setLoadingStatus(const LoadingStatus& status);
|
|
|
|
/**
|
|
* @brief 获取加载状态
|
|
*/
|
|
LoadingStatus getLoadingStatus() const;
|
|
|
|
/**
|
|
* @brief 显示错误信息
|
|
*/
|
|
void showError(const std::string& error);
|
|
|
|
/**
|
|
* @brief 显示成功信息
|
|
*/
|
|
void showSuccess(const std::string& message);
|
|
|
|
/**
|
|
* @brief 清除消息
|
|
*/
|
|
void clear();
|
|
|
|
private:
|
|
class Impl;
|
|
std::unique_ptr<Impl> impl_;
|
|
};
|
|
|
|
} // namespace tut
|