Browse Source

Merge branch 'master' into fix-popup-close

pull/3492/head
Dariusz Komosiński 6 years ago
committed by GitHub
parent
commit
266daced5d
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      native/Avalonia.Native/src/OSX/window.mm
  2. 2
      readme.md
  3. 32
      src/Avalonia.Controls.DataGrid/DataGrid.cs
  4. 16
      src/Avalonia.Controls.DataGrid/DataGridColumnHeader.cs
  5. 15
      src/Avalonia.Controls.DataGrid/Utils/KeyboardHelper.cs
  6. 4
      src/Avalonia.Controls/Calendar/Calendar.cs
  7. 6
      src/Avalonia.Controls/Calendar/CalendarExtensions.cs
  8. 2
      src/Avalonia.Controls/Calendar/CalendarItem.cs
  9. 2
      src/Avalonia.Controls/Calendar/DatePicker.cs
  10. 2
      src/Avalonia.Controls/ComboBox.cs
  11. 2
      src/Avalonia.Controls/Utils/SelectingItemsControlSelectionAdapter.cs
  12. 2
      src/Avalonia.Input/KeyboardNavigationHandler.cs
  13. 3
      src/Avalonia.Themes.Default/ComboBox.xaml
  14. 11
      src/Avalonia.Themes.Default/ListBox.xaml
  15. 9
      src/Avalonia.Themes.Default/Slider.xaml
  16. 3
      src/Avalonia.Themes.Default/TextBox.xaml

7
native/Avalonia.Native/src/OSX/window.mm

@ -805,7 +805,12 @@ NSArray* AllLoopModes = [NSArray arrayWithObjects: NSDefaultRunLoopMode, NSEvent
[self removeTrackingArea:_area]; [self removeTrackingArea:_area];
_area = nullptr; _area = nullptr;
} }
if (_parent == nullptr)
{
return;
}
NSRect rect = NSZeroRect; NSRect rect = NSZeroRect;
rect.size = newSize; rect.size = newSize;

2
readme.md

@ -16,6 +16,8 @@
|---|---|---| |---|---|---|
| <a href='https://youtu.be/wHcB3sGLVYg'><img width='300' src='http://avaloniaui.net/images/screen.png'></a> | <a href='https://www.youtube.com/watch?t=28&v=c_AB_XSILp0' target='_blank'><img width='300' src='http://avaloniaui.net/images/avalonia-video.png'></a> | <a href='https://www.youtube.com/watch?v=NJ9-hnmUbBM' target='_blank'><img width='300' src='https://i.ytimg.com/vi/NJ9-hnmUbBM/hqdefault.jpg'></a> | | <a href='https://youtu.be/wHcB3sGLVYg'><img width='300' src='http://avaloniaui.net/images/screen.png'></a> | <a href='https://www.youtube.com/watch?t=28&v=c_AB_XSILp0' target='_blank'><img width='300' src='http://avaloniaui.net/images/avalonia-video.png'></a> | <a href='https://www.youtube.com/watch?v=NJ9-hnmUbBM' target='_blank'><img width='300' src='https://i.ytimg.com/vi/NJ9-hnmUbBM/hqdefault.jpg'></a> |
[Awesome Avalonia](https://github.com/AvaloniaCommunity/awesome-avalonia) is curated list of awesome Avalonia UI tools, libraries, projects and resources.
## Getting Started ## Getting Started
Avalonia [Visual Studio Extension](https://marketplace.visualstudio.com/items?itemName=AvaloniaTeam.AvaloniaforVisualStudio) contains project and control templates that will help you get started. After installing it, open "New Project" dialog in Visual Studio, choose "Avalonia" in "Visual C#" section, select "Avalonia .NET Core Application" and press OK (<a href="http://avaloniaui.net/docs/quickstart/images/new-project-dialog.png">screenshot</a>). Now you can write code and markup that will work on multiple platforms! Avalonia [Visual Studio Extension](https://marketplace.visualstudio.com/items?itemName=AvaloniaTeam.AvaloniaforVisualStudio) contains project and control templates that will help you get started. After installing it, open "New Project" dialog in Visual Studio, choose "Avalonia" in "Visual C#" section, select "Avalonia .NET Core Application" and press OK (<a href="http://avaloniaui.net/docs/quickstart/images/new-project-dialog.png">screenshot</a>). Now you can write code and markup that will work on multiple platforms!

32
src/Avalonia.Controls.DataGrid/DataGrid.cs

@ -2472,25 +2472,25 @@ namespace Avalonia.Controls
internal bool ProcessDownKey(KeyEventArgs e) internal bool ProcessDownKey(KeyEventArgs e)
{ {
KeyboardHelper.GetMetaKeyState(e.Modifiers, out bool ctrl, out bool shift); KeyboardHelper.GetMetaKeyState(e.KeyModifiers, out bool ctrl, out bool shift);
return ProcessDownKeyInternal(shift, ctrl); return ProcessDownKeyInternal(shift, ctrl);
} }
internal bool ProcessEndKey(KeyEventArgs e) internal bool ProcessEndKey(KeyEventArgs e)
{ {
KeyboardHelper.GetMetaKeyState(e.Modifiers, out bool ctrl, out bool shift); KeyboardHelper.GetMetaKeyState(e.KeyModifiers, out bool ctrl, out bool shift);
return ProcessEndKey(shift, ctrl); return ProcessEndKey(shift, ctrl);
} }
internal bool ProcessEnterKey(KeyEventArgs e) internal bool ProcessEnterKey(KeyEventArgs e)
{ {
KeyboardHelper.GetMetaKeyState(e.Modifiers, out bool ctrl, out bool shift); KeyboardHelper.GetMetaKeyState(e.KeyModifiers, out bool ctrl, out bool shift);
return ProcessEnterKey(shift, ctrl); return ProcessEnterKey(shift, ctrl);
} }
internal bool ProcessHomeKey(KeyEventArgs e) internal bool ProcessHomeKey(KeyEventArgs e)
{ {
KeyboardHelper.GetMetaKeyState(e.Modifiers, out bool ctrl, out bool shift); KeyboardHelper.GetMetaKeyState(e.KeyModifiers, out bool ctrl, out bool shift);
return ProcessHomeKey(shift, ctrl); return ProcessHomeKey(shift, ctrl);
} }
@ -2530,25 +2530,25 @@ namespace Avalonia.Controls
internal bool ProcessLeftKey(KeyEventArgs e) internal bool ProcessLeftKey(KeyEventArgs e)
{ {
KeyboardHelper.GetMetaKeyState(e.Modifiers, out bool ctrl, out bool shift); KeyboardHelper.GetMetaKeyState(e.KeyModifiers, out bool ctrl, out bool shift);
return ProcessLeftKey(shift, ctrl); return ProcessLeftKey(shift, ctrl);
} }
internal bool ProcessNextKey(KeyEventArgs e) internal bool ProcessNextKey(KeyEventArgs e)
{ {
KeyboardHelper.GetMetaKeyState(e.Modifiers, out bool ctrl, out bool shift); KeyboardHelper.GetMetaKeyState(e.KeyModifiers, out bool ctrl, out bool shift);
return ProcessNextKey(shift, ctrl); return ProcessNextKey(shift, ctrl);
} }
internal bool ProcessPriorKey(KeyEventArgs e) internal bool ProcessPriorKey(KeyEventArgs e)
{ {
KeyboardHelper.GetMetaKeyState(e.Modifiers, out bool ctrl, out bool shift); KeyboardHelper.GetMetaKeyState(e.KeyModifiers, out bool ctrl, out bool shift);
return ProcessPriorKey(shift, ctrl); return ProcessPriorKey(shift, ctrl);
} }
internal bool ProcessRightKey(KeyEventArgs e) internal bool ProcessRightKey(KeyEventArgs e)
{ {
KeyboardHelper.GetMetaKeyState(e.Modifiers, out bool ctrl, out bool shift); KeyboardHelper.GetMetaKeyState(e.KeyModifiers, out bool ctrl, out bool shift);
return ProcessRightKey(shift, ctrl); return ProcessRightKey(shift, ctrl);
} }
@ -2666,7 +2666,7 @@ namespace Avalonia.Controls
internal bool ProcessUpKey(KeyEventArgs e) internal bool ProcessUpKey(KeyEventArgs e)
{ {
KeyboardHelper.GetMetaKeyState(e.Modifiers, out bool ctrl, out bool shift); KeyboardHelper.GetMetaKeyState(e.KeyModifiers, out bool ctrl, out bool shift);
return ProcessUpKey(shift, ctrl); return ProcessUpKey(shift, ctrl);
} }
@ -2934,7 +2934,7 @@ namespace Avalonia.Controls
//TODO: Ensure left button is checked for //TODO: Ensure left button is checked for
internal bool UpdateStateOnMouseLeftButtonDown(PointerPressedEventArgs pointerPressedEventArgs, int columnIndex, int slot, bool allowEdit) internal bool UpdateStateOnMouseLeftButtonDown(PointerPressedEventArgs pointerPressedEventArgs, int columnIndex, int slot, bool allowEdit)
{ {
KeyboardHelper.GetMetaKeyState(pointerPressedEventArgs.InputModifiers, out bool ctrl, out bool shift); KeyboardHelper.GetMetaKeyState(pointerPressedEventArgs.KeyModifiers, out bool ctrl, out bool shift);
return UpdateStateOnMouseLeftButtonDown(pointerPressedEventArgs, columnIndex, slot, allowEdit, shift, ctrl); return UpdateStateOnMouseLeftButtonDown(pointerPressedEventArgs, columnIndex, slot, allowEdit, shift, ctrl);
} }
@ -4376,7 +4376,7 @@ namespace Avalonia.Controls
private bool ProcessAKey(KeyEventArgs e) private bool ProcessAKey(KeyEventArgs e)
{ {
KeyboardHelper.GetMetaKeyState(e.Modifiers, out bool ctrl, out bool shift, out bool alt); KeyboardHelper.GetMetaKeyState(e.KeyModifiers, out bool ctrl, out bool shift, out bool alt);
if (ctrl && !shift && !alt && SelectionMode == DataGridSelectionMode.Extended) if (ctrl && !shift && !alt && SelectionMode == DataGridSelectionMode.Extended)
{ {
@ -4442,10 +4442,10 @@ namespace Avalonia.Controls
return ProcessAKey(e); return ProcessAKey(e);
case Key.C: case Key.C:
return ProcessCopyKey(e.Modifiers); return ProcessCopyKey(e.KeyModifiers);
case Key.Insert: case Key.Insert:
return ProcessCopyKey(e.Modifiers); return ProcessCopyKey(e.KeyModifiers);
} }
if (focusDataGrid) if (focusDataGrid)
{ {
@ -4644,7 +4644,7 @@ namespace Avalonia.Controls
private bool ProcessF2Key(KeyEventArgs e) private bool ProcessF2Key(KeyEventArgs e)
{ {
KeyboardHelper.GetMetaKeyState(e.Modifiers, out bool ctrl, out bool shift); KeyboardHelper.GetMetaKeyState(e.KeyModifiers, out bool ctrl, out bool shift);
if (!shift && !ctrl && if (!shift && !ctrl &&
_editingColumnIndex == -1 && CurrentColumnIndex != -1 && GetRowSelection(CurrentSlot) && _editingColumnIndex == -1 && CurrentColumnIndex != -1 && GetRowSelection(CurrentSlot) &&
@ -5001,7 +5001,7 @@ namespace Avalonia.Controls
private bool ProcessTabKey(KeyEventArgs e) private bool ProcessTabKey(KeyEventArgs e)
{ {
KeyboardHelper.GetMetaKeyState(e.Modifiers, out bool ctrl, out bool shift); KeyboardHelper.GetMetaKeyState(e.KeyModifiers, out bool ctrl, out bool shift);
return ProcessTabKey(e, shift, ctrl); return ProcessTabKey(e, shift, ctrl);
} }
@ -5787,7 +5787,7 @@ namespace Avalonia.Controls
/// to the Clipboard as text. /// to the Clipboard as text.
/// </summary> /// </summary>
/// <returns>Whether or not the DataGrid handled the key press.</returns> /// <returns>Whether or not the DataGrid handled the key press.</returns>
private bool ProcessCopyKey(InputModifiers modifiers) private bool ProcessCopyKey(KeyModifiers modifiers)
{ {
KeyboardHelper.GetMetaKeyState(modifiers, out bool ctrl, out bool shift, out bool alt); KeyboardHelper.GetMetaKeyState(modifiers, out bool ctrl, out bool shift, out bool alt);

16
src/Avalonia.Controls.DataGrid/DataGridColumnHeader.cs

@ -190,28 +190,28 @@ namespace Avalonia.Controls
} }
} }
internal void OnMouseLeftButtonUp_Click(InputModifiers inputModifiers, ref bool handled) internal void OnMouseLeftButtonUp_Click(KeyModifiers keyModifiers, ref bool handled)
{ {
// completed a click without dragging, so we're sorting // completed a click without dragging, so we're sorting
InvokeProcessSort(inputModifiers); InvokeProcessSort(keyModifiers);
handled = true; handled = true;
} }
internal void InvokeProcessSort(InputModifiers inputModifiers) internal void InvokeProcessSort(KeyModifiers keyModifiers)
{ {
Debug.Assert(OwningGrid != null); Debug.Assert(OwningGrid != null);
if (OwningGrid.WaitForLostFocus(() => InvokeProcessSort(inputModifiers))) if (OwningGrid.WaitForLostFocus(() => InvokeProcessSort(keyModifiers)))
{ {
return; return;
} }
if (OwningGrid.CommitEdit(DataGridEditingUnit.Row, exitEditingMode: true)) if (OwningGrid.CommitEdit(DataGridEditingUnit.Row, exitEditingMode: true))
{ {
Avalonia.Threading.Dispatcher.UIThread.Post(() => ProcessSort(inputModifiers)); Avalonia.Threading.Dispatcher.UIThread.Post(() => ProcessSort(keyModifiers));
} }
} }
//TODO GroupSorting //TODO GroupSorting
internal void ProcessSort(InputModifiers inputModifiers) internal void ProcessSort(KeyModifiers keyModifiers)
{ {
// if we can sort: // if we can sort:
// - DataConnection.AllowSort is true, and // - DataConnection.AllowSort is true, and
@ -233,7 +233,7 @@ namespace Avalonia.Controls
DataGridSortDescription newSort; DataGridSortDescription newSort;
KeyboardHelper.GetMetaKeyState(inputModifiers, out bool ctrl, out bool shift); KeyboardHelper.GetMetaKeyState(keyModifiers, out bool ctrl, out bool shift);
DataGridSortDescription sort = OwningColumn.GetSortDescription(); DataGridSortDescription sort = OwningColumn.GetSortDescription();
IDataGridCollectionView collectionView = owningGrid.DataConnection.CollectionView; IDataGridCollectionView collectionView = owningGrid.DataConnection.CollectionView;
@ -371,7 +371,7 @@ namespace Avalonia.Controls
{ {
if (_dragMode == DragMode.MouseDown) if (_dragMode == DragMode.MouseDown)
{ {
OnMouseLeftButtonUp_Click(args.InputModifiers, ref handled); OnMouseLeftButtonUp_Click(args.KeyModifiers, ref handled);
} }
else if (_dragMode == DragMode.Reorder) else if (_dragMode == DragMode.Reorder)
{ {

15
src/Avalonia.Controls.DataGrid/Utils/KeyboardHelper.cs

@ -9,16 +9,17 @@ namespace Avalonia.Controls.Utils
{ {
internal static class KeyboardHelper internal static class KeyboardHelper
{ {
public static void GetMetaKeyState(InputModifiers modifiers, out bool ctrl, out bool shift) public static void GetMetaKeyState(KeyModifiers modifiers, out bool ctrl, out bool shift)
{ {
ctrl = (modifiers & InputModifiers.Control) == InputModifiers.Control; ctrl = (modifiers & KeyModifiers.Control) == KeyModifiers.Control;
shift = (modifiers & InputModifiers.Shift) == InputModifiers.Shift; shift = (modifiers & KeyModifiers.Shift) == KeyModifiers.Shift;
} }
public static void GetMetaKeyState(InputModifiers modifiers, out bool ctrl, out bool shift, out bool alt)
public static void GetMetaKeyState(KeyModifiers modifiers, out bool ctrl, out bool shift, out bool alt)
{ {
ctrl = (modifiers & InputModifiers.Control) == InputModifiers.Control; ctrl = (modifiers & KeyModifiers.Control) == KeyModifiers.Control;
shift = (modifiers & InputModifiers.Shift) == InputModifiers.Shift; shift = (modifiers & KeyModifiers.Shift) == KeyModifiers.Shift;
alt = (modifiers & InputModifiers.Alt) == InputModifiers.Alt; alt = (modifiers & KeyModifiers.Alt) == KeyModifiers.Alt;
} }
} }
} }

4
src/Avalonia.Controls/Calendar/Calendar.cs

@ -1575,7 +1575,7 @@ namespace Avalonia.Controls
base.OnPointerWheelChanged(e); base.OnPointerWheelChanged(e);
if (!e.Handled) if (!e.Handled)
{ {
CalendarExtensions.GetMetaKeyState(e.InputModifiers, out bool ctrl, out bool shift); CalendarExtensions.GetMetaKeyState(e.KeyModifiers, out bool ctrl, out bool shift);
if (!ctrl) if (!ctrl)
{ {
@ -1631,7 +1631,7 @@ namespace Avalonia.Controls
// Some keys (e.g. Left/Right) need to be translated in RightToLeft mode // Some keys (e.g. Left/Right) need to be translated in RightToLeft mode
Key invariantKey = e.Key; //InteractionHelper.GetLogicalKey(FlowDirection, e.Key); Key invariantKey = e.Key; //InteractionHelper.GetLogicalKey(FlowDirection, e.Key);
CalendarExtensions.GetMetaKeyState(e.Modifiers, out bool ctrl, out bool shift); CalendarExtensions.GetMetaKeyState(e.KeyModifiers, out bool ctrl, out bool shift);
switch (invariantKey) switch (invariantKey)
{ {

6
src/Avalonia.Controls/Calendar/CalendarExtensions.cs

@ -9,10 +9,10 @@ namespace Avalonia.Controls.Primitives
{ {
internal static class CalendarExtensions internal static class CalendarExtensions
{ {
public static void GetMetaKeyState(InputModifiers modifiers, out bool ctrl, out bool shift) public static void GetMetaKeyState(KeyModifiers modifiers, out bool ctrl, out bool shift)
{ {
ctrl = (modifiers & InputModifiers.Control) == InputModifiers.Control; ctrl = (modifiers & KeyModifiers.Control) == KeyModifiers.Control;
shift = (modifiers & InputModifiers.Shift) == InputModifiers.Shift; shift = (modifiers & KeyModifiers.Shift) == KeyModifiers.Shift;
} }
} }
} }

2
src/Avalonia.Controls/Calendar/CalendarItem.cs

@ -958,7 +958,7 @@ namespace Avalonia.Controls.Primitives
} }
bool ctrl, shift; bool ctrl, shift;
CalendarExtensions.GetMetaKeyState(e.InputModifiers, out ctrl, out shift); CalendarExtensions.GetMetaKeyState(e.KeyModifiers, out ctrl, out shift);
CalendarDayButton b = sender as CalendarDayButton; CalendarDayButton b = sender as CalendarDayButton;
if (b != null) if (b != null)

2
src/Avalonia.Controls/Calendar/DatePicker.cs

@ -1008,7 +1008,7 @@ namespace Avalonia.Controls
} }
case Key.Down: case Key.Down:
{ {
if ((e.Modifiers & InputModifiers.Control) == InputModifiers.Control) if ((e.KeyModifiers & KeyModifiers.Control) == KeyModifiers.Control)
{ {
HandlePopUp(); HandlePopUp();
return true; return true;

2
src/Avalonia.Controls/ComboBox.cs

@ -130,7 +130,7 @@ namespace Avalonia.Controls
return; return;
if (e.Key == Key.F4 || if (e.Key == Key.F4 ||
((e.Key == Key.Down || e.Key == Key.Up) && ((e.Modifiers & InputModifiers.Alt) != 0))) ((e.Key == Key.Down || e.Key == Key.Up) && ((e.KeyModifiers & KeyModifiers.Alt) != 0)))
{ {
IsDropDownOpen = !IsDropDownOpen; IsDropDownOpen = !IsDropDownOpen;
e.Handled = true; e.Handled = true;

2
src/Avalonia.Controls/Utils/SelectingItemsControlSelectionAdapter.cs

@ -261,7 +261,7 @@ namespace Avalonia.Controls.Utils
break; break;
case Key.Down: case Key.Down:
if ((e.Modifiers & InputModifiers.Alt) == InputModifiers.None) if ((e.KeyModifiers & KeyModifiers.Alt) == KeyModifiers.None)
{ {
SelectedIndexIncrement(); SelectedIndexIncrement();
e.Handled = true; e.Handled = true;

2
src/Avalonia.Input/KeyboardNavigationHandler.cs

@ -124,7 +124,7 @@ namespace Avalonia.Input
if (current != null && e.Key == Key.Tab) if (current != null && e.Key == Key.Tab)
{ {
var direction = (e.Modifiers & InputModifiers.Shift) == 0 ? var direction = (e.KeyModifiers & KeyModifiers.Shift) == 0 ?
NavigationDirection.Next : NavigationDirection.Previous; NavigationDirection.Next : NavigationDirection.Previous;
Move(current, direction, e.Modifiers); Move(current, direction, e.Modifiers);
e.Handled = true; e.Handled = true;

3
src/Avalonia.Themes.Default/ComboBox.xaml

@ -58,4 +58,7 @@
<Style Selector="ComboBox:pointerover /template/ Border#border"> <Style Selector="ComboBox:pointerover /template/ Border#border">
<Setter Property="BorderBrush" Value="{DynamicResource ThemeBorderHighBrush}"/> <Setter Property="BorderBrush" Value="{DynamicResource ThemeBorderHighBrush}"/>
</Style> </Style>
<Style Selector="ComboBox:disabled /template/ Border#border">
<Setter Property="Opacity" Value="{DynamicResource ThemeDisabledOpacity}" />
</Style>
</Styles> </Styles>

11
src/Avalonia.Themes.Default/ListBox.xaml

@ -1,4 +1,5 @@
<Style xmlns="https://github.com/avaloniaui" Selector="ListBox"> <Styles xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Style Selector="ListBox">
<Setter Property="Background" Value="{DynamicResource ThemeBackgroundBrush}"/> <Setter Property="Background" Value="{DynamicResource ThemeBackgroundBrush}"/>
<Setter Property="BorderBrush" Value="{DynamicResource ThemeBorderMidBrush}"/> <Setter Property="BorderBrush" Value="{DynamicResource ThemeBorderMidBrush}"/>
<Setter Property="BorderThickness" Value="{DynamicResource ThemeBorderThickness}"/> <Setter Property="BorderThickness" Value="{DynamicResource ThemeBorderThickness}"/>
@ -7,7 +8,7 @@
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/> <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
<Setter Property="Template"> <Setter Property="Template">
<ControlTemplate> <ControlTemplate>
<Border BorderBrush="{TemplateBinding BorderBrush}" <Border Name="border" BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"> BorderThickness="{TemplateBinding BorderThickness}">
<ScrollViewer Name="PART_ScrollViewer" <ScrollViewer Name="PART_ScrollViewer"
Background="{TemplateBinding Background}" Background="{TemplateBinding Background}"
@ -23,4 +24,8 @@
</Border> </Border>
</ControlTemplate> </ControlTemplate>
</Setter> </Setter>
</Style> </Style>
<Style Selector="ListBox:disabled /template/ Border#border">
<Setter Property="Opacity" Value="{DynamicResource ThemeDisabledOpacity}" />
</Style>
</Styles>

9
src/Avalonia.Themes.Default/Slider.xaml

@ -4,7 +4,7 @@
<Setter Property="MinHeight" Value="20"/> <Setter Property="MinHeight" Value="20"/>
<Setter Property="Template"> <Setter Property="Template">
<ControlTemplate> <ControlTemplate>
<Grid> <Grid Name="grid">
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="Auto"/> <RowDefinition Height="Auto"/>
<RowDefinition Height="Auto" MinHeight="20"/> <RowDefinition Height="Auto" MinHeight="20"/>
@ -20,7 +20,7 @@
<RepeatButton Name="PART_IncreaseButton" <RepeatButton Name="PART_IncreaseButton"
Classes="repeattrack" /> Classes="repeattrack" />
</Track.IncreaseButton> </Track.IncreaseButton>
<Thumb MinWidth="20" MinHeight="20"> <Thumb Name="thumb" MinWidth="20" MinHeight="20">
<Thumb.Template> <Thumb.Template>
<ControlTemplate> <ControlTemplate>
<Grid> <Grid>
@ -55,7 +55,7 @@
<RepeatButton Name="PART_IncreaseButton" <RepeatButton Name="PART_IncreaseButton"
Classes="repeattrack" /> Classes="repeattrack" />
</Track.IncreaseButton> </Track.IncreaseButton>
<Thumb MinWidth="20" MinHeight="20"> <Thumb Name="thumb" MinWidth="20" MinHeight="20">
<Thumb.Template> <Thumb.Template>
<ControlTemplate> <ControlTemplate>
<Grid> <Grid>
@ -87,4 +87,7 @@
</ControlTemplate> </ControlTemplate>
</Setter> </Setter>
</Style> </Style>
<Style Selector="Slider:disabled /template/ Grid#grid">
<Setter Property="Opacity" Value="{DynamicResource ThemeDisabledOpacity}" />
</Style>
</Styles> </Styles>

3
src/Avalonia.Themes.Default/TextBox.xaml

@ -70,4 +70,7 @@
<Style Selector="TextBox"> <Style Selector="TextBox">
<Setter Property="Cursor" Value="IBeam" /> <Setter Property="Cursor" Value="IBeam" />
</Style> </Style>
<Style Selector="TextBox:disabled /template/ Border#border">
<Setter Property="Opacity" Value="{DynamicResource ThemeDisabledOpacity}" />
</Style>
</Styles> </Styles>

Loading…
Cancel
Save