Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

option to specify the "corner roundness" #140

Merged
merged 5 commits into from
Dec 20, 2024
Merged

option to specify the "corner roundness" #140

merged 5 commits into from
Dec 20, 2024

Conversation

schaumtier
Copy link
Contributor

new option "corner-roundness". "0" means no corners. "12" is the default value (which draws corners of rectangle, blur and highlight round.

Copy link
Contributor

@LordMZTE LordMZTE left a comment

Choose a reason for hiding this comment

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

Thanks! I left some comments on things I believe could be improved.

README.md Outdated Show resolved Hide resolved
src/style.rs Outdated
@@ -215,11 +224,12 @@ impl Size {
}
}

pub fn to_corner_radius(self) -> f32 {
pub fn to_corner_roundness(self) -> f32 {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this function needed? It always returns the same value, regardless of self. At a glance, it also seems unused.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

that's right - I just forgot to remove it

src/style.rs Outdated
@@ -18,6 +18,9 @@ pub struct Style {
pub fill: bool,
}

#[derive(Clone, Copy, Debug, Default)]
pub struct Properties {}
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need this struct?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i don't really know - just needed a place to attach the getter function... maybe its better kept somewhere else. rust is really not my programming language

src/style.rs Outdated
@@ -176,6 +179,12 @@ impl FromVariant for Size {
}
}

impl Properties {
pub fn corner_roundness() -> f32 {
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems a little redundant. Perhaps we could directly reference APP_CONFIG.read().corner_roundness() where it's used.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

initially i thought of the need to differentiate between "Small", "Medium" and "Large" - thats why i've made a function. but of course would it be enough to have the numeric value.
if it's okay to reference APP_CONFIG directly in e.g. rectangle.rs, i can do this there.

@gabm gabm merged commit 891214b into gabm:main Dec 20, 2024
3 checks passed
@gabm
Copy link
Owner

gabm commented Dec 20, 2024

great, thank you both!

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.

3 participants