mirror of
https://github.com/JosefNemec/Playnite.git
synced 2026-01-09 06:11:22 +08:00
New: Added close button to Explorer Panel (by darklinkpower)
* Add close button to Explorer Panel * Vertically align button
This commit is contained in:
parent
02e55e1e30
commit
f97b68475c
@ -20,12 +20,13 @@ namespace Playnite.DesktopApp.Controls.Views
|
||||
{
|
||||
[TemplatePart(Name = "PART_SelectFields", Type = typeof(Selector))]
|
||||
[TemplatePart(Name = "PART_SelectItems", Type = typeof(Selector))]
|
||||
[TemplatePart(Name = "PART_ButtonClose", Type = typeof(ButtonBase))]
|
||||
public class ExplorerPanel : Control
|
||||
{
|
||||
private readonly DesktopAppViewModel mainModel;
|
||||
private Selector SelectFields;
|
||||
private Selector SelectItems;
|
||||
|
||||
private ButtonBase ButtonClose;
|
||||
static ExplorerPanel()
|
||||
{
|
||||
DefaultStyleKeyProperty.OverrideMetadata(typeof(ExplorerPanel), new FrameworkPropertyMetadata(typeof(ExplorerPanel)));
|
||||
@ -79,6 +80,12 @@ namespace Playnite.DesktopApp.Controls.Views
|
||||
mainModel.DatabaseExplorer,
|
||||
nameof(DatabaseExplorer.FieldValues));
|
||||
}
|
||||
|
||||
ButtonClose = Template.FindName("PART_ButtonClose", this) as ButtonBase;
|
||||
if (ButtonClose != null)
|
||||
{
|
||||
ButtonClose.Command = mainModel.ToggleExplorerPanelCommand;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -25,8 +25,16 @@
|
||||
</Style>
|
||||
</Border.Style>
|
||||
<DockPanel Background="{TemplateBinding Background}">
|
||||
<ComboBox Name="PART_SelectFields" MaxDropDownHeight="Auto"
|
||||
DockPanel.Dock="Top" Margin="5,8,5,8" />
|
||||
<DockPanel DockPanel.Dock="Top" LastChildFill="True"
|
||||
Margin="5,8,5,8">
|
||||
<Button Content="r" FontFamily="Marlett"
|
||||
Style="{StaticResource SimpleButton}"
|
||||
DockPanel.Dock="Right" Margin="0,0,5,0"
|
||||
VerticalAlignment="Center"
|
||||
Name="PART_ButtonClose"/>
|
||||
<ComboBox Name="PART_SelectFields" MaxDropDownHeight="Auto"
|
||||
DockPanel.Dock="Left" Margin="0,0,8,0" />
|
||||
</DockPanel>
|
||||
<ListBox Name="PART_SelectItems"
|
||||
DockPanel.Dock="Top" Margin="5,0,5,8"
|
||||
BorderThickness="0"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user