Skip to content

Commit b4d5e57

Browse files
committed
Fix size change issue
1 parent 88a2088 commit b4d5e57

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

Flow.Launcher/ReleaseNotesWindow.xaml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,21 +171,25 @@
171171
Grid.Row="2"
172172
Grid.Column="0"
173173
Grid.ColumnSpan="5"
174+
Height="500"
174175
Margin="15 0 20 0"
175176
HorizontalAlignment="Stretch"
176-
VerticalAlignment="Stretch"
177177
ClickAction="SafetyDisplayWithRelativePath"
178178
Loaded="MarkdownViewer_Loaded"
179-
Plugins="{StaticResource MdXamlPlugins}" />
179+
Plugins="{StaticResource MdXamlPlugins}"
180+
Visibility="Collapsed" />
180181

181-
<!-- Put this Grid in the same position as MarkdownViewer -->
182+
<!-- This Grid is for display progress ring and refresh button. -->
183+
<!-- And it is also for changing the size of the MarkdownViewer. -->
184+
<!-- Because VerticalAlignment="Stretch" can cause size issue with MarkdownViewer. -->
182185
<Grid
183186
Grid.Row="2"
184187
Grid.Column="0"
185188
Grid.ColumnSpan="5"
186189
Margin="15 0 20 0"
187190
HorizontalAlignment="Stretch"
188-
VerticalAlignment="Stretch">
191+
VerticalAlignment="Stretch"
192+
SizeChanged="Grid_SizeChanged">
189193
<ui:ProgressRing
190194
x:Name="RefreshProgressRing"
191195
Width="32"

Flow.Launcher/ReleaseNotesWindow.xaml.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,11 +185,13 @@ private async void RefreshMarkdownViewer()
185185
if (string.IsNullOrEmpty(output))
186186
{
187187
RefreshButton.Visibility = Visibility.Visible;
188+
MarkdownViewer.Visibility = Visibility.Collapsed;
188189
}
189190
else
190191
{
191192
RefreshButton.Visibility = Visibility.Collapsed;
192193
MarkdownViewer.Markdown = output;
194+
MarkdownViewer.Visibility = Visibility.Visible;
193195
}
194196
});
195197
}
@@ -212,5 +214,11 @@ private void ThemeManager_ActualApplicationThemeChanged(ModernWpf.ThemeManager s
212214
}
213215
});
214216
}
217+
218+
private void Grid_SizeChanged(object sender, SizeChangedEventArgs e)
219+
{
220+
MarkdownViewer.Height = e.NewSize.Height;
221+
MarkdownViewer.Width = e.NewSize.Width;
222+
}
215223
}
216224
}

0 commit comments

Comments
 (0)