mirror of
https://github.com/crskycode/GARbro.git
synced 2026-07-08 01:30:18 +08:00
change background of input textbox on focus/mouseover.
This commit is contained in:
@@ -165,24 +165,19 @@
|
|||||||
<Style TargetType="{x:Type Separator}" BasedOn="{StaticResource {x:Static ToolBar.SeparatorStyleKey}}">
|
<Style TargetType="{x:Type Separator}" BasedOn="{StaticResource {x:Static ToolBar.SeparatorStyleKey}}">
|
||||||
<Setter Property="Margin" Value="5,0,5,0"/>
|
<Setter Property="Margin" Value="5,0,5,0"/>
|
||||||
</Style>
|
</Style>
|
||||||
<!-- Path input textbox mouseover highlight --><!--
|
<!-- Path input textbox mouseover highlight -->
|
||||||
<Style TargetType="{x:Type local:ExtAutoCompleteBox}">
|
<Style TargetType="{x:Type local:ExtAutoCompleteBox}">
|
||||||
|
<Setter Property="Background" Value="White"/>
|
||||||
<Style.Triggers>
|
<Style.Triggers>
|
||||||
<MultiTrigger>
|
<MultiTrigger>
|
||||||
<MultiTrigger.Conditions>
|
<MultiTrigger.Conditions>
|
||||||
<Condition Property="IsFocused" Value="False"/>
|
<Condition Property="IsTextBoxFocused" Value="False"/>
|
||||||
|
<Condition Property="IsMouseOver" Value="False"/>
|
||||||
</MultiTrigger.Conditions>
|
</MultiTrigger.Conditions>
|
||||||
<Setter Property="Background" Value="{StaticResource InactiveInputBackground}"/>
|
<Setter Property="Background" Value="{StaticResource InactiveInputBackground}"/>
|
||||||
</MultiTrigger>
|
</MultiTrigger>
|
||||||
<Trigger Property="IsMouseOver" Value="True">
|
|
||||||
<Setter Property="Background" Value="White"/>
|
|
||||||
</Trigger>
|
|
||||||
<Trigger Property="IsFocused" Value="True">
|
|
||||||
<Setter Property="Background" Value="White"/>
|
|
||||||
</Trigger>
|
|
||||||
</Style.Triggers>
|
</Style.Triggers>
|
||||||
</Style>
|
</Style>
|
||||||
-->
|
|
||||||
<Style TargetType="{x:Type Image}">
|
<Style TargetType="{x:Type Image}">
|
||||||
<Setter Property="UseLayoutRounding" Value="True"/>
|
<Setter Property="UseLayoutRounding" Value="True"/>
|
||||||
<Setter Property="SnapsToDevicePixels" Value="True"/>
|
<Setter Property="SnapsToDevicePixels" Value="True"/>
|
||||||
|
|||||||
@@ -1067,15 +1067,21 @@ namespace GARbro.GUI
|
|||||||
{
|
{
|
||||||
public delegate void EnterKeyDownEvent (object sender, KeyEventArgs e);
|
public delegate void EnterKeyDownEvent (object sender, KeyEventArgs e);
|
||||||
public event EnterKeyDownEvent EnterKeyDown;
|
public event EnterKeyDownEvent EnterKeyDown;
|
||||||
/*
|
|
||||||
public event EnterKeyDownEvent EnterKeyDown
|
public ExtAutoCompleteBox ()
|
||||||
{
|
{
|
||||||
add { AddHandler (KeyEvent, value); }
|
this.GotFocus += (s, e) => { IsTextBoxFocused = true; };
|
||||||
remove { RemoveHandler (KeyEvent, value); }
|
this.LostFocus += (s, e) => { IsTextBoxFocused = false; };
|
||||||
}
|
}
|
||||||
public static readonly RoutedEvent EnterKeyEvent = EventManager.RegisterRoutedEvent(
|
|
||||||
"EnterKeyDown", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(ExtAutoCompleteBox));
|
public bool IsTextBoxFocused
|
||||||
*/
|
{
|
||||||
|
get { return (bool)GetValue (HasFocusProperty); }
|
||||||
|
private set { SetValue (HasFocusProperty, value); }
|
||||||
|
}
|
||||||
|
|
||||||
|
public static readonly DependencyProperty HasFocusProperty =
|
||||||
|
DependencyProperty.RegisterAttached ("IsTextBoxFocused", typeof(bool), typeof(ExtAutoCompleteBox), new UIPropertyMetadata());
|
||||||
|
|
||||||
protected override void OnKeyDown (KeyEventArgs e)
|
protected override void OnKeyDown (KeyEventArgs e)
|
||||||
{
|
{
|
||||||
@@ -1088,9 +1094,6 @@ namespace GARbro.GUI
|
|||||||
{
|
{
|
||||||
if (EnterKeyDown != null)
|
if (EnterKeyDown != null)
|
||||||
EnterKeyDown (this, e);
|
EnterKeyDown (this, e);
|
||||||
|
|
||||||
// var event_args = new RoutedEventArgs (ExtCompleteBox.EnterKeyEvent);
|
|
||||||
// RaiseEvent (event_args);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnPopulating (PopulatingEventArgs e)
|
protected override void OnPopulating (PopulatingEventArgs e)
|
||||||
|
|||||||
Reference in New Issue
Block a user