mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 11:48:06 +01: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}"
|
||||
PrimaryButtonClick="EditLayoutDialog_PrimaryButtonClick"
|
||||
SecondaryButtonClick="EditLayoutDialog_SecondaryButtonClick"
|
||||
Title="{x:Static props:Resources.Edit_Layout}"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Auto"
|
||||
MaxWidth="320"
|
||||
Opened="Dialog_Opened"
|
||||
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}"
|
||||
MinWidth="320" Margin="4,4,24,32">
|
||||
Margin="4,4,24,32">
|
||||
|
||||
<StackPanel Margin="0,-37,0,0"
|
||||
HorizontalAlignment="Right"
|
||||
@@ -423,6 +426,7 @@
|
||||
Margin="12,0,0,0"
|
||||
ui:ControlHelper.Header="{x:Static props:Resources.Name}"
|
||||
MinWidth="286"
|
||||
MaxWidth="286"
|
||||
HorizontalAlignment="Stretch"
|
||||
GotKeyboardFocus="TextBox_GotKeyboardFocus" />
|
||||
|
||||
|
||||
@@ -315,6 +315,7 @@ namespace FancyZonesEditor
|
||||
}
|
||||
|
||||
Keyboard.ClearFocus();
|
||||
EditLayoutDialogTitle.Text = string.Format(Properties.Resources.Edit_Template, ((LayoutModel)dataContext).Name);
|
||||
await EditLayoutDialog.ShowAsync();
|
||||
}
|
||||
|
||||
@@ -547,5 +548,11 @@ namespace FancyZonesEditor
|
||||
{
|
||||
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>
|
||||
/// Looks up a localized string similar to opened.
|
||||
/// </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>
|
||||
/// Looks up a localized string similar to Edit zones.
|
||||
/// </summary>
|
||||
|
||||
@@ -371,8 +371,8 @@
|
||||
<data name="QuickKey_Title" xml:space="preserve">
|
||||
<value>Layout shortcut</value>
|
||||
</data>
|
||||
<data name="Edit_Layout" xml:space="preserve">
|
||||
<value>Edit layout</value>
|
||||
<data name="Edit_Template" xml:space="preserve">
|
||||
<value>Edit '{0}'</value>
|
||||
</data>
|
||||
<data name="Edit_Layout_Open_Announce" xml:space="preserve">
|
||||
<value>opened</value>
|
||||
|
||||
Reference in New Issue
Block a user