Skip to content

Commit

Permalink
chore: Revert some inappropriate commit files
Browse files Browse the repository at this point in the history
Revert "Auxiliary commit to revert individual files from 9236f15"

This reverts commit 592a9e20d50c497c28c7da7f0ddc0849a7ec3be4.
  • Loading branch information
TopProgrammer77 committed Oct 12, 2023
1 parent a55e16f commit a152988
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public partial class ColorPickerSlider : Slider
{
private ToolTip m_toolTip;

public ColorPickerSlider() : base()
public ColorPickerSlider()
{
// We want the ColorPickerSlider to pick up everything for its default style from the Slider's default style,
// since its purpose is just to turn off keyboarding. So we'll give it Slider's control name as its default style key
Expand All @@ -42,7 +42,6 @@ protected override void OnApplyTemplate()

if (m_toolTip is ToolTip toolTip)
{
_isCustomThumbToolTipEnabled = true;
toolTip.Content = GetToolTipString();
}
}
Expand Down Expand Up @@ -173,8 +172,11 @@ private void OnValueChangedEvent(object sender, RangeBaseValueChangedEventArgs a
if (m_toolTip is ToolTip toolTip)
{
toolTip.Content = GetToolTipString();
if (Thumb.IsDragging)
UpdateThumbToolTipVisibility(true);

// ToolTip doesn't currently provide any way to re-run its placement logic if its placement target moves,
// so toggling IsEnabled induces it to do that without incurring any visual glitches.
toolTip.IsEnabled = false;
toolTip.IsEnabled = true;
}

DependencyObject currentObject = this;
Expand Down
2 changes: 0 additions & 2 deletions src/Uno.UI/UI/Xaml/Controls/Slider/Slider.mux.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ public Slider()
_usingDefaultToolTipForHorizontalThumb = false;
_usingDefaultToolTipForVerticalThumb = false;
_capturedPointerId = 0;
_isCustomThumbToolTipEnabled = false;

// TODO Uno specific: This is called by DirectUI automatically,
// we have to do it manually here.
Expand Down Expand Up @@ -1074,7 +1073,6 @@ private void UpdateTrackLayout(
actualHeight = Math.Max(actualHeight - padding.Top - padding.Bottom, 0.0);

isThumbToolTipEnabled = IsThumbToolTipEnabled;
isThumbToolTipEnabled |= _isCustomThumbToolTipEnabled;
#if HAS_UNO
isThumbToolTipEnabled &= FeatureConfiguration.ToolTip.UseToolTips;
#endif
Expand Down
3 changes: 0 additions & 3 deletions src/Uno.UI/UI/Xaml/Controls/Slider/Slider.mux.h.cs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,4 @@ public partial class Slider

private bool _disengagedWithA;

// This flag is used for the Thumb ToolTip of ColorPickerSlider
protected bool _isCustomThumbToolTipEnabled;

}

0 comments on commit a152988

Please sign in to comment.