This commit is contained in:
2026-03-04 10:25:25 +08:00
parent b67476ae19
commit e29b4f3ff3
2 changed files with 223 additions and 126 deletions
+178 -111
View File
@@ -5,22 +5,13 @@ using System.Windows;
using System.Windows.Controls; using System.Windows.Controls;
using System.Windows.Media; using System.Windows.Media;
using System.Windows.Threading; using System.Windows.Threading;
using System.Windows.Markup;
using System.Windows.Media.TextFormatting;
using System.Windows.Media.Imaging;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Shapes;
using System.Windows.Data;
using System.Windows.Ink;
using System.Windows.Interop;
using System.Windows.Media.Animation;
using System.Windows.Navigation;
namespace Ink_Canvas.Helpers namespace Ink_Canvas.Helpers
{ {
/// <summary> /// <summary>
/// 让 TextBlock 在可用宽度不足时自动缩小字号(只缩小不放大),用于避免英文等长文本被截断。 /// Automatically shrinks text to fit available width.
/// Supports TextBlock and Label.
/// Only shrinks, never enlarges above MaxFontSize.
/// </summary> /// </summary>
public static class AutoFontSizeHelper public static class AutoFontSizeHelper
{ {
@@ -76,170 +67,247 @@ namespace Ink_Canvas.Helpers
private static void OnIsEnabledChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) private static void OnIsEnabledChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{ {
var tb = d as TextBlock; if (!(d is FrameworkElement fe)) return;
if (tb == null) return; if (!(fe is TextBlock) && !(fe is Label)) return;
if ((bool)e.NewValue) if ((bool)e.NewValue)
{ {
tb.SizeChanged += TextBlock_OnSizeChanged; fe.SizeChanged += Element_OnSizeChanged;
tb.Loaded += TextBlock_OnLoaded; fe.Loaded += Element_OnLoaded;
tb.Unloaded += TextBlock_OnUnloaded; fe.Unloaded += Element_OnUnloaded;
TryHookContentChanged(fe, true);
try fe.Dispatcher.BeginInvoke(new Action(() => TryAdjust(fe)), DispatcherPriority.Loaded);
{
var dpd = DependencyPropertyDescriptor.FromProperty(TextBlock.TextProperty, typeof(TextBlock));
dpd?.AddValueChanged(tb, TextBlock_OnTextChanged);
}
catch
{
// 忽略:极端情况下 descriptor 可能不可用
}
// 让第一次布局完成后再做一次调整(避免 ActualWidth=0
tb.Dispatcher.BeginInvoke(new Action(() => TryAdjust(tb)), DispatcherPriority.Loaded);
} }
else else
{ {
tb.SizeChanged -= TextBlock_OnSizeChanged; fe.SizeChanged -= Element_OnSizeChanged;
tb.Loaded -= TextBlock_OnLoaded; fe.Loaded -= Element_OnLoaded;
tb.Unloaded -= TextBlock_OnUnloaded; fe.Unloaded -= Element_OnUnloaded;
TryHookContentChanged(fe, false);
try
{
var dpd = DependencyPropertyDescriptor.FromProperty(TextBlock.TextProperty, typeof(TextBlock));
dpd?.RemoveValueChanged(tb, TextBlock_OnTextChanged);
}
catch
{
}
} }
} }
private static void OnSizingPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) private static void OnSizingPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{ {
if (d is TextBlock tb && GetIsEnabled(tb)) if (d is FrameworkElement fe && GetIsEnabled(fe))
{ {
tb.Dispatcher.BeginInvoke(new Action(() => TryAdjust(tb)), DispatcherPriority.Loaded); fe.Dispatcher.BeginInvoke(new Action(() => TryAdjust(fe)), DispatcherPriority.Loaded);
} }
} }
private static void TextBlock_OnLoaded(object sender, RoutedEventArgs e) private static void Element_OnLoaded(object sender, RoutedEventArgs e)
{ {
if (sender is TextBlock tb) tb.Dispatcher.BeginInvoke(new Action(() => TryAdjust(tb)), DispatcherPriority.Loaded); if (sender is FrameworkElement fe)
}
private static void TextBlock_OnUnloaded(object sender, RoutedEventArgs e)
{
// 这里不做额外处理;事件解绑由 IsEnabled 关闭或对象销毁处理
}
private static void TextBlock_OnSizeChanged(object sender, SizeChangedEventArgs e)
{
if (sender is TextBlock tb) TryAdjust(tb);
}
private static void TextBlock_OnTextChanged(object sender, EventArgs e)
{
if (sender is TextBlock tb) tb.Dispatcher.BeginInvoke(new Action(() => TryAdjust(tb)), DispatcherPriority.Loaded);
}
private static void TryAdjust(TextBlock tb)
{
if (tb == null) return;
if (!GetIsEnabled(tb)) return;
if (GetIsAdjusting(tb)) return;
// 没有可用宽度时跳过
var availableWidth = tb.ActualWidth;
if (double.IsNaN(availableWidth) || availableWidth <= 1) return;
// 文本为空时不需要调整
var text = tb.Text;
if (string.IsNullOrEmpty(text)) return;
var min = GetMinFontSize(tb);
if (double.IsNaN(min) || min <= 0) min = 6d;
var step = GetStep(tb);
if (double.IsNaN(step) || step <= 0.01) step = 0.5d;
var max = GetMaxFontSize(tb);
if (double.IsNaN(max) || max <= 0)
{ {
max = tb.FontSize; fe.Dispatcher.BeginInvoke(new Action(() => TryAdjust(fe)), DispatcherPriority.Loaded);
} }
}
if (double.IsNaN(max) || max <= 0) return; private static void Element_OnUnloaded(object sender, RoutedEventArgs e)
{
// No extra cleanup required here.
}
// 只做“缩小不放大” private static void Element_OnSizeChanged(object sender, SizeChangedEventArgs e)
var startFont = Math.Min(tb.FontSize, max); {
if (startFont < min) startFont = min; if (sender is FrameworkElement fe) TryAdjust(fe);
}
SetIsAdjusting(tb, true); private static void Element_OnTextChanged(object sender, EventArgs e)
{
if (sender is FrameworkElement fe)
{
fe.Dispatcher.BeginInvoke(new Action(() => TryAdjust(fe)), DispatcherPriority.Loaded);
}
}
private static void TryHookContentChanged(FrameworkElement fe, bool add)
{
try try
{ {
// 如果当前已合适,直接回到 max(但不超过原本 fontSize),避免之前缩小后再变短不恢复 DependencyPropertyDescriptor dpd = null;
// 注意:恢复也只在不超过 max 的范围内 if (fe is TextBlock)
var desiredAtMax = MeasureTextWidth(tb, text, max); {
dpd = DependencyPropertyDescriptor.FromProperty(TextBlock.TextProperty, typeof(TextBlock));
}
else if (fe is Label)
{
dpd = DependencyPropertyDescriptor.FromProperty(ContentControl.ContentProperty, typeof(ContentControl));
}
if (dpd == null) return;
if (add) dpd.AddValueChanged(fe, Element_OnTextChanged);
else dpd.RemoveValueChanged(fe, Element_OnTextChanged);
}
catch
{
// Ignore descriptor issues in rare runtime cases.
}
}
private static void TryAdjust(FrameworkElement fe)
{
if (fe == null) return;
if (!GetIsEnabled(fe)) return;
if (GetIsAdjusting(fe)) return;
var text = GetElementText(fe);
if (string.IsNullOrEmpty(text)) return;
var availableWidth = GetAvailableWidth(fe);
if (double.IsNaN(availableWidth) || availableWidth <= 1) return;
var min = GetMinFontSize(fe);
if (double.IsNaN(min) || min <= 0) min = 6d;
var step = GetStep(fe);
if (double.IsNaN(step) || step < 0.1) step = 0.5d;
var current = GetElementFontSize(fe);
if (double.IsNaN(current) || current <= 0) return;
var max = GetMaxFontSize(fe);
if (double.IsNaN(max) || max <= 0) max = current;
var startFont = Math.Min(current, max);
if (startFont < min) startFont = min;
SetIsAdjusting(fe, true);
try
{
var desiredAtMax = MeasureTextWidth(fe, text, max);
if (desiredAtMax > 0 && desiredAtMax <= availableWidth + 0.5) if (desiredAtMax > 0 && desiredAtMax <= availableWidth + 0.5)
{ {
if (tb.FontSize != max) tb.FontSize = max; if (Math.Abs(current - max) > 0.01) SetElementFontSize(fe, max);
return; return;
} }
double font = startFont; var font = startFont;
double desired = MeasureTextWidth(tb, text, font); var desired = MeasureTextWidth(fe, text, font);
if (desired <= 0) return; if (desired <= 0) return;
// 逐步减小直到适配或触底
while (font > min && desired > availableWidth + 0.5) while (font > min && desired > availableWidth + 0.5)
{ {
font = Math.Max(min, font - step); font = Math.Max(min, font - step);
desired = MeasureTextWidth(tb, text, font); desired = MeasureTextWidth(fe, text, font);
if (desired <= 0) break; if (desired <= 0) break;
} }
if (!double.IsNaN(font) && font > 0 && Math.Abs(tb.FontSize - font) > 0.01) if (!double.IsNaN(font) && font > 0 && Math.Abs(current - font) > 0.01)
{ {
tb.FontSize = font; SetElementFontSize(fe, font);
} }
} }
finally finally
{ {
SetIsAdjusting(tb, false); SetIsAdjusting(fe, false);
} }
} }
private static double MeasureTextWidth(TextBlock tb, string text, double fontSize) private static string GetElementText(FrameworkElement fe)
{
if (fe is TextBlock tb) return tb.Text;
if (fe is Label label) return label.Content as string ?? label.Content?.ToString();
return null;
}
private static double GetElementFontSize(FrameworkElement fe)
{
if (fe is TextBlock tb) return tb.FontSize;
if (fe is Label label) return label.FontSize;
return double.NaN;
}
private static void SetElementFontSize(FrameworkElement fe, double value)
{
if (fe is TextBlock tb) tb.FontSize = value;
else if (fe is Label label) label.FontSize = value;
}
private static double GetAvailableWidth(FrameworkElement fe)
{
double width = double.PositiveInfinity;
if (fe.ActualWidth > 1) width = Math.Min(width, fe.ActualWidth);
if (fe.Parent is FrameworkElement parent && parent.ActualWidth > 1)
{
var parentWidth = parent.ActualWidth - fe.Margin.Left - fe.Margin.Right;
if (parentWidth > 1) width = Math.Min(width, parentWidth);
}
if (double.IsInfinity(width) || double.IsNaN(width) || width <= 1) return -1;
// Keep width as inner text area.
if (fe is Control control)
{
width -= control.Padding.Left + control.Padding.Right;
width -= control.BorderThickness.Left + control.BorderThickness.Right;
}
else if (fe is Border border)
{
width -= border.Padding.Left + border.Padding.Right;
width -= border.BorderThickness.Left + border.BorderThickness.Right;
}
return width;
}
private static double MeasureTextWidth(FrameworkElement fe, string text, double fontSize)
{ {
try try
{ {
var dpi = VisualTreeHelper.GetDpi(tb); var dpi = VisualTreeHelper.GetDpi(fe);
var culture = CultureInfo.CurrentUICulture; var culture = CultureInfo.CurrentUICulture;
// 使用 TextBlock 自身的语言/流向 if (fe.Language != null)
if (tb.Language != null)
{ {
try try
{ {
culture = tb.Language.GetEquivalentCulture(); culture = fe.Language.GetEquivalentCulture();
} }
catch catch
{ {
} }
} }
var typeface = new Typeface(tb.FontFamily, tb.FontStyle, tb.FontWeight, tb.FontStretch); var fontFamily = SystemFonts.MessageFontFamily;
var fontStyle = FontStyles.Normal;
var fontWeight = FontWeights.Normal;
var fontStretch = FontStretches.Normal;
Brush foreground = Brushes.Black;
var flowDirection = FlowDirection.LeftToRight;
if (fe is TextBlock tb)
{
fontFamily = tb.FontFamily;
fontStyle = tb.FontStyle;
fontWeight = tb.FontWeight;
fontStretch = tb.FontStretch;
foreground = tb.Foreground;
flowDirection = tb.FlowDirection;
}
else if (fe is Label label)
{
fontFamily = label.FontFamily;
fontStyle = label.FontStyle;
fontWeight = label.FontWeight;
fontStretch = label.FontStretch;
foreground = label.Foreground;
flowDirection = label.FlowDirection;
}
var typeface = new Typeface(fontFamily, fontStyle, fontWeight, fontStretch);
var formatted = new FormattedText( var formatted = new FormattedText(
text, text,
culture, culture,
tb.FlowDirection, flowDirection,
typeface, typeface,
fontSize, fontSize,
tb.Foreground, foreground,
dpi.PixelsPerDip); dpi.PixelsPerDip);
// 这里用包含尾随空白的宽度更接近实际布局
return formatted.WidthIncludingTrailingWhitespace; return formatted.WidthIncludingTrailingWhitespace;
} }
catch catch
@@ -249,4 +317,3 @@ namespace Ink_Canvas.Helpers
} }
} }
} }
+45 -15
View File
@@ -71,9 +71,26 @@
<Setter Property="TextWrapping" Value="NoWrap" /> <Setter Property="TextWrapping" Value="NoWrap" />
<Setter Property="TextAlignment" Value="Center" /> <Setter Property="TextAlignment" Value="Center" />
<Setter Property="helpers:AutoFontSizeHelper.IsEnabled" Value="True" /> <Setter Property="helpers:AutoFontSizeHelper.IsEnabled" Value="True" />
<Setter Property="helpers:AutoFontSizeHelper.MinFontSize" Value="5" /> <Setter Property="helpers:AutoFontSizeHelper.MinFontSize" Value="4" />
<Setter Property="helpers:AutoFontSizeHelper.MaxFontSize" Value="8" /> <Setter Property="helpers:AutoFontSizeHelper.MaxFontSize" Value="8" />
<Setter Property="helpers:AutoFontSizeHelper.Step" Value="0.5" /> <Setter Property="helpers:AutoFontSizeHelper.Step" Value="0.25" />
</Style>
<Style x:Key="AutoFitMainToolbarLabel8" TargetType="TextBlock" BasedOn="{StaticResource AutoFitFloatBarLabel8}">
<Setter Property="Height" Value="10" />
<Setter Property="LineStackingStrategy" Value="BlockLineHeight" />
<Setter Property="LineHeight" Value="10" />
</Style>
<Style x:Key="AutoFitToolPopupLabel8" TargetType="Label">
<Setter Property="Padding" Value="0" />
<Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="Foreground" Value="{DynamicResource FloatBarForeground}" />
<Setter Property="helpers:AutoFontSizeHelper.IsEnabled" Value="True" />
<Setter Property="helpers:AutoFontSizeHelper.MinFontSize" Value="3.5" />
<Setter Property="helpers:AutoFontSizeHelper.MaxFontSize" Value="8" />
<Setter Property="helpers:AutoFontSizeHelper.Step" Value="0.25" />
</Style> </Style>
<!-- Navigation Button Style --> <!-- Navigation Button Style -->
@@ -6840,6 +6857,9 @@
</Border> </Border>
<!----> <!---->
<ui:SimpleStackPanel Margin="10,3,10,2" Spacing="-2"> <ui:SimpleStackPanel Margin="10,3,10,2" Spacing="-2">
<ui:SimpleStackPanel.Resources>
<Style TargetType="Label" BasedOn="{StaticResource AutoFitToolPopupLabel8}" />
</ui:SimpleStackPanel.Resources>
<ui:SimpleStackPanel Margin="0,0,0,0" Height="40" Spacing="0" <ui:SimpleStackPanel Margin="0,0,0,0" Height="40" Spacing="0"
Orientation="Horizontal"> Orientation="Horizontal">
<ui:SimpleStackPanel MouseDown="Border_MouseDown" <ui:SimpleStackPanel MouseDown="Border_MouseDown"
@@ -7786,7 +7806,8 @@
</Image> </Image>
<TextBlock x:Name="SelectionToolBarTextBlock" Text="{i18n:I18n Key=FloatingBar_Mouse}" Foreground="{DynamicResource FloatBarForeground}" <TextBlock x:Name="SelectionToolBarTextBlock" Text="{i18n:I18n Key=FloatingBar_Mouse}" Foreground="{DynamicResource FloatBarForeground}"
FontSize="8" FontSize="8"
Margin="0,1,0,0" TextAlignment="Center" /> Margin="0,1,0,0" TextAlignment="Center"
Style="{StaticResource AutoFitMainToolbarLabel8}" />
</ui:SimpleStackPanel> </ui:SimpleStackPanel>
<ui:SimpleStackPanel Name="Pen_Icon" <ui:SimpleStackPanel Name="Pen_Icon"
MouseDown="FloatingBarToolBtnMouseDownFeedback_Panel" MouseDown="FloatingBarToolBtnMouseDownFeedback_Panel"
@@ -7808,7 +7829,8 @@
</Image.Source> </Image.Source>
</Image> </Image>
<TextBlock x:Name="PenToolbarTextBlock" Text="{i18n:I18n Key=FloatingBar_Annotate}" Foreground="{DynamicResource FloatBarForeground}" FontSize="8" <TextBlock x:Name="PenToolbarTextBlock" Text="{i18n:I18n Key=FloatingBar_Annotate}" Foreground="{DynamicResource FloatBarForeground}" FontSize="8"
Margin="0,1,0,0" TextAlignment="Center" /> Margin="0,1,0,0" TextAlignment="Center"
Style="{StaticResource AutoFitMainToolbarLabel8}" />
</ui:SimpleStackPanel> </ui:SimpleStackPanel>
<!-- 快捷调色盘 - 双行显示模式 --> <!-- 快捷调色盘 - 双行显示模式 -->
@@ -8403,7 +8425,8 @@
</Image.Source> </Image.Source>
</Image> </Image>
<TextBlock x:Name="TrashBinToolbarTextBlock" Text="{i18n:I18n Key=FloatingBar_Clear}" Foreground="{DynamicResource RedBrush}" <TextBlock x:Name="TrashBinToolbarTextBlock" Text="{i18n:I18n Key=FloatingBar_Clear}" Foreground="{DynamicResource RedBrush}"
FontWeight="Bold" FontSize="8" Margin="0,1,0,0" TextAlignment="Center" /> FontWeight="Bold" FontSize="8" Margin="0,1,0,0" TextAlignment="Center"
Style="{StaticResource AutoFitMainToolbarLabel8}" />
</ui:SimpleStackPanel> </ui:SimpleStackPanel>
<ui:SimpleStackPanel Name="StackPanelCanvasControls" Visibility="Visible" <ui:SimpleStackPanel Name="StackPanelCanvasControls" Visibility="Visible"
Orientation="{Binding ElementName=StackPanelFloatingBar, Path=Orientation}"> Orientation="{Binding ElementName=StackPanelFloatingBar, Path=Orientation}">
@@ -9228,7 +9251,8 @@
</Image.Source> </Image.Source>
</Image> </Image>
<TextBlock x:Name="CircleEraserToolbarTextBlock" Text="{i18n:I18n Key=FloatingBar_AreaEraser}" Foreground="{DynamicResource FloatBarForeground}" <TextBlock x:Name="CircleEraserToolbarTextBlock" Text="{i18n:I18n Key=FloatingBar_AreaEraser}" Foreground="{DynamicResource FloatBarForeground}"
FontSize="8" Margin="0,1,0,0" TextAlignment="Center" /> FontSize="8" Margin="0,1,0,0" TextAlignment="Center"
Style="{StaticResource AutoFitMainToolbarLabel8}" />
</ui:SimpleStackPanel> </ui:SimpleStackPanel>
<ui:SimpleStackPanel Name="EraserByStrokes_Icon" <ui:SimpleStackPanel Name="EraserByStrokes_Icon"
MouseDown="FloatingBarToolBtnMouseDownFeedback_Panel" MouseDown="FloatingBarToolBtnMouseDownFeedback_Panel"
@@ -9251,7 +9275,8 @@
</Image.Source> </Image.Source>
</Image> </Image>
<TextBlock x:Name="InkEraserToolbarTextBlock" Text="{i18n:I18n Key=FloatingBar_StrokeEraser}" Foreground="{DynamicResource FloatBarForeground}" <TextBlock x:Name="InkEraserToolbarTextBlock" Text="{i18n:I18n Key=FloatingBar_StrokeEraser}" Foreground="{DynamicResource FloatBarForeground}"
FontSize="8" Margin="0,1,0,0" TextAlignment="Center" /> FontSize="8" Margin="0,1,0,0" TextAlignment="Center"
Style="{StaticResource AutoFitMainToolbarLabel8}" />
</ui:SimpleStackPanel> </ui:SimpleStackPanel>
<ui:SimpleStackPanel Name="SymbolIconSelect" <ui:SimpleStackPanel Name="SymbolIconSelect"
MouseDown="FloatingBarToolBtnMouseDownFeedback_Panel" MouseDown="FloatingBarToolBtnMouseDownFeedback_Panel"
@@ -9273,7 +9298,8 @@
</Image.Source> </Image.Source>
</Image> </Image>
<TextBlock x:Name="LassoToolToolbarTextBlock" Text="{i18n:I18n Key=FloatingBar_LassoSelect}" Foreground="{DynamicResource FloatBarForeground}" <TextBlock x:Name="LassoToolToolbarTextBlock" Text="{i18n:I18n Key=FloatingBar_LassoSelect}" Foreground="{DynamicResource FloatBarForeground}"
FontSize="8" Margin="0,1,0,0" TextAlignment="Center" /> FontSize="8" Margin="0,1,0,0" TextAlignment="Center"
Style="{StaticResource AutoFitMainToolbarLabel8}" />
</ui:SimpleStackPanel> </ui:SimpleStackPanel>
<ui:SimpleStackPanel <ui:SimpleStackPanel
Name="ShapeDrawFloatingBarBtn" Name="ShapeDrawFloatingBarBtn"
@@ -9297,7 +9323,8 @@
</Image.Source> </Image.Source>
</Image> </Image>
<TextBlock x:Name="ShapesToolbarTextBlock" Text="{i18n:I18n Key=FloatingBar_Geometry}" Foreground="{DynamicResource FloatBarForeground}" <TextBlock x:Name="ShapesToolbarTextBlock" Text="{i18n:I18n Key=FloatingBar_Geometry}" Foreground="{DynamicResource FloatBarForeground}"
FontSize="8" Margin="0,1,0,0" TextAlignment="Center" /> FontSize="8" Margin="0,1,0,0" TextAlignment="Center"
Style="{StaticResource AutoFitMainToolbarLabel8}" />
</ui:SimpleStackPanel> </ui:SimpleStackPanel>
<Grid Width="0"> <Grid Width="0">
@@ -9573,7 +9600,7 @@
Opacity="{Binding ElementName=BtnUndo, Path=IsEnabled, Converter={StaticResource IsEnabledToOpacityConverter}}" Opacity="{Binding ElementName=BtnUndo, Path=IsEnabled, Converter={StaticResource IsEnabledToOpacityConverter}}"
Foreground="{DynamicResource FloatBarForeground}" FontSize="8" Margin="0,1,0,0" Foreground="{DynamicResource FloatBarForeground}" FontSize="8" Margin="0,1,0,0"
TextAlignment="Center" TextAlignment="Center"
Style="{StaticResource AutoFitFloatBarLabel8}" /> Style="{StaticResource AutoFitMainToolbarLabel8}" />
</ui:SimpleStackPanel> </ui:SimpleStackPanel>
<ui:SimpleStackPanel <ui:SimpleStackPanel
Name="SymbolIconRedo" Name="SymbolIconRedo"
@@ -9602,7 +9629,7 @@
Opacity="{Binding ElementName=BtnRedo, Path=IsEnabled, Converter={StaticResource IsEnabledToOpacityConverter}}" Opacity="{Binding ElementName=BtnRedo, Path=IsEnabled, Converter={StaticResource IsEnabledToOpacityConverter}}"
Foreground="{DynamicResource FloatBarForeground}" FontSize="8" Margin="0,1,0,0" Foreground="{DynamicResource FloatBarForeground}" FontSize="8" Margin="0,1,0,0"
TextAlignment="Center" TextAlignment="Center"
Style="{StaticResource AutoFitFloatBarLabel8}" /> Style="{StaticResource AutoFitMainToolbarLabel8}" />
</ui:SimpleStackPanel> </ui:SimpleStackPanel>
<ui:SimpleStackPanel <ui:SimpleStackPanel
Name="CursorWithDelFloatingBarBtn" Name="CursorWithDelFloatingBarBtn"
@@ -9626,7 +9653,7 @@
</Image> </Image>
<TextBlock x:Name="ClearAndMouseToolbarTextBlock" Text="{i18n:I18n Key=FloatingBar_ClearAndMouse}" Foreground="{DynamicResource FloatBarForeground}" <TextBlock x:Name="ClearAndMouseToolbarTextBlock" Text="{i18n:I18n Key=FloatingBar_ClearAndMouse}" Foreground="{DynamicResource FloatBarForeground}"
FontSize="8" Margin="0,1,0,0" TextAlignment="Center" FontSize="8" Margin="0,1,0,0" TextAlignment="Center"
Style="{StaticResource AutoFitFloatBarLabel8}" /> Style="{StaticResource AutoFitMainToolbarLabel8}" />
</ui:SimpleStackPanel> </ui:SimpleStackPanel>
</ui:SimpleStackPanel> </ui:SimpleStackPanel>
<Grid Width="0"> <Grid Width="0">
@@ -9790,7 +9817,7 @@
</Image> </Image>
<TextBlock x:Name="WhiteboardToolbarTextBlock" Text="{i18n:I18n Key=FloatingBar_Whiteboard}" Foreground="{DynamicResource FloatBarForeground}" <TextBlock x:Name="WhiteboardToolbarTextBlock" Text="{i18n:I18n Key=FloatingBar_Whiteboard}" Foreground="{DynamicResource FloatBarForeground}"
FontSize="8" Margin="0,1,0,0" TextAlignment="Center" FontSize="8" Margin="0,1,0,0" TextAlignment="Center"
Style="{StaticResource AutoFitFloatBarLabel8}" /> Style="{StaticResource AutoFitMainToolbarLabel8}" />
</ui:SimpleStackPanel> </ui:SimpleStackPanel>
<ui:SimpleStackPanel <ui:SimpleStackPanel
Name="ToolsFloatingBarBtn" Name="ToolsFloatingBarBtn"
@@ -9815,7 +9842,7 @@
<TextBlock x:Name="ToolsToolbarTextBlock" Text="{i18n:I18n Key=Board_Tools}" Foreground="{DynamicResource FloatBarForeground}" <TextBlock x:Name="ToolsToolbarTextBlock" Text="{i18n:I18n Key=Board_Tools}" Foreground="{DynamicResource FloatBarForeground}"
FontSize="8" FontSize="8"
Margin="0,1,0,0" TextAlignment="Center" Margin="0,1,0,0" TextAlignment="Center"
Style="{StaticResource AutoFitFloatBarLabel8}" /> Style="{StaticResource AutoFitMainToolbarLabel8}" />
</ui:SimpleStackPanel> </ui:SimpleStackPanel>
<ui:SimpleStackPanel <ui:SimpleStackPanel
x:Name="Fold_Icon" x:Name="Fold_Icon"
@@ -9840,7 +9867,7 @@
<TextBlock x:Name="HideToolbarTextBlock" Text="{i18n:I18n Key=FloatingBar_Hide}" Foreground="{DynamicResource FloatBarForeground}" <TextBlock x:Name="HideToolbarTextBlock" Text="{i18n:I18n Key=FloatingBar_Hide}" Foreground="{DynamicResource FloatBarForeground}"
FontSize="8" FontSize="8"
Margin="0,1,0,0" TextAlignment="Center" Margin="0,1,0,0" TextAlignment="Center"
Style="{StaticResource AutoFitFloatBarLabel8}" /> Style="{StaticResource AutoFitMainToolbarLabel8}" />
</ui:SimpleStackPanel> </ui:SimpleStackPanel>
<Grid Width="0"> <Grid Width="0">
<Border ClipToBounds="True" Name="BorderTools" Margin="-103,-156,-16,37" <Border ClipToBounds="True" Name="BorderTools" Margin="-103,-156,-16,37"
@@ -9865,6 +9892,9 @@
</Border> </Border>
<!----> <!---->
<ui:SimpleStackPanel Margin="10,3,10,2" Spacing="-2"> <ui:SimpleStackPanel Margin="10,3,10,2" Spacing="-2">
<ui:SimpleStackPanel.Resources>
<Style TargetType="Label" BasedOn="{StaticResource AutoFitToolPopupLabel8}" />
</ui:SimpleStackPanel.Resources>
<ui:SimpleStackPanel Margin="0,0,0,0" Height="40" Spacing="0" <ui:SimpleStackPanel Margin="0,0,0,0" Height="40" Spacing="0"
Orientation="Horizontal"> Orientation="Horizontal">
<ui:SimpleStackPanel MouseDown="Border_MouseDown" <ui:SimpleStackPanel MouseDown="Border_MouseDown"