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

Add min and max simplexpr functions #1123

Merged
merged 2 commits into from
Jul 5, 2024
Merged

Add min and max simplexpr functions #1123

merged 2 commits into from
Jul 5, 2024

Conversation

ovalkonia
Copy link
Contributor

Description

Pretty self-explanatory, adds min and max simplexpr functions. It might be useful sometimes, so why not!

Resolves #1122

Usage

The usage is the same as with other simplexpr function calls. The syntax would be min(a, b) and max(a, b), where a and b must both be convertible into f64. Here is a configuration used in the showcase below:

(defwidget ftest []
    (box
        :halign "center"
        :spacing "50"
        :space-evenly "false"
        "min(-9.591, 15.3) = ${min(-9.591, 15.3)}"
        "max(5, 4.7) = ${max(5, 4.7)}"))

(defwindow example
    :monitor "0"
    :geometry (geometry
        :x "0"
        :y "0"
        :width "100%"
        :height "35px"
        :anchor "top center")
    :exclusive "true"
    (ftest))

Showcase

1719010939

Additional Notes

N/A

Checklist

Please make sure you can check all the boxes that apply to this PR.

  • All widgets I've added are correctly documented.
  • I added my changes to CHANGELOG.md, if appropriate.
  • The documentation in the docs/content/main directory has been adjusted to reflect my changes.
  • I used cargo fmt to automatically format all code before committing

@elkowar elkowar merged commit 4d55e9a into elkowar:master Jul 5, 2024
1 check passed
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.

[FEATURE] Add max and min function to Eww expressions
2 participants