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
Added set_fullscreen
API to WindowAdapter.
#4286
Conversation
41a3195
to
991b11a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for the PR! It is well done.
I added a few comments inline.
Also I don't think it is necessary to have a full fledged example just for that feature.
@@ -203,11 +203,6 @@ impl WinitWindowAdapter { | |||
let mut window_builder = | |||
winit::window::WindowBuilder::new().with_transparent(true).with_visible(false); | |||
|
|||
if std::env::var("SLINT_FULLSCREEN").is_ok() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm thinking we should keep the env variable for now in addition, or that'd be a breaking change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
internal/backends/qt/qt_window.rs
Outdated
if (fullscreen) { | ||
widget_ptr->setWindowState(Qt::WindowFullScreen); | ||
} else { | ||
widget_ptr->setWindowState(Qt::WindowNoState); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would also clear other states like minimized and maximized.
In fact, the best would be to add or remove the Qt::WindowFullScreen flag from the set of state using windowStates and setWindowStates
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That makes a lot of sense, done.
The C++ formatting is broken:-/ Could you please consider to fix that? Unfortunately github will not push fix suggestions into other people's branches, so unfortunately you can not just accept that :-) And neither can I do it for you as I can not push an update into your branch either. |
690b6c3
to
84acb51
Compare
Just ran clang-format :3 |
79d9b59
to
7ab4869
Compare
env var and related docs. Use `QWindow::setWindowStates()` to set the fullscreen state for Qt backend.
a8801b1
to
6914868
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for the patch!
I was looking for examples/fullscreen_toggle/ git describe --tags None of the above is visible to me. git clone https://github.com/slint-ui/slint nothing to commit, working tree clean fullscreen_toggle directory in examples is still not there. I don't understand. I thought this was committed and part of master. |
I just went to the details for this merge/commit. Am I blind? What were those builds and tests using to evaluate that it passed? |
The example was removed at the request of the maintainers before the merge, but you should be able to find the commit hash and use that.
----------------------------------------
Mar 6, 2024 23:32:12 David Marceau ***@***.***>:
…
I just went to the details for this merge/commit.
https://github.com/slint-ui/slint/actions/runs/7456944726/job/20288395478
I don't see anywhere in those details mentioning it building fullscreen_toggle.
Am I blind? What were those builds and tests using to evaluate that it passed?
—
Reply to this email directly, view it on GitHub[#4286 (comment)], or unsubscribe[https://github.com/notifications/unsubscribe-auth/AFZFMUZ3IZ2SAYOWQNAMQQ3YW4EEXAVCNFSM6AAAAABBQXQYSWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOBQG43DSNRQGI].
You are receiving this because you authored the thread.
[Tracking image][https://github.com/notifications/beacon/AFZFMUYYWRBC2QJDJD3FS3TYW4EEXA5CNFSM6AAAAABBQXQYSWWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTTWCASUE.gif]
|
This PR exposes the fullscreen API for both winit and qt to
WindowAdapter
which can be called from client code to set or unset fullscreen status.Removed inflexible env variable
SLINT_FULLSCREEN
and instead use the new API to set fullscreen status.Added an example application
examples/fullscreen_toggle
to demo the toggle.Note that this is a breaking change, if the maintainer believes that the environment variable should be kept, then I am happy to amend this as well.
See #3283