Add inline mouse-triggered search button in search field
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
- "Neues Ticket erstellen" im Tickets-Tab neu positioniert.
|
||||
- Such-Textbox im Such-Tab auf dieselbe Größe wie die darunterliegenden Aktionsbuttons vereinheitlicht.
|
||||
- Buttons in `Suche` und `Nützliche Links` in Position und Größe angeglichen.
|
||||
- Suchfeld um einen Inline-Button erweitert, um die Suche zusätzlich per Maus auszulösen.
|
||||
|
||||
### Information-Tab
|
||||
- Label-/Icon-Ausrichtung und vertikale Abstände überarbeitet.
|
||||
|
||||
@@ -70,6 +70,57 @@
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="SearchInlineButtonStyle"
|
||||
TargetType="{x:Type Button}">
|
||||
<Setter Property="Background"
|
||||
Value="Transparent" />
|
||||
<Setter Property="BorderBrush"
|
||||
Value="Transparent" />
|
||||
<Setter Property="BorderThickness"
|
||||
Value="0" />
|
||||
<Setter Property="Cursor"
|
||||
Value="Hand" />
|
||||
<Setter Property="Width"
|
||||
Value="32" />
|
||||
<Setter Property="Height"
|
||||
Value="32" />
|
||||
<Setter Property="Padding"
|
||||
Value="0" />
|
||||
<Setter Property="HorizontalAlignment"
|
||||
Value="Right" />
|
||||
<Setter Property="VerticalAlignment"
|
||||
Value="Center" />
|
||||
<Setter Property="Margin"
|
||||
Value="0,0,4,0" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type Button}">
|
||||
<Border x:Name="InlineSearchBorder"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="8">
|
||||
<ContentPresenter HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" />
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsMouseOver"
|
||||
Value="True">
|
||||
<Setter TargetName="InlineSearchBorder"
|
||||
Property="Background"
|
||||
Value="{DynamicResource navigationHoverColor}" />
|
||||
</Trigger>
|
||||
<Trigger Property="IsPressed"
|
||||
Value="True">
|
||||
<Setter Property="Opacity"
|
||||
Value="0.92" />
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</UserControl.Resources>
|
||||
|
||||
<Grid x:Name="GridSsp"
|
||||
@@ -107,25 +158,28 @@
|
||||
VerticalContentAlignment="Center"
|
||||
Padding="0"
|
||||
Canvas.Left="40" />
|
||||
<StackPanel Orientation="Horizontal"
|
||||
Width="350"
|
||||
<Grid Width="320"
|
||||
Height="40"
|
||||
Canvas.Top="56"
|
||||
Canvas.Left="0">
|
||||
Canvas.Left="15">
|
||||
<TextBox x:Name="TxtSearchTerm"
|
||||
x:FieldModifier="private"
|
||||
Style="{StaticResource SearchTextBoxStyle}"
|
||||
Width="320"
|
||||
Height="40"
|
||||
Padding="8,3,42,3"
|
||||
FontSize="14"
|
||||
Panel.ZIndex="1110"
|
||||
KeyDown="OnSearchBoxEnter"
|
||||
Margin="2,0,0,0" />
|
||||
<Image Source="../Resources/icons/light/appbar.magnify.png"
|
||||
Width="48"
|
||||
PreviewMouseDown="OnSearchClicked"
|
||||
Cursor="Hand"
|
||||
Visibility="Collapsed" />
|
||||
</StackPanel>
|
||||
KeyDown="OnSearchBoxEnter" />
|
||||
<Button Style="{StaticResource SearchInlineButtonStyle}"
|
||||
Click="OnSearchButtonClick"
|
||||
ToolTip="{x:Static resx:Resources.search}">
|
||||
<Image Source="{DynamicResource appbar_magnify}"
|
||||
Width="18"
|
||||
Height="18"
|
||||
Tag="MAINICO" />
|
||||
</Button>
|
||||
</Grid>
|
||||
<Canvas Canvas.Top="120"
|
||||
Canvas.Left="0"
|
||||
Width="350"
|
||||
|
||||
@@ -36,14 +36,21 @@ namespace C4IT_CustomerPanel.UserControls
|
||||
{
|
||||
if (e.Key == Key.Enter)
|
||||
{
|
||||
OnSearchClicked(sender, null);
|
||||
ExecuteSearch();
|
||||
e.Handled = true;
|
||||
}
|
||||
}
|
||||
|
||||
private void OnSearchClicked(object sender, MouseButtonEventArgs e)
|
||||
private void OnSearchButtonClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (string.IsNullOrEmpty(TxtSearchTerm.Text.Trim()))
|
||||
ExecuteSearch();
|
||||
}
|
||||
|
||||
private void ExecuteSearch()
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(TxtSearchTerm.Text))
|
||||
return;
|
||||
|
||||
string searchTerm = WebUtility.UrlEncode(TxtSearchTerm.Text.Trim());
|
||||
if (MainWindow.MainInstance.ConfigSettings.GetConfig()._isUUX)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user