Skip to content

Commit d3be3e9

Browse files
committed
fix: wrong window margin and border if window is started as maximized
1 parent 17b0d7d commit d3be3e9

File tree

3 files changed

+17
-10
lines changed

3 files changed

+17
-10
lines changed

src/ViewModels/Clone.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public Clone()
6666
{
6767
Dispatcher.UIThread.Invoke(() => Remote = text);
6868
}
69-
}
69+
}
7070
catch
7171
{
7272
// ignore

src/Views/CommitRefsPresenter.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,14 +83,14 @@ public IBrush TagNameBackground
8383
static CommitRefsPresenter()
8484
{
8585
AffectsMeasure<CommitRefsPresenter>(
86-
FontFamilyProperty,
86+
FontFamilyProperty,
8787
FontSizeProperty,
8888
LabelForegroundProperty);
8989

9090
AffectsRender<CommitRefsPresenter>(
91-
IconBackgroundProperty,
92-
IconForegroundProperty,
93-
BranchNameBackgroundProperty,
91+
IconBackgroundProperty,
92+
IconForegroundProperty,
93+
BranchNameBackgroundProperty,
9494
TagNameBackgroundProperty);
9595
}
9696

@@ -102,7 +102,7 @@ public override void Render(DrawingContext context)
102102
var iconFG = IconForeground;
103103
var iconBG = IconBackground;
104104
var branchBG = BranchNameBackground;
105-
var tagBG = TagNameBackground;
105+
var tagBG = TagNameBackground;
106106
var x = 0.0;
107107

108108
foreach (var item in _items)
@@ -141,7 +141,7 @@ protected override Size MeasureOverride(Size availableSize)
141141

142142
foreach (var decorator in commit.Decorators)
143143
{
144-
var isHead = decorator.Type == Models.DecoratorType.CurrentBranchHead ||
144+
var isHead = decorator.Type == Models.DecoratorType.CurrentBranchHead ||
145145
decorator.Type == Models.DecoratorType.CurrentCommitHead;
146146

147147
var label = new FormattedText(

src/Views/Launcher.axaml.cs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@ public partial class Launcher : ChromelessWindow
1111
public Launcher()
1212
{
1313
var layout = ViewModels.Preference.Instance.Layout;
14-
WindowState = layout.LauncherWindowState;
15-
16-
if (WindowState != WindowState.Maximized)
14+
if (layout.LauncherWindowState != WindowState.Maximized)
1715
{
1816
Width = layout.LauncherWidth;
1917
Height = layout.LauncherHeight;
@@ -22,6 +20,15 @@ public Launcher()
2220
InitializeComponent();
2321
}
2422

23+
protected override void OnOpened(EventArgs e)
24+
{
25+
base.OnOpened(e);
26+
27+
var layout = ViewModels.Preference.Instance.Layout;
28+
if (layout.LauncherWindowState == WindowState.Maximized)
29+
WindowState = WindowState.Maximized;
30+
}
31+
2532
protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs change)
2633
{
2734
base.OnPropertyChanged(change);

0 commit comments

Comments
 (0)