XPlor/app/splashscreen.h
njohnson c041f25448 Add settings manager and splash screen
- Settings singleton for app-wide preferences (theme, recent files)
- Theme support with accent colors and dark/light modes
- Splash screen with custom painting, progress bar, theme colors
- Wait-for-interaction option for splash screen

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-08 00:35:31 -05:00

51 lines
1.1 KiB
C++

#ifndef SPLASHSCREEN_H
#define SPLASHSCREEN_H
#include <QSplashScreen>
#include <QLabel>
#include <QProgressBar>
#include <QColor>
#include <QMouseEvent>
#include <QKeyEvent>
class SplashScreen : public QSplashScreen
{
Q_OBJECT
public:
explicit SplashScreen(QWidget *parent = nullptr);
void setStatus(const QString &message);
void setProgress(int value, int max = 100);
void setWaitForInteraction(bool wait);
void finish(QWidget *mainWindow);
protected:
void drawContents(QPainter *painter) override;
void mousePressEvent(QMouseEvent *event) override;
void keyPressEvent(QKeyEvent *event) override;
private:
void loadThemeColors();
QString mStatus;
int mProgress = 0;
int mProgressMax = 100;
bool mWaitForInteraction = false;
bool mInteractionReceived = false;
QWidget *mPendingMainWindow = nullptr;
// Theme colors
QColor mPrimaryColor;
QColor mBgColor;
QColor mPanelColor;
QColor mTextColor;
QColor mTextColorMuted;
QColor mBorderColor;
static constexpr int WIDTH = 480;
static constexpr int HEIGHT = 300;
};
#endif // SPLASHSCREEN_H