Skip to content

Commit e45f3da

Browse files
committed
ux: apply Brush.InlineCodeFG theme in commit subject
Signed-off-by: leo <longshuang@msn.cn>
1 parent dc236b3 commit e45f3da

3 files changed

Lines changed: 13 additions & 1 deletion

File tree

‎src/Views/CommitSubjectPresenter.cs‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,15 @@ public IBrush LinkForeground
7777
set => SetValue(LinkForegroundProperty, value);
7878
}
7979

80+
public static readonly StyledProperty<IBrush> InlineCodeForegroundProperty =
81+
AvaloniaProperty.Register<CommitSubjectPresenter, IBrush>(nameof(InlineCodeForeground), Brushes.White);
82+
83+
public IBrush InlineCodeForeground
84+
{
85+
get => GetValue(InlineCodeForegroundProperty);
86+
set => SetValue(InlineCodeForegroundProperty, value);
87+
}
88+
8089
public static readonly StyledProperty<bool> ShowStrikethroughProperty =
8190
AvaloniaProperty.Register<CommitSubjectPresenter, bool>(nameof(ShowStrikethrough), false);
8291

@@ -305,6 +314,7 @@ private void GenerateFormattedTextElements()
305314
var codeFontFamily = CodeFontFamily;
306315
var fontSize = FontSize;
307316
var foreground = Foreground;
317+
var inlineCodeForeground = InlineCodeForeground;
308318
var linkForeground = LinkForeground;
309319
var typeface = new Typeface(fontFamily, FontStyle.Normal, FontWeight);
310320
var codeTypeface = new Typeface(codeFontFamily, FontStyle.Normal, FontWeight);
@@ -359,7 +369,7 @@ private void GenerateFormattedTextElements()
359369
FlowDirection.LeftToRight,
360370
codeTypeface,
361371
fontSize - 0.5,
362-
foreground);
372+
inlineCodeForeground);
363373
_inlines.Add(new Inline(x, link, elem));
364374
x += link.WidthIncludingTrailingWhitespace + 8;
365375
}

‎src/Views/Histories.axaml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@
133133
FontFamily="{DynamicResource Fonts.Default}"
134134
CodeFontFamily="{DynamicResource Fonts.Monospace}"
135135
InlineCodeBackground="{DynamicResource Brush.InlineCode}"
136+
InlineCodeForeground="{DynamicResource Brush.InlineCodeFG}"
136137
Foreground="{DynamicResource Brush.FG1}"
137138
LinkForeground="{DynamicResource Brush.Link}"
138139
Subject="{Binding Subject}"

‎src/Views/InteractiveRebase.axaml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@
160160
FontFamily="{DynamicResource Fonts.Default}"
161161
CodeFontFamily="{DynamicResource Fonts.Monospace}"
162162
InlineCodeBackground="{DynamicResource Brush.InlineCode}"
163+
InlineCodeForeground="{DynamicResource Brush.InlineCodeFG}"
163164
Foreground="{DynamicResource Brush.FG1}"
164165
LinkForeground="{DynamicResource Brush.Link}"
165166
Subject="{Binding Subject}"

0 commit comments

Comments
 (0)