mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Fix size change issue
This commit is contained in:
parent
88a2088987
commit
b4d5e57b17
2 changed files with 16 additions and 4 deletions
|
|
@ -171,21 +171,25 @@
|
|||
Grid.Row="2"
|
||||
Grid.Column="0"
|
||||
Grid.ColumnSpan="5"
|
||||
Height="500"
|
||||
Margin="15 0 20 0"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch"
|
||||
ClickAction="SafetyDisplayWithRelativePath"
|
||||
Loaded="MarkdownViewer_Loaded"
|
||||
Plugins="{StaticResource MdXamlPlugins}" />
|
||||
Plugins="{StaticResource MdXamlPlugins}"
|
||||
Visibility="Collapsed" />
|
||||
|
||||
<!-- Put this Grid in the same position as MarkdownViewer -->
|
||||
<!-- This Grid is for display progress ring and refresh button. -->
|
||||
<!-- And it is also for changing the size of the MarkdownViewer. -->
|
||||
<!-- Because VerticalAlignment="Stretch" can cause size issue with MarkdownViewer. -->
|
||||
<Grid
|
||||
Grid.Row="2"
|
||||
Grid.Column="0"
|
||||
Grid.ColumnSpan="5"
|
||||
Margin="15 0 20 0"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch">
|
||||
VerticalAlignment="Stretch"
|
||||
SizeChanged="Grid_SizeChanged">
|
||||
<ui:ProgressRing
|
||||
x:Name="RefreshProgressRing"
|
||||
Width="32"
|
||||
|
|
|
|||
|
|
@ -185,11 +185,13 @@ namespace Flow.Launcher
|
|||
if (string.IsNullOrEmpty(output))
|
||||
{
|
||||
RefreshButton.Visibility = Visibility.Visible;
|
||||
MarkdownViewer.Visibility = Visibility.Collapsed;
|
||||
}
|
||||
else
|
||||
{
|
||||
RefreshButton.Visibility = Visibility.Collapsed;
|
||||
MarkdownViewer.Markdown = output;
|
||||
MarkdownViewer.Visibility = Visibility.Visible;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
@ -212,5 +214,11 @@ namespace Flow.Launcher
|
|||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void Grid_SizeChanged(object sender, SizeChangedEventArgs e)
|
||||
{
|
||||
MarkdownViewer.Height = e.NewSize.Height;
|
||||
MarkdownViewer.Width = e.NewSize.Width;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue