slint-ui / slint

Slint is a declarative GUI toolkit to build native user interfaces for Rust, C++, or JavaScript apps.
https://slint.dev
Other
16.94k stars 568 forks source link

Button does not have option for custom color #4878

Closed learncodingforweb closed 6 months ago

learncodingforweb commented 6 months ago

Button does not have option for custom color. Eleven i tried using Rectangle

Rectangle {
        Text {text: title; color: white;}
        background: #047857;
    }

But it does not look like button as it does not have show elevated option

ogoffart commented 6 months ago

Thanks for filling an issue.

There is no plan to add styling properties like brushes, font settings and spaces to the std-widgets. Instead two alternatives are planned to make widget customization easier: https://github.com/slint-ui/slint/issues/4371 https://github.com/slint-ui/slint/issues/4372

As of now, if you want a custom looking button, you can create a custom component for it. There are example here: https://slint.dev/docs/slint/src/recipes/recipes#custom-button