Skip to content

Changed Shape form for Thumb and Track from Circle to Rounded Rectangle.#3

Open
timskap wants to merge 1 commit intoAndreiMisiukevich:mainfrom
timskap:main
Open

Changed Shape form for Thumb and Track from Circle to Rounded Rectangle.#3
timskap wants to merge 1 commit intoAndreiMisiukevich:mainfrom
timskap:main

Conversation

@timskap
Copy link

@timskap timskap commented Feb 6, 2025

Now it has a

TrackCornerRadius="12"
ThumbCornerRadius="8"  

@timskap
Copy link
Author

timskap commented Feb 6, 2025

Снимок экрана 2025-02-06 в 16 50 37

Comment on lines +43 to +59
public double ThumbCornerRadius
{
get => (double)GetValue(ThumbCornerRadiusProperty);
set => SetValue(ThumbCornerRadiusProperty, value);
}

public double LowerThumbCornerRadius
{
get => (double)GetValue(LowerThumbCornerRadiusProperty);
set => SetValue(LowerThumbCornerRadiusProperty, value);
}

public double UpperThumbCornerRadius
{
get => (double)GetValue(UpperThumbCornerRadiusProperty);
set => SetValue(UpperThumbCornerRadiusProperty, value);
}
Copy link
Owner

Choose a reason for hiding this comment

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

Please make sure all instance properties are near other instance properties. I suggest to append them to the bottom

Comment on lines +34 to +41
public static BindableProperty ThumbCornerRadiusProperty =
BindableProperty.Create(nameof(ThumbCornerRadius), typeof(double), typeof(RangeSlider), 10.0, propertyChanged: OnLayoutPropertyChanged);

public static BindableProperty LowerThumbCornerRadiusProperty =
BindableProperty.Create(nameof(LowerThumbCornerRadius), typeof(double), typeof(RangeSlider), -1.0, propertyChanged: OnLayoutPropertyChanged);

public static BindableProperty UpperThumbCornerRadiusProperty =
BindableProperty.Create(nameof(UpperThumbCornerRadius), typeof(double), typeof(RangeSlider), -1.0, propertyChanged: OnLayoutPropertyChanged);
Copy link
Owner

Choose a reason for hiding this comment

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

  1. please fix the formatting (indention).
  2. put props to the appropriate place

set => SetValue(UpperThumbCornerRadiusProperty, value);
}

// Track Corner Radius
Copy link
Owner

Choose a reason for hiding this comment

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

please drop these redundant comments

}

static Border CreateBorderElement<TBorder>(bool hasShadow = false) where TBorder : Border, new()
static Border CreateBorderElement<TBorder>(bool hasShadow = false) where TBorder : Border, new()
Copy link
Owner

Choose a reason for hiding this comment

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

indetion
make sure it's correct across the entire file

// ShadowEffect.SetOpacity(frame, .25);
// ShadowEffect.SetRadius(frame, 3);
// ShadowEffect.SetOffsetY(frame, 2);
CornerRadius = new CornerRadius(10) // Adjust for rounded corners
Copy link
Owner

Choose a reason for hiding this comment

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

why is it hardcoded 10 here?

Comment on lines -549 to -552
Track.StrokeShape = CreateRoundRectangleShape(trackRadius);
TrackHighlight.StrokeShape = CreateRoundRectangleShape(trackRadius);
LowerThumb.StrokeShape = CreateRoundRectangleShape((float)GetDoubleOrDefault(GetDoubleOrDefault(LowerThumbRadius, ThumbRadius), lowerThumbSize / 2));
UpperThumb.StrokeShape = CreateRoundRectangleShape((float)GetDoubleOrDefault(GetDoubleOrDefault(UpperThumbRadius, ThumbRadius), upperThumbSize / 2));
Copy link
Owner

Choose a reason for hiding this comment

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

why did you get rid of CreateRoundRectangleShape usage? now this method is not used

Copy link
Owner

@AndreiMisiukevich AndreiMisiukevich left a comment

Choose a reason for hiding this comment

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

Hello! Thank you very much for your contribution. I appreciate that.

Unfortunately this PR is not ready to be merged.

Need to fix next things:

  1. Correct formatting
  2. Correct props place of definition (bindable and instance)
  3. Do not make unrelated changes in code base.
  4. Need to adjust documentation in Readme.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants