Files
sqlitebrowser/src/PreferencesDialog.h
mgrojo cc67969d73 Update preference colours when the application style is changed
In order to have matching colours in all the preferences, the individual
colour settings in Data Browser and SQL tabs are reset to default values
matching the corresponding style setting (dark stylesheet or follow desktop,
which could be dark or light as always).

Additionally, several problems with colour settings in QScintilla have
been fixed:
- We don't use indentation guides
- both sets of lexer colour settings must be used, otherwise the result is
inconsistant and unpredictable:
    * lexer->setDefaultColor|Paper and lexer->setColor|Paper
2019-02-28 00:02:47 +01:00

69 lines
1.5 KiB
C++

#ifndef PREFERENCESDIALOG_H
#define PREFERENCESDIALOG_H
#include <QDialog>
#include <QVariant>
#include <QHash>
class QTreeWidgetItem;
class QFrame;
class QSslCertificate;
class QAbstractButton;
namespace Ui {
class PreferencesDialog;
}
class PreferencesDialog : public QDialog
{
Q_OBJECT
public:
enum Tabs
{
TabGeneral,
TabDatabase,
TabDataBrowser,
TabSql,
TabExtensions,
TabRemote
};
explicit PreferencesDialog(QWidget* parent = nullptr, Tabs tab = TabGeneral);
~PreferencesDialog() override;
private slots:
void loadSettings();
void saveSettings();
void chooseLocation();
void showColourDialog(QTreeWidgetItem* item, int column);
void addExtension();
void removeExtension();
void activateRemoteTab(bool active);
void addClientCertificate();
void removeClientCertificate();
void chooseRemoteCloneDirectory();
void updatePreviewFont();
void adjustColorsToStyle(int style);
void on_buttonManageFileExtension_clicked();
void on_buttonBox_clicked(QAbstractButton* button);
private:
Ui::PreferencesDialog *ui;
QStringList m_dbFileExtensions;
void fillLanguageBox();
void loadColorSetting(QFrame *frame, const QString &name);
void setColorSetting(QFrame *frame, const QColor &color);
void saveColorSetting(QFrame *frame, const QString &name);
void addClientCertToTable(const QString& path, const QSslCertificate& cert);
protected:
bool eventFilter(QObject *obj, QEvent *event) override;
};
#endif