mirror of
https://github.com/microsoft/PowerToys
synced 2025-09-05 00:45:12 +00:00
[Settings] Adding MinWidth (#25405)
* Adding MinWidth * Proper reflowing of info
This commit is contained in:
@@ -19,14 +19,30 @@
|
|||||||
TrueValue="Visible" />
|
TrueValue="Visible" />
|
||||||
</UserControl.Resources>
|
</UserControl.Resources>
|
||||||
|
|
||||||
<Grid
|
<Grid Padding="20,0,0,0" RowSpacing="24">
|
||||||
Padding="20,0,0,0"
|
|
||||||
RowSpacing="24">
|
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
<RowDefinition Height="*" />
|
<RowDefinition Height="*" />
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
|
<VisualStateManager.VisualStateGroups>
|
||||||
|
<VisualStateGroup>
|
||||||
|
<VisualState>
|
||||||
|
<VisualState.StateTriggers>
|
||||||
|
<AdaptiveTrigger MinWindowWidth="480" />
|
||||||
|
</VisualState.StateTriggers>
|
||||||
|
</VisualState>
|
||||||
|
<VisualState>
|
||||||
|
<VisualState.StateTriggers>
|
||||||
|
<AdaptiveTrigger MinWindowWidth="0" />
|
||||||
|
</VisualState.StateTriggers>
|
||||||
|
<VisualState.Setters>
|
||||||
|
<Setter Target="DescriptionPanel.(Grid.Row)" Value="1" />
|
||||||
|
<Setter Target="DescriptionPanel.(Grid.Column)" Value="0" />
|
||||||
|
<Setter Target="DescriptionPanel.(Grid.ColumnSpan)" Value="2" />
|
||||||
|
</VisualState.Setters>
|
||||||
|
</VisualState>
|
||||||
|
</VisualStateGroup>
|
||||||
|
</VisualStateManager.VisualStateGroups>
|
||||||
<TextBlock
|
<TextBlock
|
||||||
x:Name="Header"
|
x:Name="Header"
|
||||||
MaxWidth="{StaticResource PageMaxWidth}"
|
MaxWidth="{StaticResource PageMaxWidth}"
|
||||||
@@ -38,10 +54,10 @@
|
|||||||
Text="{x:Bind ModuleTitle}" />
|
Text="{x:Bind ModuleTitle}" />
|
||||||
|
|
||||||
<ScrollViewer Grid.Row="1">
|
<ScrollViewer Grid.Row="1">
|
||||||
<Grid ChildrenTransitions="{StaticResource SettingsCardsAnimations}"
|
<Grid
|
||||||
Padding="0,0,20,48"
|
Padding="0,0,20,48"
|
||||||
|
ChildrenTransitions="{StaticResource SettingsCardsAnimations}"
|
||||||
RowSpacing="24">
|
RowSpacing="24">
|
||||||
|
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
@@ -51,12 +67,19 @@
|
|||||||
<!-- Top panel -->
|
<!-- Top panel -->
|
||||||
<Grid
|
<Grid
|
||||||
MaxWidth="{StaticResource PageMaxWidth}"
|
MaxWidth="{StaticResource PageMaxWidth}"
|
||||||
ColumnSpacing="16">
|
ColumnSpacing="16"
|
||||||
|
RowSpacing="16">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="160" />
|
<ColumnDefinition Width="Auto" />
|
||||||
<ColumnDefinition Width="*" />
|
<ColumnDefinition Width="*" />
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
<Border
|
<Border
|
||||||
|
MaxWidth="160"
|
||||||
|
HorizontalAlignment="Left"
|
||||||
VerticalAlignment="Top"
|
VerticalAlignment="Top"
|
||||||
CornerRadius="4">
|
CornerRadius="4">
|
||||||
<Image AutomationProperties.AccessibilityView="Raw">
|
<Image AutomationProperties.AccessibilityView="Raw">
|
||||||
@@ -66,7 +89,7 @@
|
|||||||
</Image>
|
</Image>
|
||||||
</Border>
|
</Border>
|
||||||
|
|
||||||
<StackPanel Grid.Column="1">
|
<StackPanel x:Name="DescriptionPanel" Grid.Column="1">
|
||||||
<TextBlock
|
<TextBlock
|
||||||
x:Name="AboutDescription"
|
x:Name="AboutDescription"
|
||||||
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
|
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
|
||||||
@@ -80,20 +103,14 @@
|
|||||||
ItemsSource="{x:Bind PrimaryLinks}">
|
ItemsSource="{x:Bind PrimaryLinks}">
|
||||||
<ItemsControl.ItemTemplate>
|
<ItemsControl.ItemTemplate>
|
||||||
<DataTemplate x:DataType="local:PageLink">
|
<DataTemplate x:DataType="local:PageLink">
|
||||||
<HyperlinkButton
|
<HyperlinkButton NavigateUri="{x:Bind Link}" Style="{StaticResource TextButtonStyle}">
|
||||||
NavigateUri="{x:Bind Link}"
|
<TextBlock Text="{x:Bind Text}" TextWrapping="Wrap" />
|
||||||
Style="{StaticResource TextButtonStyle}">
|
|
||||||
<TextBlock
|
|
||||||
Text="{x:Bind Text}"
|
|
||||||
TextWrapping="Wrap" />
|
|
||||||
</HyperlinkButton>
|
</HyperlinkButton>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</ItemsControl.ItemTemplate>
|
</ItemsControl.ItemTemplate>
|
||||||
<ItemsControl.ItemsPanel>
|
<ItemsControl.ItemsPanel>
|
||||||
<ItemsPanelTemplate>
|
<ItemsPanelTemplate>
|
||||||
<controls:WrapPanel
|
<controls:WrapPanel HorizontalSpacing="24" Orientation="Horizontal" />
|
||||||
HorizontalSpacing="24"
|
|
||||||
Orientation="Horizontal" />
|
|
||||||
</ItemsPanelTemplate>
|
</ItemsPanelTemplate>
|
||||||
</ItemsControl.ItemsPanel>
|
</ItemsControl.ItemsPanel>
|
||||||
</ItemsControl>
|
</ItemsControl>
|
||||||
@@ -127,20 +144,14 @@
|
|||||||
ItemsSource="{x:Bind SecondaryLinks}">
|
ItemsSource="{x:Bind SecondaryLinks}">
|
||||||
<ItemsControl.ItemTemplate>
|
<ItemsControl.ItemTemplate>
|
||||||
<DataTemplate x:DataType="local:PageLink">
|
<DataTemplate x:DataType="local:PageLink">
|
||||||
<HyperlinkButton
|
<HyperlinkButton NavigateUri="{x:Bind Link}" Style="{StaticResource TextButtonStyle}">
|
||||||
NavigateUri="{x:Bind Link}"
|
<TextBlock Text="{x:Bind Text}" TextWrapping="Wrap" />
|
||||||
Style="{StaticResource TextButtonStyle}">
|
|
||||||
<TextBlock
|
|
||||||
Text="{x:Bind Text}"
|
|
||||||
TextWrapping="Wrap" />
|
|
||||||
</HyperlinkButton>
|
</HyperlinkButton>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</ItemsControl.ItemTemplate>
|
</ItemsControl.ItemTemplate>
|
||||||
<ItemsControl.ItemsPanel>
|
<ItemsControl.ItemsPanel>
|
||||||
<ItemsPanelTemplate>
|
<ItemsPanelTemplate>
|
||||||
<controls:WrapPanel
|
<controls:WrapPanel HorizontalSpacing="24" Orientation="Horizontal" />
|
||||||
HorizontalSpacing="24"
|
|
||||||
Orientation="Horizontal" />
|
|
||||||
</ItemsPanelTemplate>
|
</ItemsPanelTemplate>
|
||||||
</ItemsControl.ItemsPanel>
|
</ItemsControl.ItemsPanel>
|
||||||
</ItemsControl>
|
</ItemsControl>
|
||||||
|
@@ -1,14 +1,17 @@
|
|||||||
<Window
|
<winuiex:WindowEx
|
||||||
x:Class="Microsoft.PowerToys.Settings.UI.MainWindow"
|
x:Class="Microsoft.PowerToys.Settings.UI.MainWindow"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:local="using:Microsoft.PowerToys.Settings.UI.Views"
|
xmlns:local="using:Microsoft.PowerToys.Settings.UI.Views"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:winuiex="using:WinUIEx"
|
||||||
|
MinWidth="480"
|
||||||
|
MinHeight="480"
|
||||||
Closed="Window_Closed"
|
Closed="Window_Closed"
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
|
|
||||||
<Grid>
|
<Grid>
|
||||||
<local:ShellPage />
|
<local:ShellPage />
|
||||||
</Grid>
|
</Grid>
|
||||||
</Window>
|
</winuiex:WindowEx>
|
||||||
|
@@ -22,7 +22,7 @@ namespace Microsoft.PowerToys.Settings.UI
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// An empty window that can be used on its own or navigated to within a Frame.
|
/// An empty window that can be used on its own or navigated to within a Frame.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public sealed partial class MainWindow : Window
|
public sealed partial class MainWindow : WindowEx
|
||||||
{
|
{
|
||||||
public MainWindow(bool isDark, bool createHidden = false)
|
public MainWindow(bool isDark, bool createHidden = false)
|
||||||
{
|
{
|
||||||
|
@@ -1,14 +1,17 @@
|
|||||||
<Window
|
<winuiex:WindowEx
|
||||||
|
xmlns:winuiex="using:WinUIEx"
|
||||||
x:Class="Microsoft.PowerToys.Settings.UI.OobeWindow"
|
x:Class="Microsoft.PowerToys.Settings.UI.OobeWindow"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:local="using:Microsoft.PowerToys.Settings.UI.OOBE.Views"
|
xmlns:local="using:Microsoft.PowerToys.Settings.UI.OOBE.Views"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
MinWidth="480"
|
||||||
|
MinHeight="480"
|
||||||
Closed="Window_Closed"
|
Closed="Window_Closed"
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
|
|
||||||
<Grid>
|
<Grid>
|
||||||
<local:OobeShellPage x:Name="shellPage" />
|
<local:OobeShellPage x:Name="shellPage" />
|
||||||
</Grid>
|
</Grid>
|
||||||
</Window>
|
</winuiex:WindowEx>
|
||||||
|
@@ -13,13 +13,14 @@ using Microsoft.UI.Windowing;
|
|||||||
using Microsoft.UI.Xaml;
|
using Microsoft.UI.Xaml;
|
||||||
using Windows.ApplicationModel.Resources;
|
using Windows.ApplicationModel.Resources;
|
||||||
using Windows.Graphics;
|
using Windows.Graphics;
|
||||||
|
using WinUIEx;
|
||||||
|
|
||||||
namespace Microsoft.PowerToys.Settings.UI
|
namespace Microsoft.PowerToys.Settings.UI
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// An empty window that can be used on its own or navigated to within a Frame.
|
/// An empty window that can be used on its own or navigated to within a Frame.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public sealed partial class OobeWindow : Window
|
public sealed partial class OobeWindow : WindowEx
|
||||||
{
|
{
|
||||||
private PowerToysModules initialModule;
|
private PowerToysModules initialModule;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user