Skip to content
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

desktop: Add View menu #17042

Merged
merged 4 commits into from
Jul 30, 2024
Merged

desktop: Add View menu #17042

merged 4 commits into from
Jul 30, 2024

Conversation

kjarosh
Copy link
Member

@kjarosh kjarosh commented Jul 8, 2024

This PR adds the "View" menu, which is responsible for controlling the view:

  1. options "100% (Unscaled)" and "Zoom to Fit" are analogous to FP's "100%" and "Show All",
  2. options "Stretch to Fit" and "Crop to Fit" allow setting other scale modes which are not in FP,
  3. option "Letterbox" controls letterbox rendering when "Zoom to Fit" is selected,
  4. option "Full Screen" enter the full screen (as in FP),
  5. option "Quality" selects the quality (as in FP, context menu does not have to be always shown).

image
image

@kjarosh kjarosh added the A-desktop Area: Desktop Application label Jul 8, 2024
Comment on lines +348 to +378
ui.menu_button(text(locale, "quality"), |ui| {
let items = vec![
("quality-low", StageQuality::Low),
("quality-medium", StageQuality::Medium),
("quality-high", StageQuality::High),
("quality-best", StageQuality::Best),
("quality-high8x8", StageQuality::High8x8),
("quality-high8x8linear", StageQuality::High8x8Linear),
("quality-high16x16", StageQuality::High16x16),
("quality-high16x16linear", StageQuality::High16x16Linear),
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm reusing here strings from settings.ftl, not sure whether it's a good idea

@Dinnerbone
Copy link
Contributor

I think I'd prefer for the 4 scale modes to be together, either in a submenu or just all together in the view menu with a separator below them.

I get that it's more Flash-like... but it's not intuitive 😅 We don't need to follow them in UI practices.

For wording, maybe "Stretch to Fit" and "Crop to Fit" would be more appropriate too? "100%" and "Show All" are confusing and honestly for all these years, until reading the code for this PR I never knew what they actually meant. Now I know! :D

Maybe:

  • 100% (Unscaled)
  • Zoom to Fit
  • Stretch to Fit
  • Crop to Fit

Or I guess just the same text that we show in Open Advanced today?

@kjarosh
Copy link
Member Author

kjarosh commented Jul 8, 2024

Some variants to visualize:

Submenu No submenu Submenu, integrated letterbox

@Dinnerbone
Copy link
Contributor

Thanks for that!

I think I'd prefer to leave letterbox as a separate thing - maybe grey it out if it doesn't make sense for the current mode. Having just "on/off" for letterbox is maybe a bit confusing and inconsistent if in Open Advanced we have 4 options instead of just 2 - but I don't think I care too much either way here.

Submenu looks ideal to me, but I'd call it "Scale Mode", not just "Mode".

@Croworbit
Copy link

will this allow for these options to be changed in real time like FP?

@kjarosh
Copy link
Member Author

kjarosh commented Jul 8, 2024

@Dinnerbone

image

I think we have 3 options for a letterbox when opening: On, Off, Fullscreen Only. However as long as the third option makes sense when opening a SWF, it does not make too much sense when changing the value at runtime, because if I want to have letterbox enabled at fullscreen, I can just enable it and then enter fullscreen.

Regarding the scale mode options when opening a SWF, I think they are confusing — I had to test what they do, exactly as I had to test what FP's Show All does. IMO your suggestions are a lot better (maybe we should even change the Open Advanced translations?).

@kjarosh
Copy link
Member Author

kjarosh commented Jul 8, 2024

will this allow for these options to be changed in real time like FP?

Yes, that's the point of these options

@Croworbit
Copy link

Croworbit commented Jul 8, 2024

also please don't change the view mode names from what they are now
the old names from flash might not make too much sense naming wise, but many of us know what they do. People know what they 'mean' in context of flash
and comparing to flash is easy when they have those names
with the 'x to fit' scheme, I couldn't tell you which is which

maybe a tooltip can show a mode's aliases, and describe what it does? or a help icon to click?

@kjarosh kjarosh force-pushed the desktop-view-menu branch 5 times, most recently from 3c3894f to 7994a3f Compare July 12, 2024 22:26
@kjarosh kjarosh force-pushed the desktop-view-menu branch from 7994a3f to ccfc02a Compare July 22, 2024 11:16
@kjarosh kjarosh added the waiting-on-review Waiting on review from a Ruffle team member label Jul 23, 2024
@kjarosh kjarosh force-pushed the desktop-view-menu branch from ccfc02a to f566925 Compare July 23, 2024 14:52
@kjarosh kjarosh force-pushed the desktop-view-menu branch 2 times, most recently from bf05212 to fec2283 Compare July 24, 2024 07:59
@kjarosh kjarosh force-pushed the desktop-view-menu branch 2 times, most recently from be2bdb2 to 2abdfbf Compare July 29, 2024 14:32
@kjarosh kjarosh requested a review from Dinnerbone July 29, 2024 19:18
Copy link
Contributor

@Dinnerbone Dinnerbone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much, sorry again about all the bikeshedding!

@Dinnerbone Dinnerbone merged commit c54b1b5 into ruffle-rs:master Jul 30, 2024
16 of 17 checks passed
@kjarosh kjarosh deleted the desktop-view-menu branch July 30, 2024 22:31
@evilpie evilpie removed the waiting-on-review Waiting on review from a Ruffle team member label Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-desktop Area: Desktop Application newsworthy
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants