mirror of
https://github.com/crskycode/GARbro.git
synced 2024-11-23 13:45:34 +08:00
change background of input textbox on focus/mouseover.
This commit is contained in:
parent
1e390eed1e
commit
29892ff3fd
@ -165,24 +165,19 @@
|
||||
<Style TargetType="{x:Type Separator}" BasedOn="{StaticResource {x:Static ToolBar.SeparatorStyleKey}}">
|
||||
<Setter Property="Margin" Value="5,0,5,0"/>
|
||||
</Style>
|
||||
<!-- Path input textbox mouseover highlight --><!--
|
||||
<!-- Path input textbox mouseover highlight -->
|
||||
<Style TargetType="{x:Type local:ExtAutoCompleteBox}">
|
||||
<Setter Property="Background" Value="White"/>
|
||||
<Style.Triggers>
|
||||
<MultiTrigger>
|
||||
<MultiTrigger.Conditions>
|
||||
<Condition Property="IsFocused" Value="False"/>
|
||||
<Condition Property="IsTextBoxFocused" Value="False"/>
|
||||
<Condition Property="IsMouseOver" Value="False"/>
|
||||
</MultiTrigger.Conditions>
|
||||
<Setter Property="Background" Value="{StaticResource InactiveInputBackground}"/>
|
||||
</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>
|
||||
-->
|
||||
<Style TargetType="{x:Type Image}">
|
||||
<Setter Property="UseLayoutRounding" Value="True"/>
|
||||
<Setter Property="SnapsToDevicePixels" Value="True"/>
|
||||
|
@ -1067,15 +1067,21 @@ namespace GARbro.GUI
|
||||
{
|
||||
public delegate void EnterKeyDownEvent (object sender, KeyEventArgs e);
|
||||
public event EnterKeyDownEvent EnterKeyDown;
|
||||
/*
|
||||
public event EnterKeyDownEvent EnterKeyDown
|
||||
|
||||
public ExtAutoCompleteBox ()
|
||||
{
|
||||
add { AddHandler (KeyEvent, value); }
|
||||
remove { RemoveHandler (KeyEvent, value); }
|
||||
this.GotFocus += (s, e) => { IsTextBoxFocused = true; };
|
||||
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)
|
||||
{
|
||||
@ -1088,9 +1094,6 @@ namespace GARbro.GUI
|
||||
{
|
||||
if (EnterKeyDown != null)
|
||||
EnterKeyDown (this, e);
|
||||
|
||||
// var event_args = new RoutedEventArgs (ExtCompleteBox.EnterKeyEvent);
|
||||
// RaiseEvent (event_args);
|
||||
}
|
||||
|
||||
protected override void OnPopulating (PopulatingEventArgs e)
|
||||
|
Loading…
Reference in New Issue
Block a user