mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 02:36:19 +02:00
[FZ Editor] Include template name in edit template dialog title + don't resize dialog when typing to long name (#15187)
* Edit layout dialog title fix * Added TextBlock in the contentdialog title to enable TextTrimming * Fix text trimming and wrapping * Too long name doesn't affect dialog width Co-authored-by: niels9001 <niels.laute@live.nl>
This commit is contained in:
@@ -351,12 +351,15 @@
|
|||||||
PrimaryButtonText="{x:Static props:Resources.Save}"
|
PrimaryButtonText="{x:Static props:Resources.Save}"
|
||||||
PrimaryButtonClick="EditLayoutDialog_PrimaryButtonClick"
|
PrimaryButtonClick="EditLayoutDialog_PrimaryButtonClick"
|
||||||
SecondaryButtonClick="EditLayoutDialog_SecondaryButtonClick"
|
SecondaryButtonClick="EditLayoutDialog_SecondaryButtonClick"
|
||||||
Title="{x:Static props:Resources.Edit_Layout}"
|
|
||||||
ScrollViewer.VerticalScrollBarVisibility="Auto"
|
ScrollViewer.VerticalScrollBarVisibility="Auto"
|
||||||
|
MaxWidth="320"
|
||||||
Opened="Dialog_Opened"
|
Opened="Dialog_Opened"
|
||||||
Closed="Dialog_Closed">
|
Closed="Dialog_Closed">
|
||||||
|
<ui:ContentDialog.Title>
|
||||||
|
<TextBlock x:Name="EditLayoutDialogTitle" MaxWidth="320" Margin="0,0,96,0" Loaded="EditLayoutDialogTitle_Loaded"/>
|
||||||
|
</ui:ContentDialog.Title>
|
||||||
<Grid DataContext="{Binding SelectedModel}"
|
<Grid DataContext="{Binding SelectedModel}"
|
||||||
MinWidth="320" Margin="4,4,24,32">
|
Margin="4,4,24,32">
|
||||||
|
|
||||||
<StackPanel Margin="0,-37,0,0"
|
<StackPanel Margin="0,-37,0,0"
|
||||||
HorizontalAlignment="Right"
|
HorizontalAlignment="Right"
|
||||||
@@ -423,6 +426,7 @@
|
|||||||
Margin="12,0,0,0"
|
Margin="12,0,0,0"
|
||||||
ui:ControlHelper.Header="{x:Static props:Resources.Name}"
|
ui:ControlHelper.Header="{x:Static props:Resources.Name}"
|
||||||
MinWidth="286"
|
MinWidth="286"
|
||||||
|
MaxWidth="286"
|
||||||
HorizontalAlignment="Stretch"
|
HorizontalAlignment="Stretch"
|
||||||
GotKeyboardFocus="TextBox_GotKeyboardFocus" />
|
GotKeyboardFocus="TextBox_GotKeyboardFocus" />
|
||||||
|
|
||||||
|
|||||||
@@ -315,6 +315,7 @@ namespace FancyZonesEditor
|
|||||||
}
|
}
|
||||||
|
|
||||||
Keyboard.ClearFocus();
|
Keyboard.ClearFocus();
|
||||||
|
EditLayoutDialogTitle.Text = string.Format(Properties.Resources.Edit_Template, ((LayoutModel)dataContext).Name);
|
||||||
await EditLayoutDialog.ShowAsync();
|
await EditLayoutDialog.ShowAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -547,5 +548,11 @@ namespace FancyZonesEditor
|
|||||||
{
|
{
|
||||||
SettingsDeepLink.OpenSettings(SettingsDeepLink.SettingsWindow.FancyZones);
|
SettingsDeepLink.OpenSettings(SettingsDeepLink.SettingsWindow.FancyZones);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void EditLayoutDialogTitle_Loaded(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
EditLayoutDialogTitle.TextTrimming = TextTrimming.CharacterEllipsis;
|
||||||
|
EditLayoutDialogTitle.TextWrapping = TextWrapping.NoWrap;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -276,15 +276,6 @@ namespace FancyZonesEditor.Properties {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Looks up a localized string similar to Edit layout.
|
|
||||||
/// </summary>
|
|
||||||
public static string Edit_Layout {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("Edit_Layout", resourceCulture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to opened.
|
/// Looks up a localized string similar to opened.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -294,6 +285,15 @@ namespace FancyZonesEditor.Properties {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to Edit '{0}'.
|
||||||
|
/// </summary>
|
||||||
|
public static string Edit_Template {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("Edit_Template", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Edit zones.
|
/// Looks up a localized string similar to Edit zones.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -371,8 +371,8 @@
|
|||||||
<data name="QuickKey_Title" xml:space="preserve">
|
<data name="QuickKey_Title" xml:space="preserve">
|
||||||
<value>Layout shortcut</value>
|
<value>Layout shortcut</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Edit_Layout" xml:space="preserve">
|
<data name="Edit_Template" xml:space="preserve">
|
||||||
<value>Edit layout</value>
|
<value>Edit '{0}'</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Edit_Layout_Open_Announce" xml:space="preserve">
|
<data name="Edit_Layout_Open_Announce" xml:space="preserve">
|
||||||
<value>opened</value>
|
<value>opened</value>
|
||||||
|
|||||||
Reference in New Issue
Block a user