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.
|
- "Neues Ticket erstellen" im Tickets-Tab neu positioniert.
|
||||||
- Such-Textbox im Such-Tab auf dieselbe Größe wie die darunterliegenden Aktionsbuttons vereinheitlicht.
|
- 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.
|
- 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
|
### Information-Tab
|
||||||
- Label-/Icon-Ausrichtung und vertikale Abstände überarbeitet.
|
- Label-/Icon-Ausrichtung und vertikale Abstände überarbeitet.
|
||||||
|
|||||||
@@ -70,6 +70,57 @@
|
|||||||
</Setter.Value>
|
</Setter.Value>
|
||||||
</Setter>
|
</Setter>
|
||||||
</Style>
|
</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>
|
</UserControl.Resources>
|
||||||
|
|
||||||
<Grid x:Name="GridSsp"
|
<Grid x:Name="GridSsp"
|
||||||
@@ -107,25 +158,28 @@
|
|||||||
VerticalContentAlignment="Center"
|
VerticalContentAlignment="Center"
|
||||||
Padding="0"
|
Padding="0"
|
||||||
Canvas.Left="40" />
|
Canvas.Left="40" />
|
||||||
<StackPanel Orientation="Horizontal"
|
<Grid Width="320"
|
||||||
Width="350"
|
Height="40"
|
||||||
Canvas.Top="56"
|
Canvas.Top="56"
|
||||||
Canvas.Left="0">
|
Canvas.Left="15">
|
||||||
<TextBox x:Name="TxtSearchTerm"
|
<TextBox x:Name="TxtSearchTerm"
|
||||||
x:FieldModifier="private"
|
x:FieldModifier="private"
|
||||||
Style="{StaticResource SearchTextBoxStyle}"
|
Style="{StaticResource SearchTextBoxStyle}"
|
||||||
Width="320"
|
Width="320"
|
||||||
Height="40"
|
Height="40"
|
||||||
|
Padding="8,3,42,3"
|
||||||
FontSize="14"
|
FontSize="14"
|
||||||
Panel.ZIndex="1110"
|
Panel.ZIndex="1110"
|
||||||
KeyDown="OnSearchBoxEnter"
|
KeyDown="OnSearchBoxEnter" />
|
||||||
Margin="2,0,0,0" />
|
<Button Style="{StaticResource SearchInlineButtonStyle}"
|
||||||
<Image Source="../Resources/icons/light/appbar.magnify.png"
|
Click="OnSearchButtonClick"
|
||||||
Width="48"
|
ToolTip="{x:Static resx:Resources.search}">
|
||||||
PreviewMouseDown="OnSearchClicked"
|
<Image Source="{DynamicResource appbar_magnify}"
|
||||||
Cursor="Hand"
|
Width="18"
|
||||||
Visibility="Collapsed" />
|
Height="18"
|
||||||
</StackPanel>
|
Tag="MAINICO" />
|
||||||
|
</Button>
|
||||||
|
</Grid>
|
||||||
<Canvas Canvas.Top="120"
|
<Canvas Canvas.Top="120"
|
||||||
Canvas.Left="0"
|
Canvas.Left="0"
|
||||||
Width="350"
|
Width="350"
|
||||||
|
|||||||
@@ -36,14 +36,21 @@ namespace C4IT_CustomerPanel.UserControls
|
|||||||
{
|
{
|
||||||
if (e.Key == Key.Enter)
|
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;
|
return;
|
||||||
|
|
||||||
string searchTerm = WebUtility.UrlEncode(TxtSearchTerm.Text.Trim());
|
string searchTerm = WebUtility.UrlEncode(TxtSearchTerm.Text.Trim());
|
||||||
if (MainWindow.MainInstance.ConfigSettings.GetConfig()._isUUX)
|
if (MainWindow.MainInstance.ConfigSettings.GetConfig()._isUUX)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user