team-phoenix / Phoenix

A multi-system emulator and library manager designed to be both powerful and easy to use.
http://phoenix.vg
GNU General Public License v2.0
377 stars 39 forks source link

Make use of native fullscreen hotkey #251

Closed MaxMansfield closed 8 years ago

MaxMansfield commented 8 years ago

Brief:

This commit allows the user to press the native hotkey on their system to fullscreen the application. This is based on desktop environment and so is CTRL+F11 on GNOME and F11 on most other platforms.

This works well because some systems (such as chromebooks) do not have an F11 key and must make use of other system defined hotkeys

Likewise, the key combinations shouldn't conflict with any games

Changes:

1. Added `id:` of fullscreenItem to the Item that handles
   the fullscreen game action

2. Added contents of the MouseArea `onClicked:` signal
   to a function inside fullscreenItem called
   prepareFullscreen()

3. Added a shortcut to StandardKey.Fullscreen which calls
   prepareFullscreen() as its callback

Data

Here's What it looks like from the main page

Also works in a GameView

72582-hotkey-pressed-pressed-again

athairus commented 8 years ago

Thanks for the PR. I had some issues with ContentArea sometimes not resizing down to the original size when leaving fullscreen (Windows 10)... the entire UI needs extensive refactoring.

I'll merge anyway, this will be used in whatever new code I write.

athairus commented 8 years ago

Merged without waiting for you to add the semicolons... oops! I added them myself.