Files
sqlitebrowser/src/PreferencesDialog.h
mgrojo 379bbb81a2 Support for dark themes in default settings and restore defaults button
All the colour configurations have been reviewed under an operating-system theme
dark theme.

Some hard-coded colours in QScintilla editors and Data Browser have been
replaced by queries of the system palette or reuse of our settings.

New settings for foreground and background colours for QScintilla editors
defaulting to system colours. This is mainly needed because if the user
saves colour settings for a dark theme and then he changes the system theme
back to a light theme, then the foreground colours are preserved while the
background would fall back to the system theme leading to an incompatible
combination. This also gives more freedom to the user in defining his own
colour combinations.

Since only the default colour settings adapt to the system theme, and once
settings are saved this can no longer happen, a 'Restore Defaults' button
is added so the default adapted colour settings can be restored. This is
also useful for restoring default behaviour when wanted.

Other fixes and improvements: waiting cursor while saving; check boxes in
SQL tab for bold, italic and underline when applicable; avoid translation
of hidden colour setting names used in code.

See related issue #1324.
2018-02-25 19:13:28 +01:00

59 lines
1.4 KiB
C++

#ifndef PREFERENCESDIALOG_H
#define PREFERENCESDIALOG_H
#include <QDialog>
#include <QVariant>
#include <QHash>
class QTreeWidgetItem;
class QFrame;
class QTableWidget;
class QSslCertificate;
class QAbstractButton;
namespace Ui {
class PreferencesDialog;
}
class PreferencesDialog : public QDialog
{
Q_OBJECT
public:
explicit PreferencesDialog(QWidget* parent = nullptr);
~PreferencesDialog();
private slots:
virtual void loadSettings();
virtual void saveSettings();
virtual void chooseLocation();
virtual void showColourDialog(QTreeWidgetItem* item, int column);
virtual void addExtension();
virtual void removeExtension();
virtual void activateRemoteTab(bool active);
virtual void addClientCertificate();
virtual void removeClientCertificate();
void chooseRemoteCloneDirectory();
void updatePreviewFont();
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);
};
#endif