mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-12 06:32:09 +00:00
791ff26697
Update Bonsai viewer headers to identify Bonsai and GPL licensing, add Bonsai Viewer documentation, and document debug output capture. Generated with the assistance of an AI coding tool.
73 lines
2.6 KiB
C++
73 lines
2.6 KiB
C++
// This file was generated with the assistance of an AI coding tool.
|
|
/********************************************************************************
|
|
* *
|
|
* This file is part of Bonsai. *
|
|
* *
|
|
* Bonsai is free software: you can redistribute it and/or modify *
|
|
* it under the terms of the GNU General Public License as published by *
|
|
* the Free Software Foundation, either version 3.0 of the License, or *
|
|
* (at your option) any later version. *
|
|
* *
|
|
* Bonsai is distributed in the hope that it will be useful, *
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
|
* GNU General Public License for more details. *
|
|
* *
|
|
* You should have received a copy of the GNU General Public License *
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
|
|
* *
|
|
********************************************************************************/
|
|
|
|
#ifndef IFCINTERFACE_INTERFACESETTINGS_H
|
|
#define IFCINTERFACE_INTERFACESETTINGS_H
|
|
|
|
#include <QObject>
|
|
#include <QString>
|
|
#include <vector>
|
|
|
|
namespace bonsaiviewer {
|
|
|
|
class ViewerSettings : public QObject {
|
|
Q_OBJECT
|
|
public:
|
|
enum class ThemeMode {
|
|
Dark = 0,
|
|
Light = 1,
|
|
Custom = 2,
|
|
};
|
|
Q_ENUM(ThemeMode)
|
|
|
|
struct ThemeColorSpec {
|
|
const char* key;
|
|
const char* label;
|
|
const char* dark_default;
|
|
const char* light_default;
|
|
};
|
|
|
|
static ViewerSettings& instance();
|
|
static const std::vector<ThemeColorSpec>& themeColorSpecs();
|
|
|
|
ThemeMode themeMode() const;
|
|
void setThemeMode(ThemeMode mode);
|
|
|
|
QString color(const QString& key) const;
|
|
QString customColor(const QString& key) const;
|
|
void setCustomColor(const QString& key, const QString& value);
|
|
|
|
signals:
|
|
void themeModeChanged(ThemeMode mode);
|
|
void themeChanged();
|
|
|
|
private:
|
|
ViewerSettings();
|
|
void load();
|
|
void persist() const;
|
|
|
|
ThemeMode theme_mode_ = ThemeMode::Dark;
|
|
std::vector<QString> custom_colors_;
|
|
};
|
|
|
|
} // namespace bonsaiviewer
|
|
|
|
#endif
|