Browse Source
Merge branch 'master' into feature/ImageScaleMode
pull/1762/head
Jumar Macato
8 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with
18 additions and
3 deletions
-
samples/ControlCatalog/Pages/TextBoxPage.xaml
-
src/Avalonia.Controls/Presenters/TextPresenter.cs
-
src/Avalonia.Controls/TextBox.cs
|
|
|
@ -9,6 +9,7 @@ |
|
|
|
Gap="16"> |
|
|
|
<StackPanel Orientation="Vertical" Gap="8"> |
|
|
|
<TextBox Text="Lorem ipsum dolor sit amet, consectetur adipiscing elit." Width="200" /> |
|
|
|
<TextBox Watermark="ReadOnly" IsReadOnly="True" Text="This is read only"/> |
|
|
|
<TextBox Width="200" Watermark="Watermark" /> |
|
|
|
<TextBox Width="200" |
|
|
|
Watermark="Floating Watermark" |
|
|
|
|
|
|
|
@ -189,6 +189,12 @@ namespace Avalonia.Controls.Presenters |
|
|
|
_caretTimer.Start(); |
|
|
|
InvalidateVisual(); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
_caretTimer.Start(); |
|
|
|
InvalidateVisual(); |
|
|
|
_caretTimer.Stop(); |
|
|
|
} |
|
|
|
|
|
|
|
if (IsMeasureValid) |
|
|
|
{ |
|
|
|
|
|
|
|
@ -124,7 +124,7 @@ namespace Avalonia.Controls |
|
|
|
ScrollViewer.HorizontalScrollBarVisibilityProperty, |
|
|
|
horizontalScrollBarVisibility, |
|
|
|
BindingPriority.Style); |
|
|
|
_undoRedoHelper = new UndoRedoHelper<UndoRedoState>(this); |
|
|
|
_undoRedoHelper = new UndoRedoHelper<UndoRedoState>(this); |
|
|
|
} |
|
|
|
|
|
|
|
public bool AcceptsReturn |
|
|
|
@ -262,7 +262,7 @@ namespace Avalonia.Controls |
|
|
|
|
|
|
|
if (IsFocused) |
|
|
|
{ |
|
|
|
_presenter.ShowCaret(); |
|
|
|
DecideCaretVisibility(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -282,12 +282,20 @@ namespace Avalonia.Controls |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
_presenter?.ShowCaret(); |
|
|
|
DecideCaretVisibility(); |
|
|
|
} |
|
|
|
|
|
|
|
e.Handled = true; |
|
|
|
} |
|
|
|
|
|
|
|
private void DecideCaretVisibility() |
|
|
|
{ |
|
|
|
if (!IsReadOnly) |
|
|
|
_presenter?.ShowCaret(); |
|
|
|
else |
|
|
|
_presenter?.HideCaret(); |
|
|
|
} |
|
|
|
|
|
|
|
protected override void OnLostFocus(RoutedEventArgs e) |
|
|
|
{ |
|
|
|
base.OnLostFocus(e); |
|
|
|
|