Nannou: simplify fullscreen

Created on 24 Mar 2020  路  4Comments  路  Source: nannou-org/nannou

as per discussion with mindtree on slack, we thought it could be nice to:

  1. provide the Fullscreen type in the prelude to make it easier to access
  2. add some simplified "wrapper" builder methods like .fullscreen_on_primary_monitor() , .fullscreen_exclusive(), .fullscreen_on_monitor(monitor_handle)
good first issue user experience

Most helpful comment

Thanks for the input @felixfaire !

One thing that makes this a little easier for cinder is that C++ has default function arguments. That said, I totally agree we can probably use nicer names for the common cases! How about something like:

  • .fullscreen() - 95% use case - fullscreen on the current display
  • .fullscreen_with(fullscreen_opts) - fullscreen with the given Fullscreen options (see docs here).

Maybe this is a bit nicer?

All 4 comments

fullscreen_on_primary_monitor() seems a little verbose for what is probably 95% of desired user behaviour no? (ie to simply make the app full screen on the current display).

For example Cinder has one function to set / toggle fullscreen:
setFullScreen (bool fullScreen=true, const FullScreenOptions &options=FullScreenOptions())

The FullScreenOptions struct contains all the additional options that one might need for kiosk, exclusive, specific display etc. in advanced usecases but still has very low cognitive load / verbosity for the basic use case.

Thanks for the input @felixfaire !

One thing that makes this a little easier for cinder is that C++ has default function arguments. That said, I totally agree we can probably use nicer names for the common cases! How about something like:

  • .fullscreen() - 95% use case - fullscreen on the current display
  • .fullscreen_with(fullscreen_opts) - fullscreen with the given Fullscreen options (see docs here).

Maybe this is a bit nicer?

lovely. i havent looked much into the nannou specific use yet but is this an app initalising argument / setting? Is there a way to use this during runtime too? ie set full screen to true or false on user input?

Good Question! initially I was imagining we'd add this as a window builder, but now that you mention it, it would also be really handy to have this on the app builder, especially for sketches where you don't have access to the window creation process.

And yes, you can currently set fullscreen with .set_fullscreen(Option<Fullscreen>), but it would be nice to change this method to follow the convention of the builder method. Maybe it should look like this:

  • window.set_fullscreen(bool); Enable/disable borderless fullscreen on current monitor
  • window.set_fullscreen_with(Options<Fullscreen>); Enable fullscreen with Some(opts), disable with None.
Was this page helpful?
0 / 5 - 0 ratings

Related issues

JoshuaBatty picture JoshuaBatty  路  4Comments

mkesper picture mkesper  路  4Comments

batchku picture batchku  路  3Comments

freesig picture freesig  路  3Comments

dimitre picture dimitre  路  3Comments