mirror of
https://github.com/microsoft/PowerToys
synced 2025-09-03 07:55:10 +00: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:
committed by
GitHub
parent
0aeecc7a99
commit
f9a756d1ff
@@ -71,6 +71,7 @@ namespace FancyZonesEditor
|
|||||||
Canvas.SetTop(zone, rect.Y);
|
Canvas.SetTop(zone, rect.Y);
|
||||||
zone.Height = rect.Height;
|
zone.Height = rect.Height;
|
||||||
zone.Width = rect.Width;
|
zone.Width = rect.Width;
|
||||||
|
zone.LabelID.Content = i + 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -40,5 +40,16 @@
|
|||||||
</DockPanel>
|
</DockPanel>
|
||||||
<Rectangle Fill="LightGray" Grid.Row="3" Grid.Column="1" Grid.RowSpan="2" Grid.ColumnSpan="3"/>
|
<Rectangle Fill="LightGray" Grid.Row="3" Grid.Column="1" Grid.RowSpan="2" Grid.ColumnSpan="3"/>
|
||||||
<Canvas x:Name="Body" />
|
<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>
|
</Grid>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
|
@@ -1,32 +1,48 @@
|
|||||||
<UserControl x:Class="FancyZonesEditor.GridEditor"
|
<UserControl
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
x:Class="FancyZonesEditor.GridEditor"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
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="clr-namespace:FancyZonesEditor"
|
xmlns:local="clr-namespace:FancyZonesEditor"
|
||||||
mc:Ignorable="d"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
d:DesignHeight="450" d:DesignWidth="800">
|
d:DesignHeight="450"
|
||||||
|
d:DesignWidth="800"
|
||||||
|
mc:Ignorable="d">
|
||||||
<UserControl.Resources>
|
<UserControl.Resources>
|
||||||
<Style TargetType="Button">
|
<Style TargetType="Button">
|
||||||
<Setter Property="FontFamily" Value="Segoe UI" />
|
<Setter Property="FontFamily" Value="Segoe UI" />
|
||||||
<Setter Property="FontWeight" Value="SemiBold" />
|
<Setter Property="FontWeight" Value="SemiBold" />
|
||||||
<Setter Property="Foreground" Value="Black"/>
|
<Setter Property="Foreground" Value="Black" />
|
||||||
<Setter Property="FontSize" Value="14"/>
|
<Setter Property="FontSize" Value="14" />
|
||||||
<Setter Property="BorderThickness" Value="0"/>
|
<Setter Property="BorderThickness" Value="0" />
|
||||||
<Setter Property="Background" Value="#F2F2F2"/>
|
<Setter Property="Background" Value="#F2F2F2" />
|
||||||
<Setter Property="Width" Value="150"/>
|
<Setter Property="Width" Value="150" />
|
||||||
</Style>
|
</Style>
|
||||||
</UserControl.Resources>
|
</UserControl.Resources>
|
||||||
<Grid>
|
<Grid>
|
||||||
<Canvas x:Name="Preview"/>
|
<Canvas x:Name="Preview" />
|
||||||
<Canvas x:Name="AdornerLayer"/>
|
<Canvas x:Name="AdornerLayer" />
|
||||||
<Canvas x:Name="MergePanel" Visibility="Collapsed" MouseUp="MergePanelMouseUp">
|
<Canvas
|
||||||
|
x:Name="MergePanel"
|
||||||
|
MouseUp="MergePanelMouseUp"
|
||||||
|
Visibility="Collapsed">
|
||||||
|
|
||||||
<StackPanel x:Name="MergeButtons" Background="Gray" Orientation="Horizontal">
|
<StackPanel
|
||||||
<Button Click="MergeClick" Margin="0" Height="36" Width="134">
|
x:Name="MergeButtons"
|
||||||
|
Background="Gray"
|
||||||
|
Orientation="Horizontal">
|
||||||
|
<Button
|
||||||
|
Width="134"
|
||||||
|
Height="36"
|
||||||
|
Margin="0"
|
||||||
|
Click="MergeClick">
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
<Image Source="images/Merge.png" Margin="0,0,12,0" Height="16" HorizontalAlignment="Left" />
|
<Image
|
||||||
<TextBlock Text="Merge zones"/>
|
Height="16"
|
||||||
|
Margin="0,0,12,0"
|
||||||
|
HorizontalAlignment="Left"
|
||||||
|
Source="images/Merge.png" />
|
||||||
|
<TextBlock Text="Merge zones" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Button>
|
</Button>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
@@ -569,6 +569,7 @@ namespace FancyZonesEditor
|
|||||||
top = _rowInfo[row].Start;
|
top = _rowInfo[row].Start;
|
||||||
Canvas.SetLeft(zone, left);
|
Canvas.SetLeft(zone, left);
|
||||||
Canvas.SetTop(zone, top);
|
Canvas.SetTop(zone, top);
|
||||||
|
zone.LabelID.Content = i + 1;
|
||||||
|
|
||||||
int maxRow = row;
|
int maxRow = row;
|
||||||
while (((maxRow + 1) < rows) && (model.CellChildMap[maxRow + 1, col] == i))
|
while (((maxRow + 1) < rows) && (model.CellChildMap[maxRow + 1, col] == i))
|
||||||
|
@@ -1,17 +1,31 @@
|
|||||||
<UserControl x:Class="FancyZonesEditor.GridZone"
|
<UserControl
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
x:Class="FancyZonesEditor.GridZone"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
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="clr-namespace:FancyZonesEditor"
|
xmlns:local="clr-namespace:FancyZonesEditor"
|
||||||
mc:Ignorable="d"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
Background="LightGray"
|
d:DesignHeight="450"
|
||||||
BorderThickness="1"
|
d:DesignWidth="800"
|
||||||
BorderBrush="DarkGray"
|
Background="LightGray"
|
||||||
Opacity="0.5"
|
BorderBrush="DarkGray"
|
||||||
d:DesignHeight="450" d:DesignWidth="800">
|
BorderThickness="1"
|
||||||
<Grid x:Name="Frame" Visibility="Collapsed">
|
Opacity="0.5"
|
||||||
|
mc:Ignorable="d">
|
||||||
|
<Grid x:Name="Frame">
|
||||||
<Canvas x:Name="Body" />
|
<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"/>-->
|
<!--<TextBlock Margin="2" Text="Shift Key switches direction Ctrl Key repeats"/>-->
|
||||||
</Grid>
|
</Grid>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
|
@@ -146,13 +146,13 @@ namespace FancyZonesEditor
|
|||||||
|
|
||||||
protected override void OnMouseEnter(MouseEventArgs e)
|
protected override void OnMouseEnter(MouseEventArgs e)
|
||||||
{
|
{
|
||||||
Frame.Visibility = Visibility.Visible;
|
_splitter.Fill = Brushes.DarkGray;
|
||||||
base.OnMouseEnter(e);
|
base.OnMouseEnter(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnMouseLeave(MouseEventArgs e)
|
protected override void OnMouseLeave(MouseEventArgs e)
|
||||||
{
|
{
|
||||||
Frame.Visibility = Visibility.Collapsed;
|
_splitter.Fill = Brushes.Transparent;
|
||||||
base.OnMouseLeave(e);
|
base.OnMouseLeave(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -329,15 +329,15 @@ namespace FancyZonesEditor
|
|||||||
_gridModel.ColumnPercents[col] = ((_multiplier * (col + 1)) / cols) - ((_multiplier * col) / cols);
|
_gridModel.ColumnPercents[col] = ((_multiplier * (col + 1)) / cols) - ((_multiplier * col) / cols);
|
||||||
}
|
}
|
||||||
|
|
||||||
int index = 0;
|
int index = ZoneCount - 1;
|
||||||
for (int col = cols - 1; col >= 0; col--)
|
for (int row = rows - 1; row >= 0; row--)
|
||||||
{
|
{
|
||||||
for (int row = rows - 1; row >= 0; row--)
|
for (int col = cols - 1; col >= 0; col--)
|
||||||
{
|
{
|
||||||
_gridModel.CellChildMap[row, col] = index++;
|
_gridModel.CellChildMap[row, col] = index--;
|
||||||
if (index == ZoneCount)
|
if (index < 0)
|
||||||
{
|
{
|
||||||
index--;
|
index = 0; ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -653,10 +653,6 @@ void CPowerRenameUI::_OnCommand(_In_ WPARAM wParam, _In_ LPARAM lParam)
|
|||||||
switch (LOWORD(wParam))
|
switch (LOWORD(wParam))
|
||||||
{
|
{
|
||||||
case IDOK:
|
case IDOK:
|
||||||
case IDCANCEL:
|
|
||||||
_OnCloseDlg();
|
|
||||||
break;
|
|
||||||
|
|
||||||
case ID_RENAME:
|
case ID_RENAME:
|
||||||
_OnRename();
|
_OnRename();
|
||||||
break;
|
break;
|
||||||
@@ -665,6 +661,10 @@ void CPowerRenameUI::_OnCommand(_In_ WPARAM wParam, _In_ LPARAM lParam)
|
|||||||
_OnAbout();
|
_OnAbout();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case IDCANCEL:
|
||||||
|
_OnCloseDlg();
|
||||||
|
break;
|
||||||
|
|
||||||
case IDC_EDIT_REPLACEWITH:
|
case IDC_EDIT_REPLACEWITH:
|
||||||
case IDC_EDIT_SEARCHFOR:
|
case IDC_EDIT_SEARCHFOR:
|
||||||
if (GET_WM_COMMAND_CMD(wParam, lParam) == EN_CHANGE)
|
if (GET_WM_COMMAND_CMD(wParam, lParam) == EN_CHANGE)
|
||||||
|
Reference in New Issue
Block a user