Duckstation/src/duckstation-qt/postprocessingchainconfigwidget.h

53 lines
1.3 KiB
C
Raw Normal View History

2020-09-12 15:20:02 +00:00
#pragma once
#include "common/types.h"
#include "ui_postprocessingchainconfigwidget.h"
#include "frontend-common/postprocessing_chain.h"
#include <QtWidgets/QWidget>
#include <optional>
#include <memory>
#include <string_view>
namespace FrontendCommon {
class PostProcessingChain;
}
class PostProcessingChainConfigWidget : public QWidget
{
Q_OBJECT
public:
PostProcessingChainConfigWidget(QWidget* parent);
~PostProcessingChainConfigWidget();
ALWAYS_INLINE FrontendCommon::PostProcessingChain& getChain() { return m_chain; }
2020-09-12 15:20:02 +00:00
bool setConfigString(const std::string_view& config_string);
void setOptionsButtonVisible(bool visible);
2020-09-12 15:20:02 +00:00
Q_SIGNALS:
void selectedShaderChanged(qint32 index);
void chainAboutToChange();
2020-09-12 15:20:02 +00:00
void chainConfigStringChanged(const std::string& new_config_string);
private Q_SLOTS:
void onAddButtonClicked();
void onRemoveButtonClicked();
void onClearButtonClicked();
void onMoveUpButtonClicked();
void onMoveDownButtonClicked();
void onShaderConfigButtonClicked();
void onReloadButtonClicked();
void onSelectedShaderChanged();
2020-09-12 15:20:02 +00:00
private:
void connectUi();
std::optional<u32> getSelectedIndex() const;
void updateList();
void configChanged();
void updateButtonStates(std::optional<u32> index);
2020-09-12 15:20:02 +00:00
Ui::PostProcessingChainConfigWidget m_ui;
FrontendCommon::PostProcessingChain m_chain;
};