aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/texteditor/fontsettingspage.h
diff options
context:
space:
mode:
authorMarco Bubke <marco.bubke@theqtcompany.com>2015-09-21 13:12:36 +0200
committerDavid Schulz <david.schulz@theqtcompany.com>2015-10-19 13:10:44 +0000
commit51ed0da5a97b562ee2fe664bc3d4316f7ee65385 (patch)
tree8aefc4add82b4afbe145ee1bd35ffc90cbef4119 /src/plugins/texteditor/fontsettingspage.h
parentb8ae9fd46d2c02e2b4901abf140ac106e35bdf51 (diff)
TextEditor: Add fine control over the color scheme settings
You have seen always all setting but some settings had no meaning because only the foreground color is used. Now you can disable this settings so it is more clear what you can change. Change-Id: I0fdd2ac6f40e27b5160a2c54a512289457674dae Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
Diffstat (limited to 'src/plugins/texteditor/fontsettingspage.h')
-rw-r--r--src/plugins/texteditor/fontsettingspage.h29
1 files changed, 25 insertions, 4 deletions
diff --git a/src/plugins/texteditor/fontsettingspage.h b/src/plugins/texteditor/fontsettingspage.h
index 1f0df39ef8..7ab4771db1 100644
--- a/src/plugins/texteditor/fontsettingspage.h
+++ b/src/plugins/texteditor/fontsettingspage.h
@@ -57,19 +57,37 @@ namespace Internal { class FontSettingsPagePrivate; }
class TEXTEDITOR_EXPORT FormatDescription
{
public:
+ enum ShowControls {
+ ShowForegroundControl = 0x1,
+ ShowBackgroundControl = 0x2,
+ ShowFontControls = 0x4,
+ ShowUnderlineControl = 0x8,
+ AllControls = 0xF,
+ AllControlsExceptUnderline = AllControls & ~ShowUnderlineControl,
+ };
+ FormatDescription() = default;
+
+ FormatDescription(TextStyle id,
+ const QString &displayName,
+ const QString &tooltipText,
+ ShowControls showControls = AllControls);
+
FormatDescription(TextStyle id,
const QString &displayName,
const QString &tooltipText,
- const QColor &foreground = Qt::black);
+ const QColor &foreground,
+ ShowControls showControls = AllControls);
FormatDescription(TextStyle id,
const QString &displayName,
const QString &tooltipText,
- const Format &format);
+ const Format &format,
+ ShowControls showControls = AllControls);
FormatDescription(TextStyle id,
const QString &displayName,
const QString &tooltipText,
const QColor &underlineColor,
- const QTextCharFormat::UnderlineStyle underlineStyle);
+ const QTextCharFormat::UnderlineStyle underlineStyle,
+ ShowControls showControls = AllControls);
TextStyle id() const { return m_id; }
@@ -85,14 +103,17 @@ public:
QString tooltipText() const
{ return m_tooltipText; }
+ bool showControl(ShowControls showControl) const;
+
private:
TextStyle m_id; // Name of the category
Format m_format; // Default format
QString m_displayName; // Displayed name of the category
QString m_tooltipText; // Description text for category
+ ShowControls m_showControls = AllControls;
};
-typedef QList<FormatDescription> FormatDescriptions;
+typedef std::vector<FormatDescription> FormatDescriptions;
class TEXTEDITOR_EXPORT FontSettingsPage : public TextEditorOptionsPage
{