Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,11 @@ private void CanvasTextBoxBoldButton_Clicked(object sender, RoutedEventArgs e)
}
}

private void CanvasTextBoxItlaicButton_Clicked(object sender, RoutedEventArgs e)
private void CanvasTextBoxItalicButton_Clicked(object sender, RoutedEventArgs e)
{
if (SelectedTextDrawable != null)
{
_drawingSurfaceRenderer.ExecuteUpdateTextBoxStyle(_canvasTextBoxItlaicButton.IsChecked ?? false);
_drawingSurfaceRenderer.ExecuteUpdateTextBoxStyle(_canvasTextBoxItalicButton.IsChecked ?? false);
_canvasTextBox.UpdateFontStyle(SelectedTextDrawable.IsItalic);
ReDrawCanvas();
}
Expand Down Expand Up @@ -154,7 +154,7 @@ private void CanvasTextBox_TextChanged(object sender, string text)
text,
_canvasTextBoxColorPicker.Color,
_canvasTextBoxBoldButton.IsChecked ?? false,
_canvasTextBoxItlaicButton.IsChecked ?? false);
_canvasTextBoxItalicButton.IsChecked ?? false);

ReDrawCanvas();
_drawingSurfaceRenderer.UpdateSelectedTextDrawable();
Expand Down Expand Up @@ -184,13 +184,13 @@ private void InkScrollViewer_PointerPressed(object sender, PointerRoutedEventArg
_canvasTextBoxColorPicker.Color = SelectedTextDrawable.TextColor;
_canvasTextBoxFontSizeTextBox.Text = SelectedTextDrawable.FontSize.ToString();
_canvasTextBoxBoldButton.IsChecked = SelectedTextDrawable.IsBold;
_canvasTextBoxItlaicButton.IsChecked = SelectedTextDrawable.IsBold;
_canvasTextBoxItalicButton.IsChecked = SelectedTextDrawable.IsItalic;

return;
}

_canvasTextBox.UpdateFontSize(TextFontSize);
_canvasTextBox.UpdateFontStyle(_canvasTextBoxItlaicButton.IsChecked ?? false);
_canvasTextBox.UpdateFontStyle(_canvasTextBoxItalicButton.IsChecked ?? false);
_canvasTextBox.UpdateFontWeight(_canvasTextBoxBoldButton.IsChecked ?? false);

_inkCanvas.Visibility = Visibility.Collapsed;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public partial class InfiniteCanvas : Control
private ColorPicker _canvasTextBoxColorPicker;

private TextBox _canvasTextBoxFontSizeTextBox;
private ToggleButton _canvasTextBoxItlaicButton;
private ToggleButton _canvasTextBoxItalicButton;
private ToggleButton _canvasTextBoxBoldButton;
private Button _undoButton;
private Button _redoButton;
Expand Down Expand Up @@ -166,7 +166,7 @@ protected override void OnApplyTemplate()
_canvasTextBoxTools = (StackPanel)GetTemplateChild("CanvasTextBoxTools");
_canvasTextBoxColorPicker = (ColorPicker)GetTemplateChild("CanvasTextBoxColorPicker");
_canvasTextBoxFontSizeTextBox = (TextBox)GetTemplateChild("CanvasTextBoxFontSizeTextBox");
_canvasTextBoxItlaicButton = (ToggleButton)GetTemplateChild("CanvasTextBoxItlaicButton");
_canvasTextBoxItalicButton = (ToggleButton)GetTemplateChild("CanvasTextBoxItalicButton");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was going to say changing the name in the Style is going to be a breaking change, but we don't actually call them out as TemplateParts like we should... (for instance see TabView).

@BurkusCat would you be up for fixing that too? Let me know if you want to do it as part of this change or another.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@michael-hawker I can take a look at that next weekend.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@BurkasCat I'm approving this PR, just let me know, but we can merge this one first, and just open another one for those changes if you get to them. Thanks for the contribution! 🎉

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@BurkusCat Is there any update on this or still being worked on?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Kyaa-dost Apologies, I did not get a chance to look at this. I can try take a look at this on this weekend if it suits.

_canvasTextBoxBoldButton = (ToggleButton)GetTemplateChild("CanvasTextBoxBoldButton");
_drawingSurfaceRenderer = (InfiniteCanvasVirtualDrawingSurface)GetTemplateChild("DrawingSurfaceRenderer");
_mainContainer = (Canvas)GetTemplateChild("MainContainer");
Expand Down Expand Up @@ -204,7 +204,7 @@ protected override void OnApplyTemplate()
private void UnRegisterEvents()
{
_canvasTextBoxFontSizeTextBox.TextChanged -= CanvasTextBoxFontSizeTextBox_TextChanged;
_canvasTextBoxItlaicButton.Click -= CanvasTextBoxItlaicButton_Clicked;
_canvasTextBoxItalicButton.Click -= CanvasTextBoxItalicButton_Clicked;
_canvasTextBoxBoldButton.Click -= CanvasTextBoxBoldButton_Clicked;
_canvasTextBoxColorPicker.ColorChanged -= CanvasTextBoxColorPicker_ColorChanged;
_enableTouchInkingButton.Checked -= EnableTouchInkingButton_Checked;
Expand All @@ -228,7 +228,7 @@ private void UnRegisterEvents()
private void RegisterEvents()
{
_canvasTextBoxFontSizeTextBox.TextChanged += CanvasTextBoxFontSizeTextBox_TextChanged;
_canvasTextBoxItlaicButton.Click += CanvasTextBoxItlaicButton_Clicked;
_canvasTextBoxItalicButton.Click += CanvasTextBoxItalicButton_Clicked;
_canvasTextBoxBoldButton.Click += CanvasTextBoxBoldButton_Clicked;
_canvasTextBoxColorPicker.ColorChanged += CanvasTextBoxColorPicker_ColorChanged;
_enableTouchInkingButton.Checked += EnableTouchInkingButton_Checked;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
</ToggleButton.Content>
</ToggleButton>

<ToggleButton x:Name="CanvasTextBoxItlaicButton"
<ToggleButton x:Name="CanvasTextBoxItalicButton"
Style="{StaticResource CanvasTextBoxToggleButtonStyle}"
ToolTipService.ToolTip="Italic Text">
<ToggleButton.Content>
Expand Down