mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-01-18 06:29:44 +08:00
FancyZones editor display zone numbers & PowerRename fix (#1726)
* Fix for issue #1218 Design Change: Default Enter Action * Fix for issue #1085 * change zone's number color and font remove the light blue background * Fix for disappearing zone number in editor * Grid layout reversed order fix Co-authored-by: sqrlmn <sqrlmn@users.noreply.github.com> Co-authored-by: Enrico Giordani <enrico.giordani@gmail.com>
This commit is contained in:
parent
0aeecc7a99
commit
f9a756d1ff
@ -71,6 +71,7 @@ namespace FancyZonesEditor
|
||||
Canvas.SetTop(zone, rect.Y);
|
||||
zone.Height = rect.Height;
|
||||
zone.Width = rect.Width;
|
||||
zone.LabelID.Content = i + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -40,5 +40,16 @@
|
||||
</DockPanel>
|
||||
<Rectangle Fill="LightGray" Grid.Row="3" Grid.Column="1" Grid.RowSpan="2" Grid.ColumnSpan="3"/>
|
||||
<Canvas x:Name="Body" />
|
||||
<Label Name="LabelID"
|
||||
Content="ID"
|
||||
Canvas.Left="10"
|
||||
Canvas.Bottom="10"
|
||||
FontSize="80"
|
||||
FontFamily="Segoe UI"
|
||||
Foreground="Black"
|
||||
Grid.Column="2"
|
||||
Grid.Row="3"
|
||||
VerticalContentAlignment="Center"
|
||||
HorizontalContentAlignment="Center" />
|
||||
</Grid>
|
||||
</UserControl>
|
||||
|
@ -1,32 +1,48 @@
|
||||
<UserControl x:Class="FancyZonesEditor.GridEditor"
|
||||
<UserControl
|
||||
x:Class="FancyZonesEditor.GridEditor"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:FancyZonesEditor"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
mc:Ignorable="d">
|
||||
<UserControl.Resources>
|
||||
<Style TargetType="Button">
|
||||
<Setter Property="FontFamily" Value="Segoe UI" />
|
||||
<Setter Property="FontWeight" Value="SemiBold" />
|
||||
<Setter Property="Foreground" Value="Black"/>
|
||||
<Setter Property="FontSize" Value="14"/>
|
||||
<Setter Property="BorderThickness" Value="0"/>
|
||||
<Setter Property="Background" Value="#F2F2F2"/>
|
||||
<Setter Property="Width" Value="150"/>
|
||||
<Setter Property="Foreground" Value="Black" />
|
||||
<Setter Property="FontSize" Value="14" />
|
||||
<Setter Property="BorderThickness" Value="0" />
|
||||
<Setter Property="Background" Value="#F2F2F2" />
|
||||
<Setter Property="Width" Value="150" />
|
||||
</Style>
|
||||
</UserControl.Resources>
|
||||
<Grid>
|
||||
<Canvas x:Name="Preview"/>
|
||||
<Canvas x:Name="AdornerLayer"/>
|
||||
<Canvas x:Name="MergePanel" Visibility="Collapsed" MouseUp="MergePanelMouseUp">
|
||||
<Canvas x:Name="Preview" />
|
||||
<Canvas x:Name="AdornerLayer" />
|
||||
<Canvas
|
||||
x:Name="MergePanel"
|
||||
MouseUp="MergePanelMouseUp"
|
||||
Visibility="Collapsed">
|
||||
|
||||
<StackPanel x:Name="MergeButtons" Background="Gray" Orientation="Horizontal">
|
||||
<Button Click="MergeClick" Margin="0" Height="36" Width="134">
|
||||
<StackPanel
|
||||
x:Name="MergeButtons"
|
||||
Background="Gray"
|
||||
Orientation="Horizontal">
|
||||
<Button
|
||||
Width="134"
|
||||
Height="36"
|
||||
Margin="0"
|
||||
Click="MergeClick">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Image Source="images/Merge.png" Margin="0,0,12,0" Height="16" HorizontalAlignment="Left" />
|
||||
<TextBlock Text="Merge zones"/>
|
||||
<Image
|
||||
Height="16"
|
||||
Margin="0,0,12,0"
|
||||
HorizontalAlignment="Left"
|
||||
Source="images/Merge.png" />
|
||||
<TextBlock Text="Merge zones" />
|
||||
</StackPanel>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
|
@ -569,6 +569,7 @@ namespace FancyZonesEditor
|
||||
top = _rowInfo[row].Start;
|
||||
Canvas.SetLeft(zone, left);
|
||||
Canvas.SetTop(zone, top);
|
||||
zone.LabelID.Content = i + 1;
|
||||
|
||||
int maxRow = row;
|
||||
while (((maxRow + 1) < rows) && (model.CellChildMap[maxRow + 1, col] == i))
|
||||
|
@ -1,17 +1,31 @@
|
||||
<UserControl x:Class="FancyZonesEditor.GridZone"
|
||||
<UserControl
|
||||
x:Class="FancyZonesEditor.GridZone"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:FancyZonesEditor"
|
||||
mc:Ignorable="d"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
Background="LightGray"
|
||||
BorderThickness="1"
|
||||
BorderBrush="DarkGray"
|
||||
BorderThickness="1"
|
||||
Opacity="0.5"
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
<Grid x:Name="Frame" Visibility="Collapsed">
|
||||
mc:Ignorable="d">
|
||||
<Grid x:Name="Frame">
|
||||
<Canvas x:Name="Body" />
|
||||
<Label
|
||||
Name="LabelID"
|
||||
Grid.Row="3"
|
||||
Grid.Column="2"
|
||||
Canvas.Left="10"
|
||||
Canvas.Bottom="10"
|
||||
HorizontalContentAlignment="Center"
|
||||
VerticalContentAlignment="Center"
|
||||
Content="ID"
|
||||
FontFamily="Segoe UI"
|
||||
FontSize="80"
|
||||
Foreground="Black" />
|
||||
<!--<TextBlock Margin="2" Text="Shift Key switches direction Ctrl Key repeats"/>-->
|
||||
</Grid>
|
||||
</UserControl>
|
||||
|
@ -146,13 +146,13 @@ namespace FancyZonesEditor
|
||||
|
||||
protected override void OnMouseEnter(MouseEventArgs e)
|
||||
{
|
||||
Frame.Visibility = Visibility.Visible;
|
||||
_splitter.Fill = Brushes.DarkGray;
|
||||
base.OnMouseEnter(e);
|
||||
}
|
||||
|
||||
protected override void OnMouseLeave(MouseEventArgs e)
|
||||
{
|
||||
Frame.Visibility = Visibility.Collapsed;
|
||||
_splitter.Fill = Brushes.Transparent;
|
||||
base.OnMouseLeave(e);
|
||||
}
|
||||
|
||||
|
@ -329,15 +329,15 @@ namespace FancyZonesEditor
|
||||
_gridModel.ColumnPercents[col] = ((_multiplier * (col + 1)) / cols) - ((_multiplier * col) / cols);
|
||||
}
|
||||
|
||||
int index = 0;
|
||||
for (int col = cols - 1; col >= 0; col--)
|
||||
{
|
||||
int index = ZoneCount - 1;
|
||||
for (int row = rows - 1; row >= 0; row--)
|
||||
{
|
||||
_gridModel.CellChildMap[row, col] = index++;
|
||||
if (index == ZoneCount)
|
||||
for (int col = cols - 1; col >= 0; col--)
|
||||
{
|
||||
index--;
|
||||
_gridModel.CellChildMap[row, col] = index--;
|
||||
if (index < 0)
|
||||
{
|
||||
index = 0; ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -653,10 +653,6 @@ void CPowerRenameUI::_OnCommand(_In_ WPARAM wParam, _In_ LPARAM lParam)
|
||||
switch (LOWORD(wParam))
|
||||
{
|
||||
case IDOK:
|
||||
case IDCANCEL:
|
||||
_OnCloseDlg();
|
||||
break;
|
||||
|
||||
case ID_RENAME:
|
||||
_OnRename();
|
||||
break;
|
||||
@ -665,6 +661,10 @@ void CPowerRenameUI::_OnCommand(_In_ WPARAM wParam, _In_ LPARAM lParam)
|
||||
_OnAbout();
|
||||
break;
|
||||
|
||||
case IDCANCEL:
|
||||
_OnCloseDlg();
|
||||
break;
|
||||
|
||||
case IDC_EDIT_REPLACEWITH:
|
||||
case IDC_EDIT_SEARCHFOR:
|
||||
if (GET_WM_COMMAND_CMD(wParam, lParam) == EN_CHANGE)
|
||||
|
Loading…
Reference in New Issue
Block a user