mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-21 19:41:19 -06:00
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.
50 lines
1.3 KiB
C++
50 lines
1.3 KiB
C++
#ifndef EXTENDEDSCINTILLA_H
|
|
#define EXTENDEDSCINTILLA_H
|
|
|
|
#include "Qsci/qsciscintilla.h"
|
|
|
|
class FindReplaceDialog;
|
|
|
|
/**
|
|
* @brief The ExtendedScintilla class
|
|
* This class extends the QScintilla widget for the application
|
|
*/
|
|
class ExtendedScintilla : public QsciScintilla
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit ExtendedScintilla(QWidget *parent = nullptr);
|
|
virtual ~ExtendedScintilla();
|
|
|
|
bool findText(QString text, bool regexp, bool caseSensitive, bool words, bool wrap, bool forward);
|
|
void clearSelection();
|
|
// Override parent setLexer
|
|
void setLexer(QsciLexer *lexer);
|
|
|
|
public slots:
|
|
void reloadKeywords();
|
|
void reloadSettings();
|
|
void clearErrorIndicators();
|
|
void setErrorIndicator(int fromRow, int fromIndex, int toRow, int toIndex);
|
|
// Set error indicator from position to end of line
|
|
void setErrorIndicator(int position);
|
|
void openFindReplaceDialog();
|
|
|
|
protected:
|
|
void dropEvent(QDropEvent* e);
|
|
|
|
void setupSyntaxHighlightingFormat(QsciLexer *lexer, const QString& settings_name, int style);
|
|
void reloadLexerSettings(QsciLexer *lexer);
|
|
|
|
int errorIndicatorNumber;
|
|
bool showErrorIndicators;
|
|
FindReplaceDialog* findReplaceDialog;
|
|
|
|
private slots:
|
|
void updateLineNumberAreaWidth();
|
|
void showContextMenu(const QPoint &pos);
|
|
};
|
|
|
|
#endif
|