diff options
-rw-r--r-- | share/qtcreator/styles/creator-dark.xml | 5 | ||||
-rw-r--r-- | share/qtcreator/styles/dark.xml | 5 | ||||
-rw-r--r-- | share/qtcreator/styles/inkpot.xml | 5 | ||||
-rw-r--r-- | share/qtcreator/styles/modnokai_night_shift_v2.xml | 6 | ||||
-rw-r--r-- | share/qtcreator/styles/solarized-dark.xml | 5 | ||||
-rw-r--r-- | share/qtcreator/themes/dark.creatortheme | 6 | ||||
-rw-r--r-- | share/qtcreator/themes/default.creatortheme | 6 | ||||
-rw-r--r-- | share/qtcreator/themes/design.creatortheme | 6 | ||||
-rw-r--r-- | share/qtcreator/themes/flat-dark.creatortheme | 6 | ||||
-rw-r--r-- | share/qtcreator/themes/flat-light.creatortheme | 6 | ||||
-rw-r--r-- | share/qtcreator/themes/flat.creatortheme | 6 | ||||
-rw-r--r-- | src/libs/utils/theme/theme.h | 7 | ||||
-rw-r--r-- | src/plugins/git/gitclient.cpp | 35 | ||||
-rw-r--r-- | src/plugins/texteditor/colorscheme.h | 2 | ||||
-rw-r--r-- | src/plugins/texteditor/texteditorconstants.cpp | 5 | ||||
-rw-r--r-- | src/plugins/texteditor/texteditorconstants.h | 5 | ||||
-rw-r--r-- | src/plugins/texteditor/texteditorsettings.cpp | 16 |
17 files changed, 74 insertions, 58 deletions
diff --git a/share/qtcreator/styles/creator-dark.xml b/share/qtcreator/styles/creator-dark.xml index bff4b21bd4..d5bd74a7fb 100644 --- a/share/qtcreator/styles/creator-dark.xml +++ b/share/qtcreator/styles/creator-dark.xml @@ -57,6 +57,11 @@ <style name="DiffDestLine" background="#588a2c"/> <style name="DiffDestChar" foreground="#2e2f30" background="#7cc33e"/> <style name="LogChangeLine" foreground="#d65645"/> + <style name="LogAuthorName" foreground="#ceffe5"/> + <style name="LogCommitDate" foreground="#00ff00"/> + <style name="LogCommitHash" foreground="#ff0000"/> + <style name="LogCommitSubject" foreground="#d6cf9a"/> + <style name="LogDecoration" foreground="#ff00ff"/> <style name="Warning" underlineColor="#d6c545" underlineStyle="SingleUnderline"/> <style name="WarningContext" underlineColor="#d6c545" underlineStyle="DotLine"/> <style name="Error" underlineColor="#d65645" underlineStyle="SingleUnderline"/> diff --git a/share/qtcreator/styles/dark.xml b/share/qtcreator/styles/dark.xml index 8346148704..86aedfa433 100644 --- a/share/qtcreator/styles/dark.xml +++ b/share/qtcreator/styles/dark.xml @@ -58,4 +58,9 @@ <style name="DiffDestLine" background="#2d8c2d"/> <style name="DiffDestChar" foreground="#000000" background="#41c341"/> <style name="LogChangeLine" foreground="#808000"/> + <style name="LogAuthorName" foreground="#ceffe5"/> + <style name="LogCommitDate" foreground="#00ff00"/> + <style name="LogCommitHash" foreground="#ff0000"/> + <style name="LogCommitSubject" foreground="#d6cf9a"/> + <style name="LogDecoration" foreground="#ff00ff"/> </style-scheme> diff --git a/share/qtcreator/styles/inkpot.xml b/share/qtcreator/styles/inkpot.xml index 6b48562215..252052bb1d 100644 --- a/share/qtcreator/styles/inkpot.xml +++ b/share/qtcreator/styles/inkpot.xml @@ -66,5 +66,10 @@ <style name="DiffDestLine" background="#277027"/> <style name="DiffDestChar" background="#339d33"/> <style name="LogChangeLine" foreground="#dcdc00"/> + <style name="LogAuthorName" foreground="#ceffe5"/> + <style name="LogCommitDate" foreground="#00ff00"/> + <style name="LogCommitHash" foreground="#ff0000"/> + <style name="LogCommitSubject" foreground="#d6cf9a"/> + <style name="LogDecoration" foreground="#ff00ff"/> </style-scheme> diff --git a/share/qtcreator/styles/modnokai_night_shift_v2.xml b/share/qtcreator/styles/modnokai_night_shift_v2.xml index 002a5a4e2c..f585658313 100644 --- a/share/qtcreator/styles/modnokai_night_shift_v2.xml +++ b/share/qtcreator/styles/modnokai_night_shift_v2.xml @@ -62,5 +62,11 @@ <style name="DiffSourceChar" foreground="#000000" background="#c34141"/> <style name="DiffDestLine" background="#2d8c2d"/> <style name="DiffDestChar" foreground="#000000" background="#41c341"/> + <style name="LogChangeLine" foreground="#dcdc00"/> + <style name="LogAuthorName" foreground="#ceffe5"/> + <style name="LogCommitDate" foreground="#00ff00"/> + <style name="LogCommitHash" foreground="#ff0000"/> + <style name="LogCommitSubject" foreground="#d6cf9a"/> + <style name="LogDecoration" foreground="#ff00ff"/> <style name="Declaration"/> </style-scheme> diff --git a/share/qtcreator/styles/solarized-dark.xml b/share/qtcreator/styles/solarized-dark.xml index 2fa0d56924..ee51df82ba 100644 --- a/share/qtcreator/styles/solarized-dark.xml +++ b/share/qtcreator/styles/solarized-dark.xml @@ -63,6 +63,11 @@ <style name="DiffDestLine" background="#dfffdf"/> <style name="DiffDestChar" background="#afffaf"/> <style name="LogChangeLine" foreground="#c00000"/> + <style name="LogAuthorName" foreground="#ceffe5"/> + <style name="LogCommitDate" foreground="#00ff00"/> + <style name="LogCommitHash" foreground="#ff0000"/> + <style name="LogCommitSubject" foreground="#d6cf9a"/> + <style name="LogDecoration" foreground="#ff00ff"/> <style name="Warning" underlineColor="#b58900" underlineStyle="SingleUnderline"/> <style name="WarningContext" underlineColor="#b58900" underlineStyle="DotLine"/> <style name="Error" underlineColor="#dc322f" underlineStyle="SingleUnderline"/> diff --git a/share/qtcreator/themes/dark.creatortheme b/share/qtcreator/themes/dark.creatortheme index 58f1d1d4cb..fa4a6ab330 100644 --- a/share/qtcreator/themes/dark.creatortheme +++ b/share/qtcreator/themes/dark.creatortheme @@ -223,12 +223,6 @@ VcsBase_FileDeleted_TextColor=ffff6c6c VcsBase_FileRenamed_TextColor=ffffa500 VcsBase_FileUnmerged_TextColor=ffff4040 -Git_AuthorName_TextColor=ceffe5 -Git_CommitDate_TextColor=00ff00 -Git_CommitHash_TextColor=ff0000 -Git_CommitSubject_TextColor=text -Git_Decoration_TextColor=ff00ff - Bookmarks_TextMarkColor=ff8080ff TextEditor_SearchResult_ScrollBarColor=ff00c000 diff --git a/share/qtcreator/themes/default.creatortheme b/share/qtcreator/themes/default.creatortheme index 49df633ca3..8686733ab4 100644 --- a/share/qtcreator/themes/default.creatortheme +++ b/share/qtcreator/themes/default.creatortheme @@ -214,12 +214,6 @@ VcsBase_FileDeleted_TextColor=ff800000 VcsBase_FileRenamed_TextColor=ffd77d00 VcsBase_FileUnmerged_TextColor=ffee0000 -Git_AuthorName_TextColor=007af4 -Git_CommitDate_TextColor=006600 -Git_CommitHash_TextColor=ff0000 -Git_CommitSubject_TextColor=text -Git_Decoration_TextColor=ff00ff - Bookmarks_TextMarkColor=ffa0a0ff TextEditor_SearchResult_ScrollBarColor=ff00c000 diff --git a/share/qtcreator/themes/design.creatortheme b/share/qtcreator/themes/design.creatortheme index 1f053a3091..914a717bdf 100644 --- a/share/qtcreator/themes/design.creatortheme +++ b/share/qtcreator/themes/design.creatortheme @@ -227,12 +227,6 @@ VcsBase_FileDeleted_TextColor=fffff6c6c VcsBase_FileRenamed_TextColor=ffffa500 VcsBase_FileUnmerged_TextColor=ffff4040 -Git_AuthorName_TextColor=ceffe5 -Git_CommitDate_TextColor=00ff00 -Git_CommitHash_TextColor=ff4343 -Git_CommitSubject_TextColor=text -Git_Decoration_TextColor=ff00ff - Bookmarks_TextMarkColor=ff8080ff TextEditor_SearchResult_ScrollBarColor=ff00c000 diff --git a/share/qtcreator/themes/flat-dark.creatortheme b/share/qtcreator/themes/flat-dark.creatortheme index 985f8827aa..1df02cd463 100644 --- a/share/qtcreator/themes/flat-dark.creatortheme +++ b/share/qtcreator/themes/flat-dark.creatortheme @@ -227,12 +227,6 @@ VcsBase_FileDeleted_TextColor=fffff6c6c VcsBase_FileRenamed_TextColor=ffffa500 VcsBase_FileUnmerged_TextColor=ffff4040 -Git_AuthorName_TextColor=ceffe5 -Git_CommitDate_TextColor=00ff00 -Git_CommitHash_TextColor=ff4343 -Git_CommitSubject_TextColor=text -Git_Decoration_TextColor=ff00ff - Bookmarks_TextMarkColor=ff8080ff TextEditor_SearchResult_ScrollBarColor=ff00c000 diff --git a/share/qtcreator/themes/flat-light.creatortheme b/share/qtcreator/themes/flat-light.creatortheme index 4fd823c976..b8b4e7eabd 100644 --- a/share/qtcreator/themes/flat-light.creatortheme +++ b/share/qtcreator/themes/flat-light.creatortheme @@ -223,12 +223,6 @@ VcsBase_FileDeleted_TextColor=ff800000 VcsBase_FileRenamed_TextColor=ffd77d00 VcsBase_FileUnmerged_TextColor=ffee0000 -Git_AuthorName_TextColor=007af4 -Git_CommitDate_TextColor=006600 -Git_CommitHash_TextColor=ff0000 -Git_CommitSubject_TextColor=text -Git_Decoration_TextColor=ff00ff - Bookmarks_TextMarkColor=ffa0a0ff TextEditor_SearchResult_ScrollBarColor=ff00c000 diff --git a/share/qtcreator/themes/flat.creatortheme b/share/qtcreator/themes/flat.creatortheme index 27de98e08a..e80a8d85f1 100644 --- a/share/qtcreator/themes/flat.creatortheme +++ b/share/qtcreator/themes/flat.creatortheme @@ -221,12 +221,6 @@ VcsBase_FileDeleted_TextColor=ff800000 VcsBase_FileRenamed_TextColor=ffd77d00 VcsBase_FileUnmerged_TextColor=ffee0000 -Git_AuthorName_TextColor=007af4 -Git_CommitDate_TextColor=006600 -Git_CommitHash_TextColor=ff0000 -Git_CommitSubject_TextColor=text -Git_Decoration_TextColor=ff00ff - Bookmarks_TextMarkColor=ffa0a0ff TextEditor_SearchResult_ScrollBarColor=ff00c000 diff --git a/src/libs/utils/theme/theme.h b/src/libs/utils/theme/theme.h index 8abf2d3992..e0f6e9cdb9 100644 --- a/src/libs/utils/theme/theme.h +++ b/src/libs/utils/theme/theme.h @@ -279,13 +279,6 @@ public: VcsBase_FileRenamed_TextColor, VcsBase_FileUnmerged_TextColor, - /* Git Plugin */ - Git_AuthorName_TextColor, - Git_CommitDate_TextColor, - Git_CommitHash_TextColor, - Git_CommitSubject_TextColor, - Git_Decoration_TextColor, - /* Bookmarks Plugin */ Bookmarks_TextMarkColor, diff --git a/src/plugins/git/gitclient.cpp b/src/plugins/git/gitclient.cpp index 16337bf5b6..253b9d7473 100644 --- a/src/plugins/git/gitclient.cpp +++ b/src/plugins/git/gitclient.cpp @@ -570,6 +570,17 @@ static bool gitHasRgbColors() return gitVersion >= 0x020300U; } +static QString logColorName(TextEditor::TextStyle style) +{ + using namespace TextEditor; + + const ColorScheme &scheme = TextEditorSettings::fontSettings().colorScheme(); + QColor color = scheme.formatFor(style).foreground(); + if (!color.isValid()) + color = scheme.formatFor(C_TEXT).foreground(); + return color.name(); +}; + class GitLogArgumentsWidget : public BaseGitLogArgumentsWidget { Q_OBJECT @@ -603,12 +614,11 @@ public: QStringList graphArguments() const { - auto colorName = [](Theme::Color color) { return creatorTheme()->color(color).name(); }; - const QString authorName = colorName(Theme::Git_AuthorName_TextColor); - const QString commitDate = colorName(Theme::Git_CommitDate_TextColor); - const QString commitHash = colorName(Theme::Git_CommitHash_TextColor); - const QString commitSubject = colorName(Theme::Git_CommitSubject_TextColor); - const QString decoration = colorName(Theme::Git_Decoration_TextColor); + const QString authorName = logColorName(TextEditor::C_LOG_AUTHOR_NAME); + const QString commitDate = logColorName(TextEditor::C_LOG_COMMIT_DATE); + const QString commitHash = logColorName(TextEditor::C_LOG_COMMIT_HASH); + const QString commitSubject = logColorName(TextEditor::C_LOG_COMMIT_SUBJECT); + const QString decoration = logColorName(TextEditor::C_LOG_DECORATION); const QString formatArg = QStringLiteral( "--pretty=format:" @@ -1051,19 +1061,18 @@ static QStringList normalLogArguments() if (!gitHasRgbColors()) return {}; - auto colorName = [](Theme::Color color) { return creatorTheme()->color(color).name(); }; - const QString authorName = colorName(Theme::Git_AuthorName_TextColor); - const QString commitDate = colorName(Theme::Git_CommitDate_TextColor); - const QString commitHash = colorName(Theme::Git_CommitHash_TextColor); - const QString commitSubject = colorName(Theme::Git_CommitSubject_TextColor); - const QString decoration = colorName(Theme::Git_Decoration_TextColor); + const QString authorName = logColorName(TextEditor::C_LOG_AUTHOR_NAME); + const QString commitDate = logColorName(TextEditor::C_LOG_COMMIT_DATE); + const QString commitHash = logColorName(TextEditor::C_LOG_COMMIT_HASH); + const QString commitSubject = logColorName(TextEditor::C_LOG_COMMIT_SUBJECT); + const QString decoration = logColorName(TextEditor::C_LOG_DECORATION); const QString logArgs = QStringLiteral( "--pretty=format:" "commit %C(%1)%H%Creset %C(%2)%d%Creset%n" "Author: %C(%3)%an <%ae>%Creset%n" "Date: %C(%4)%cD%Creset%n%n" - "%C(%5)%s%Creset%n%n%b%n" + "%C(%5)%w(0,4,4)%s%Creset%n%n%b" ).arg(commitHash, decoration, authorName, commitDate, commitSubject); return {logArgs}; diff --git a/src/plugins/texteditor/colorscheme.h b/src/plugins/texteditor/colorscheme.h index ef7e59e87f..22b625ec24 100644 --- a/src/plugins/texteditor/colorscheme.h +++ b/src/plugins/texteditor/colorscheme.h @@ -101,7 +101,7 @@ inline bool operator!=(const Format &f1, const Format &f2) { return !f1.equals(f /*! A color scheme combines a set of formats for different highlighting categories. It also provides saving and loading of the scheme to a file. */ -class ColorScheme +class TEXTEDITOR_EXPORT ColorScheme { public: void setDisplayName(const QString &name) diff --git a/src/plugins/texteditor/texteditorconstants.cpp b/src/plugins/texteditor/texteditorconstants.cpp index 6c3c95c878..70ad3e6c04 100644 --- a/src/plugins/texteditor/texteditorconstants.cpp +++ b/src/plugins/texteditor/texteditorconstants.cpp @@ -97,6 +97,11 @@ const char *nameForStyle(TextStyle style) case C_DIFF_DEST_CHAR: return "DiffDestChar"; case C_LOG_CHANGE_LINE: return "LogChangeLine"; + case C_LOG_AUTHOR_NAME: return "LogAuthorName"; + case C_LOG_COMMIT_DATE: return "LogCommitDate"; + case C_LOG_COMMIT_HASH: return "LogCommitHash"; + case C_LOG_COMMIT_SUBJECT: return "LogCommitSubject"; + case C_LOG_DECORATION: return "LogDecoration"; case C_ERROR: return "Error"; case C_ERROR_CONTEXT: return "ErrorContext"; diff --git a/src/plugins/texteditor/texteditorconstants.h b/src/plugins/texteditor/texteditorconstants.h index c74bbfcde8..038c0913a5 100644 --- a/src/plugins/texteditor/texteditorconstants.h +++ b/src/plugins/texteditor/texteditorconstants.h @@ -97,6 +97,11 @@ enum TextStyle : quint8 { C_DIFF_DEST_CHAR, C_LOG_CHANGE_LINE, + C_LOG_AUTHOR_NAME, + C_LOG_COMMIT_DATE, + C_LOG_COMMIT_HASH, + C_LOG_COMMIT_SUBJECT, + C_LOG_DECORATION, C_WARNING, C_WARNING_CONTEXT, diff --git a/src/plugins/texteditor/texteditorsettings.cpp b/src/plugins/texteditor/texteditorsettings.cpp index eb75f8aeb9..92b722bf3e 100644 --- a/src/plugins/texteditor/texteditorsettings.cpp +++ b/src/plugins/texteditor/texteditorsettings.cpp @@ -303,7 +303,21 @@ FormatDescriptions TextEditorSettingsPrivate::initialFormats() formatDescr.emplace_back(C_LOG_CHANGE_LINE, tr("Log Change Line"), tr("Applied to lines describing changes in VCS log."), Format(QColor(192, 0, 0), QColor())); - + formatDescr.emplace_back(C_LOG_AUTHOR_NAME, tr("Log Author Name"), + tr("Applied to author names in VCS log."), + Format(QColor("#007af4"), QColor())); + formatDescr.emplace_back(C_LOG_COMMIT_DATE, tr("Log Commit Date"), + tr("Applied to commit dates in VCS log."), + Format(QColor("#006600"), QColor())); + formatDescr.emplace_back(C_LOG_COMMIT_HASH, tr("Log Commit Hash"), + tr("Applied to commit hashes in VCS log."), + Format(QColor("#ff0000"), QColor())); + formatDescr.emplace_back(C_LOG_DECORATION, tr("Log Decoration"), + tr("Applied to commit decorations in VCS log."), + Format(QColor("#ff00ff"), QColor())); + formatDescr.emplace_back(C_LOG_COMMIT_SUBJECT, tr("Log Commit Subject"), + tr("Applied to commit subjects in VCS log."), + Format{QColor{}, QColor{}}); // Mixin categories formatDescr.emplace_back(C_ERROR, |