mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-08 04:07:40 +02:00
FZ Editor support for small screens
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
<Controls:MetroWindow x:Class="FancyZonesEditor.MainWindow"
|
<Controls:MetroWindow x:Class="FancyZonesEditor.MainWindow"
|
||||||
|
x:Name="MainWindow1"
|
||||||
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"
|
||||||
@@ -6,10 +7,11 @@
|
|||||||
xmlns:Controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
|
xmlns:Controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
|
||||||
xmlns:local="clr-namespace:FancyZonesEditor"
|
xmlns:local="clr-namespace:FancyZonesEditor"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
Title="" Width="810"
|
Title=""
|
||||||
|
Width="810"
|
||||||
SizeToContent="Height"
|
SizeToContent="Height"
|
||||||
Background="White"
|
Background="White"
|
||||||
ResizeMode="NoResize"
|
ResizeMode="CanMinimize"
|
||||||
WindowStartupLocation="CenterScreen"
|
WindowStartupLocation="CenterScreen"
|
||||||
Loaded="OnLoaded"
|
Loaded="OnLoaded"
|
||||||
Closed="OnClosed">
|
Closed="OnClosed">
|
||||||
@@ -174,8 +176,7 @@
|
|||||||
<StackPanel>
|
<StackPanel>
|
||||||
|
|
||||||
<TextBlock Name="dialog_Title" Text="Choose your layout" Style="{StaticResource titleText}" />
|
<TextBlock Name="dialog_Title" Text="Choose your layout" Style="{StaticResource titleText}" />
|
||||||
|
|
||||||
|
|
||||||
<TabControl BorderThickness="0" x:Name="TemplateTab">
|
<TabControl BorderThickness="0" x:Name="TemplateTab">
|
||||||
<TabItem Header="Templates" Template="{StaticResource myTabs}">
|
<TabItem Header="Templates" Template="{StaticResource myTabs}">
|
||||||
<StackPanel>
|
<StackPanel>
|
||||||
@@ -187,13 +188,13 @@
|
|||||||
<ItemsControl ItemsSource="{Binding DefaultModels}" Margin="8,0,0,0">
|
<ItemsControl ItemsSource="{Binding DefaultModels}" Margin="8,0,0,0">
|
||||||
<ItemsControl.ItemsPanel>
|
<ItemsControl.ItemsPanel>
|
||||||
<ItemsPanelTemplate>
|
<ItemsPanelTemplate>
|
||||||
<WrapPanel Orientation="Horizontal" ItemWidth="262" ItemHeight="262" />
|
<WrapPanel Orientation="Horizontal" ItemWidth="{Binding ElementName=MainWindow1, Mode=OneWay, UpdateSourceTrigger=PropertyChanged, Path=WrapPanelItemSize}" ItemHeight="{Binding ElementName=WrapPanel1, Path=ItemWidth}" x:Name="WrapPanel1" />
|
||||||
</ItemsPanelTemplate>
|
</ItemsPanelTemplate>
|
||||||
</ItemsControl.ItemsPanel>
|
</ItemsControl.ItemsPanel>
|
||||||
<ItemsControl.ItemTemplate>
|
<ItemsControl.ItemTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<Border Margin="8"
|
<Border Margin="8"
|
||||||
BorderBrush="{Binding Path=IsSelected, Converter={StaticResource BooleanToBrushConverter}}"
|
BorderBrush="{Binding Path=IsSelected, Converter={StaticResource BooleanToBrushConverter}}"
|
||||||
Style="{StaticResource templateBackground}"
|
Style="{StaticResource templateBackground}"
|
||||||
MouseDown="LayoutItem_Click">
|
MouseDown="LayoutItem_Click">
|
||||||
<DockPanel Margin="0,20,0,0"
|
<DockPanel Margin="0,20,0,0"
|
||||||
@@ -234,7 +235,7 @@
|
|||||||
<ItemsControl ItemsSource="{Binding CustomModels}" Margin="8,8,0,0">
|
<ItemsControl ItemsSource="{Binding CustomModels}" Margin="8,8,0,0">
|
||||||
<ItemsControl.ItemsPanel>
|
<ItemsControl.ItemsPanel>
|
||||||
<ItemsPanelTemplate>
|
<ItemsPanelTemplate>
|
||||||
<WrapPanel Orientation="Horizontal" ItemWidth="262" ItemHeight="262" />
|
<WrapPanel Orientation="Horizontal" ItemWidth="{Binding ElementName=MainWindow1, Mode=OneWay, UpdateSourceTrigger=PropertyChanged, Path=WrapPanelItemSize}" ItemHeight="{Binding ElementName=WrapPanel2, Path=ItemWidth}" x:Name="WrapPanel2" />
|
||||||
</ItemsPanelTemplate>
|
</ItemsPanelTemplate>
|
||||||
</ItemsControl.ItemsPanel>
|
</ItemsControl.ItemsPanel>
|
||||||
<ItemsControl.ItemTemplate>
|
<ItemsControl.ItemTemplate>
|
||||||
|
|||||||
@@ -27,6 +27,24 @@ namespace FancyZonesEditor
|
|||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
DataContext = _settings;
|
DataContext = _settings;
|
||||||
|
if (_settings.WorkArea.Height < 900)
|
||||||
|
{
|
||||||
|
this.SizeToContent = SizeToContent.WidthAndHeight;
|
||||||
|
this.WrapPanelItemSize = 180;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private int _WrapPanelItemSize = 262;
|
||||||
|
public int WrapPanelItemSize {
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return _WrapPanelItemSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_WrapPanelItemSize = value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DecrementZones_Click(object sender, RoutedEventArgs e)
|
private void DecrementZones_Click(object sender, RoutedEventArgs e)
|
||||||
|
|||||||
Reference in New Issue
Block a user