1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-22 04:53:52 +00:00
openmw/apps/opencs/model/prefs/coloursetting.hpp

50 lines
900 B
C++
Raw Normal View History

2015-12-11 10:15:14 +00:00
#ifndef CSM_PREFS_COLOURSETTING_H
#define CSM_PREFS_COLOURSETTING_H
#include "setting.hpp"
#include <QColor>
2022-10-19 17:02:00 +00:00
#include <string>
#include <string_view>
2022-10-19 17:02:00 +00:00
#include <utility>
class QMutex;
class QObject;
class QWidget;
namespace CSVWidget
{
class ColorEditor;
}
2015-12-11 10:15:14 +00:00
namespace CSMPrefs
{
2022-10-19 17:02:00 +00:00
class Category;
2023-11-11 23:52:09 +00:00
class ColourSetting final : public TypedSetting<std::string>
2015-12-11 10:15:14 +00:00
{
2022-09-22 18:26:05 +00:00
Q_OBJECT
2015-12-11 10:15:14 +00:00
2022-09-22 18:26:05 +00:00
std::string mTooltip;
CSVWidget::ColorEditor* mWidget;
2015-12-11 10:15:14 +00:00
2022-09-22 18:26:05 +00:00
public:
2023-11-11 23:52:09 +00:00
explicit ColourSetting(
Category* parent, QMutex* mutex, std::string_view key, const QString& label, Settings::Index& index);
2015-12-11 10:15:14 +00:00
2022-09-22 18:26:05 +00:00
ColourSetting& setTooltip(const std::string& tooltip);
2015-12-11 10:15:14 +00:00
2022-09-22 18:26:05 +00:00
/// Return label, input widget.
SettingWidgets makeWidgets(QWidget* parent) override;
2015-12-11 10:15:14 +00:00
2022-09-22 18:26:05 +00:00
void updateWidget() override;
2015-12-11 10:15:14 +00:00
2022-09-22 18:26:05 +00:00
private slots:
2022-09-22 18:26:05 +00:00
void valueChanged();
2015-12-11 10:15:14 +00:00
};
}
#endif