forked from qt-creator/qt-creator
Editor: add text style for diagnostic info
Fixes: QTCREATORBUG-32163 Change-Id: Ifc066c7845afa3374f97c278e4481d81bfcc67c2 Reviewed-by: Sami Shalayel <sami.shalayel@qt.io> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
@@ -68,6 +68,8 @@
|
||||
<style name="LogCommitHash" foreground="#ff0000"/>
|
||||
<style name="LogCommitSubject" foreground="#d6cf9a"/>
|
||||
<style name="LogDecoration" foreground="#ff00ff"/>
|
||||
<style name="Info" underlineColor="#b6aef1" underlineStyle="DashUnderline"/>
|
||||
<style name="InfoContext" underlineColor="#b6aef1" underlineStyle="Dotline"/>
|
||||
<style name="Warning" underlineColor="#d6c545" underlineStyle="SingleUnderline"/>
|
||||
<style name="WarningContext" underlineColor="#d6c545" underlineStyle="DotLine"/>
|
||||
<style name="Error" underlineColor="#d65645" underlineStyle="SingleUnderline"/>
|
||||
|
@@ -68,6 +68,8 @@
|
||||
<style name="LogCommitHash" foreground="#ff0000"/>
|
||||
<style name="LogCommitSubject" foreground="#d6cf9a"/>
|
||||
<style name="LogDecoration" foreground="#ff00ff"/>
|
||||
<style name="Info" underlineColor="#b6aef1" underlineStyle="DashUnderline"/>
|
||||
<style name="InfoContext" underlineColor="#b6aef1" underlineStyle="DotLine"/>
|
||||
<style name="Warning" underlineColor="#d6c545" underlineStyle="SingleUnderline"/>
|
||||
<style name="WarningContext" underlineColor="#d6c545" underlineStyle="DotLine"/>
|
||||
<style name="Error" underlineColor="#d65645" underlineStyle="SingleUnderline"/>
|
||||
|
@@ -70,4 +70,6 @@
|
||||
<style name="LogCommitHash" foreground="#ff0000"/>
|
||||
<style name="LogCommitSubject" foreground="#d6cf9a"/>
|
||||
<style name="LogDecoration" foreground="#ff00ff"/>
|
||||
<style name="Info" underlineColor="#b6aef1" underlineStyle="DashUnderline"/>
|
||||
<style name="InfoContext" underlineColor="#b6aef1" underlineStyle="DotLine"/>
|
||||
</style-scheme>
|
||||
|
@@ -59,6 +59,8 @@
|
||||
<style name="DiffDestLine" background="#dfffdf"/>
|
||||
<style name="DiffDestChar" background="#afffaf"/>
|
||||
<style name="LogChangeLine" foreground="#c00000"/>
|
||||
<style name="Info" underlineColor="#262088" underlineStyle="DashUnderline"/>
|
||||
<style name="InfoContext" underlineColor="#262088" underlineStyle="DotLine"/>
|
||||
<style name="Warning" underlineColor="#ffbe00" underlineStyle="SingleUnderline"/>
|
||||
<style name="WarningContext" underlineColor="#ffbe00" underlineStyle="DotLine"/>
|
||||
<style name="Error" underlineColor="#ff0000" underlineStyle="SingleUnderline"/>
|
||||
|
@@ -40,6 +40,8 @@
|
||||
<style name="Namespace"/>
|
||||
<style name="VirtualMethod" italic="true"/>
|
||||
<style name="Occurrences.Unused" underlineColor="#8F8F8F" underlineStyle="SingleUnderline"/>
|
||||
<style name="Info" underlineColor="#707070" underlineStyle="DashUnderline"/>
|
||||
<style name="InfoContext" underlineColor="#707070" underlineStyle="DotLine"/>
|
||||
<style name="Warning" underlineColor="#505050" underlineStyle="SingleUnderline"/>
|
||||
<style name="WarningContext" underlineColor="#505050" underlineStyle="DotLine"/>
|
||||
<style name="Error" underlineColor="#000000" underlineStyle="WaveUnderline"/>
|
||||
|
@@ -68,6 +68,8 @@
|
||||
<style name="LogCommitHash" foreground="#c06060"/>
|
||||
<style name="LogCommitSubject" foreground="#d6cf9a"/>
|
||||
<style name="LogDecoration" foreground="#c060c0"/>
|
||||
<style name="Info" underlineColor="#b6aef1" underlineStyle="DashUnderline"/>
|
||||
<style name="InfoContext" underlineColor="#b6aef1" underlineStyle="DotLine"/>
|
||||
<style name="Warning" underlineColor="#d6c545" underlineStyle="SingleUnderline"/>
|
||||
<style name="WarningContext" underlineColor="#d6c545" underlineStyle="DotLine"/>
|
||||
<style name="Error" underlineColor="#d65645" underlineStyle="SingleUnderline"/>
|
||||
|
@@ -74,6 +74,8 @@
|
||||
<style name="LogCommitHash" foreground="#ff0000"/>
|
||||
<style name="LogCommitSubject" foreground="#d6cf9a"/>
|
||||
<style name="LogDecoration" foreground="#ff00ff"/>
|
||||
<style name="Info" underlineColor="#268bd2" underlineStyle="DashUnderline"/>
|
||||
<style name="InfoContext" underlineColor="#268bd2" underlineStyle="DotLine"/>
|
||||
<style name="Warning" underlineColor="#b58900" underlineStyle="SingleUnderline"/>
|
||||
<style name="WarningContext" underlineColor="#b58900" underlineStyle="DotLine"/>
|
||||
<style name="Error" underlineColor="#dc322f" underlineStyle="SingleUnderline"/>
|
||||
|
@@ -71,6 +71,8 @@
|
||||
<style name="LogChangeLine" foreground="#c00000"/>
|
||||
<style name="Warning" underlineColor="#b58900" underlineStyle="SingleUnderline"/>
|
||||
<style name="WarningContext" underlineColor="#b58900" underlineStyle="DotLine"/>
|
||||
<style name="Info" underlineColor="#268bd2" underlineStyle="DashUnderline"/>
|
||||
<style name="InfoContext" underlineColor="#268bd2" underlineStyle="DotLine"/>
|
||||
<style name="Error" underlineColor="#dc322f" underlineStyle="SingleUnderline"/>
|
||||
<style name="ErrorContext" underlineColor="#dc322f" underlineStyle="DotLine"/>
|
||||
<style name="Declaration"/>
|
||||
|
@@ -269,6 +269,8 @@ QTextEdit::ExtraSelection DiagnosticManager::createDiagnosticSelection(
|
||||
style = C_ERROR;
|
||||
else if (severity == DiagnosticSeverity::Warning)
|
||||
style = C_WARNING;
|
||||
else if (severity == DiagnosticSeverity::Information)
|
||||
style = C_INFO;
|
||||
else
|
||||
return {};
|
||||
|
||||
|
@@ -93,6 +93,8 @@ const char *nameForStyle(TextStyle style)
|
||||
case C_ERROR_CONTEXT: return "ErrorContext";
|
||||
case C_WARNING: return "Warning";
|
||||
case C_WARNING_CONTEXT: return "WarningContext";
|
||||
case C_INFO: return "Info";
|
||||
case C_INFO_CONTEXT: return "InfoContext";
|
||||
|
||||
case C_DECLARATION: return "Declaration";
|
||||
case C_FUNCTION_DEFINITION: return "FunctionDefinition";
|
||||
|
@@ -88,6 +88,8 @@ enum TextStyle : quint8 {
|
||||
C_LOG_COMMIT_SUBJECT,
|
||||
C_LOG_DECORATION,
|
||||
|
||||
C_INFO,
|
||||
C_INFO_CONTEXT,
|
||||
C_WARNING,
|
||||
C_WARNING_CONTEXT,
|
||||
C_ERROR,
|
||||
|
@@ -346,6 +346,18 @@ FormatDescriptions TextEditorSettingsPrivate::initialFormats()
|
||||
QColor(255, 190, 0),
|
||||
QTextCharFormat::DotLine,
|
||||
FormatDescription::ShowAllControls);
|
||||
formatDescr.emplace_back(C_INFO,
|
||||
Tr::tr("Info"),
|
||||
Tr::tr("Underline color of info diagnostics."),
|
||||
QColor(38, 32, 136),
|
||||
QTextCharFormat::DashUnderline,
|
||||
FormatDescription::ShowAllControls);
|
||||
formatDescr.emplace_back(C_INFO_CONTEXT,
|
||||
Tr::tr("Info Context"),
|
||||
Tr::tr("Underline color of the contexts of info diagnostics."),
|
||||
QColor(38, 32, 136),
|
||||
QTextCharFormat::DotLine,
|
||||
FormatDescription::ShowAllControls);
|
||||
Format outputArgumentFormat;
|
||||
outputArgumentFormat.setItalic(true);
|
||||
formatDescr.emplace_back(C_OUTPUT_ARGUMENT,
|
||||
|
Reference in New Issue
Block a user