Skip to content

Commit

Permalink
Qt: Add config window controls
Browse files Browse the repository at this point in the history
  • Loading branch information
jonian committed Dec 1, 2024
1 parent c2b4798 commit 0e3f8d2
Show file tree
Hide file tree
Showing 10 changed files with 395 additions and 11 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -695,6 +695,8 @@ if(NOT BUILD_HYDRA_CORE AND NOT BUILD_LIBRETRO_CORE)
PREFIX "/"
FILES
docs/img/rsob_icon.png docs/img/rstarstruck_icon.png docs/img/rpog_icon.png docs/img/rsyn_icon.png
docs/img/settings_icon.png docs/img/display_icon.png docs/img/speaker_icon.png
docs/img/sparkling_icon.png docs/img/battery_icon.png docs/img/sdcard_icon.png
)
else()
set(FRONTEND_SOURCE_FILES src/panda_sdl/main.cpp src/panda_sdl/frontend_sdl.cpp src/panda_sdl/mappings.cpp)
Expand Down
Binary file added docs/img/battery_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/display_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/sdcard_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/settings_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/sparkling_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/speaker_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 22 additions & 4 deletions include/panda_qt/config_window.hpp
Original file line number Diff line number Diff line change
@@ -1,16 +1,25 @@
#pragma once

#include <QApplication>
#include <QCheckBox>
#include <QComboBox>
#include <QDialog>
#include <QListWidget>
#include <QPalette>
#include <QStackedWidget>
#include <QTextEdit>
#include <QWidget>
#include <QtWidgets>
#include <array>
#include <functional>
#include <utility>

#include "emulator.hpp"

class ConfigWindow : public QDialog {
Q_OBJECT

private:
private:
enum class Theme : int {
System = 0,
Light = 1,
Expand All @@ -20,11 +29,20 @@ class ConfigWindow : public QDialog {
};

Theme currentTheme;
QComboBox* themeSelect = nullptr;
QTextEdit* helpText = nullptr;
QListWidget* widgetList = nullptr;
QStackedWidget* widgetContainer = nullptr;

static constexpr size_t settingWidgetCount = 6;
std::array<QString, settingWidgetCount> helpTexts;

void addWidget(QWidget* widget, QString title, QString icon, QString helpText);
void setTheme(Theme theme);

public:
ConfigWindow(QWidget* parent = nullptr);
public:
ConfigWindow(Emulator* emu, QWidget* parent = nullptr);
~ConfigWindow();

private:
Emulator* emu;
};
Loading

0 comments on commit 0e3f8d2

Please sign in to comment.