Examples for controlling the window? #991
-
I am trying to implement a custom title bar with minimize, restore and close buttons. I got the window to close by using the Also, I am implementing a TitleBar struct that has buttons and a view function. But it is kinda messy since you got to pass a Theme to it and apply it to all the Buttons individually. Is there a way to just recursively apply it, or is this the only way? Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
If there will be a way to get a winit's window from iced, then we will able to drag window by |
Beta Was this translation helpful? Give feedback.
-
FYI, there is an enhancement coming soon in #1019. It updates |
Beta Was this translation helpful? Give feedback.
FYI, there is an enhancement coming soon in #1019.
It updates
Command
to accept anAction
. These actions are intended to do exactly this. The following window actions are added in the PR and will trigger the appropriatewinit
method behind the scenes. It should be extremely easy to addMinimize
,Restore
and any other window actions that can be called inwinit
.https://github.com/hecrj/iced/blob/7cb6e7438f7fb5d0d8be4528a31b888e2b12cd51/native/src/window/action.rs#L1-L18