i would like to add that "close fullscreen" circle...
# compose-desktop
z
i would like to add that "close fullscreen" circle like thingy to my app. i have a video component. i know from other video application that when you switch to fullscreen and move the mouse near the top of the screen a circle shaped thingy animated down with an X inside. where you can switch back from fullscreen to window-mode. and when you move the mouse away from the top, the circle thing animates out of view. is there some code snippet i can just copy and paste? has anybody made this already?
s
Unsure if there's something ready, but it's not too hard to do. Add a transparent container on top of the video, in the area where hovering should show the circle, and detect mouse hovers over that area. On hover (in/out), change a boolean state to toggle the visibility of the circle. Here's how to detect mouse hover: https://www.jetbrains.com/help/kotlin-multiplatform-dev/compose-desktop-mouse-events.html#enter-listeners
c
Also, I guess you are taking about windows. Never seen something like this on a Mac. On Mac Full-screen, when you move the mouse to the top of the screen the menu bar appears and you can switch to window mode from there.
s
@Chrimaeon Many apps don't implement the circle thing even on Windows/Linux, as they expect you to use
esc
or some regular "unfullscreen" button to do that. But you're right: what OP is asking for exists in Chrome when in full-screen on Linux/Windows, and it's indeed not present on macOS.
c
why revering to Chrome? we are in #C01D6HTPATV 🤔
z
yeah i have the ESC key leave fullscreen but it may not be obvious to all users how to "escape" the fullscreen mode again. that chrome style (X) is not too bad UI
s
@Chrimaeon Oh I meant what he's trying to do is to mimic what the Chrome app does when it's in fullscreen (has nothing to do with the web) @Zoff yeah, totally valid idea, but as Christian explained, you might wanna disable it when running on macOS.