mmertama / FigmaQML

Converts Figma designs to QML/QtQuick
MIT License
200 stars 38 forks source link

Button changes like color #17

Closed QMand closed 4 months ago

QMand commented 4 months ago

Good day,

Thank you for this application!

I wanted to find out whether we could add a property to a button for example to be able to 'change' the color when clicked on. In figma I can make a component where the button is not pressed and pressed and they have a different look to them but I'm not sure if it's possible to get it into this program.

I see that I can get the Events when pressing on the button and I can change the text or even the entire 'component'.

In the readme you mention properties like qml?topic_subscribe.text where I can then change the text but I'm not sure what else could be used. (I've used onClicked,text,asLoader)

Thank you!

mmertama commented 4 months ago

Hello,

topic_subscribe.color should change the color as .text changes the text property.

Best Regards

Markus

On Sat 9. Mar 2024 at 19.55, QMand @.***> wrote:

Good day,

Thank you for this application!

I wanted to find out whether we could add a property to a button for example to be able to 'change' the color when clicked on. In figma I can make a component where the button is not pressed and pressed and they have a different look to them but I'm not sure if it's possible to get it into this program.

I see that I can get the Events when pressing on the button and I can change the text or even the entire 'component'.

In the readme you mention properties like qml?topic_subscribe.text where I can then change the text but I'm not sure what else could be used. (I've used onClicked,text,asLoader)

Thank you!

— Reply to this email directly, view it on GitHub https://github.com/mmertama/FigmaQML/issues/17, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB3ZQDKWCRGFR6X7T5EAG2TYXNEKPAVCNFSM6AAAAABEOIYILKVHI2DSMVQWIX3LMV43ASLTON2WKOZSGE3TOMZTGE4TAMQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

QMand commented 4 months ago

Ahh I see thank you!

This really nice software. Thank you for it!

mmertama commented 4 months ago

Im not sure if my recommendation worked - please try property_access_imporovements branch, there Im building an improved approach.

mmertama commented 4 months ago

3.1 - make this easier - please see qmqtti example

QMand commented 4 months ago

Thank you I've been away and I will definitely try this this upcoming weekend. I have tried your recommendation and it does also seem to add the .color and so forth to the qml so it seems to be working. But this weekend I will have a further look.