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

Make OSD screen bigger if possible #2916

Merged
merged 1 commit into from
May 20, 2022

Conversation

McGiverGim
Copy link
Member

@McGiverGim McGiverGim commented May 8, 2022

Fixes #2631

This is an attempt to make the OSD scale with large resolutions. This is the first versions, it needs:

  • To be cleaned
  • Tested under different devices resolutions.
  • Make some final adjustments

I publish it in this form to get some feedback and testing.

This is an example of before:
image

And after:
image

@github-actions

This comment has been minimized.

@asizon
Copy link
Member

asizon commented May 8, 2022

@McGiverGim this is my result lol:

image

src/css/tabs/osd.css Outdated Show resolved Hide resolved
@HThuren
Copy link
Member

HThuren commented May 8, 2022

What about a possibility to change the OSD background from the IDE ?

@McGiverGim
Copy link
Member Author

@McGiverGim this is my result lol:

@asizon What screen resolution are you using? I think I forgot maybe give a min-size to the display. I will test it later.

What about a possibility to change the OSD background from the IDE ?

@HThuren we have a petition of not do it :P

/* please don't copy the generic background image from another project
* and replace the one that @nathantsoi took :)
*/

But I think you can open a feature request for this. This petition is out of the scope of this PR.

@asizon
Copy link
Member

asizon commented May 9, 2022

@McGiverGim not sure about my screen resolution, but is small, i can check it later.

@McGiverGim
Copy link
Member Author

McGiverGim commented May 9, 2022

@asizon modified the code. Changed the "manual" adjustment in JS to a lot of FLEX magic in CSS. Now I hope it adjusts to your resolution...

@github-actions

This comment has been minimized.

@haslinghuis
Copy link
Member

haslinghuis commented May 9, 2022

Windows 10 1600x900:

image

src/css/tabs/osd.css Outdated Show resolved Hide resolved
@McGiverGim McGiverGim force-pushed the osd_preview_resizable branch 2 times, most recently from 79e473c to f684092 Compare May 10, 2022 06:46
@McGiverGim
Copy link
Member Author

Modified, rebased and cleaned. Ready for a real review and test.

@McGiverGim McGiverGim marked this pull request as ready for review May 10, 2022 06:47
@github-actions

This comment has been minimized.

@blckmn
Copy link
Member

blckmn commented May 10, 2022

AUTOMERGE: (FAIL)

  • github identifies PR as mergeable -> FAIL
  • assigned to a milestone -> PASS
  • cooling off period lapsed -> PASS
  • commit count less or equal to three -> PASS
  • Don't merge label NOT found -> PASS
  • at least one RN: label found -> PASS
  • Tested label found -> FAIL
  • assigned to an approver -> PASS
  • approver count at least three -> FAIL

@benlumley
Copy link
Contributor

benlumley commented May 10, 2022

Screenshot 2022-05-10 at 10 19 06

Testing on MacOS here - there's a point here that may not be as intended (it's before the nav bar collapses)

One fix is to put flex-wrap: nowrap on the container (in an appropriate media query I guess?)

Or maybe we just don't support this size ? The header is going wrong too...

@McGiverGim
Copy link
Member Author

McGiverGim commented May 10, 2022

@benlumley thanks for the feedback...

Pushed a new version, I've adjusted the size of the columns to fit in the space just before the collapse of the menu. Is a little ugly, the texts and the selects of the OSD lateral columns wrap, but all remains in correct position. There is not too much that we can do with this small resolution.
Another solution is to move to the Android layout, only one colum with OSD first, but is better to limit this option to small screens.
The header goes wrong when you use the "virtual FC", because it takes space used by the header. Has nothing to do with this PR, but you can open a bug for it.

EDIT: another solution is maybe collapse the menu a little earlier...

@McGiverGim McGiverGim requested a review from asizon May 10, 2022 14:50
@github-actions

This comment has been minimized.

haslinghuis
haslinghuis previously approved these changes May 11, 2022
Copy link
Member

@haslinghuis haslinghuis left a comment

Choose a reason for hiding this comment

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

Can't test OSX otherwise it's LGTM

Need to refresh my skills: https://developer.mozilla.org/en-US/docs/Web/CSS/flex-basis

@mrRobot62
Copy link

Found a little hickup for this solution.

Min-Width of the window is limited as well as min-height of window but min-height limiting is to small, because OSD image is cropped. Min-height limitation should be a little bit bigger. Will include a screenshoot asap

@benlumley
Copy link
Contributor

Just tested on mac...

Issue gone from me; looks good at all widths; here's a range of screenshots....

Screenshot 2022-05-11 at 09 43 12

Screenshot 2022-05-11 at 09 43 50

Screenshot 2022-05-11 at 09 43 43

Screenshot 2022-05-11 at 09 43 30

Screenshot 2022-05-11 at 09 43 22

Screenshot 2022-05-11 at 09 42 59

@mrRobot62
Copy link

mrRobot62 commented May 11, 2022

on my Mac below images with min-width and min-height
image

Image is cropped

@McGiverGim
Copy link
Member Author

@mrRobot62 what resolution is this? I will change it to take into account the height of the window.

@mrRobot62
Copy link

mrRobot62 commented May 11, 2022

image

And with rulers
image

@McGiverGim - take a look at the left border, the menu is cropped too. The context area should be a little bit smaler, to see the menu icons (without text) but icons should visible completely. That's more user friendly

@McGiverGim
Copy link
Member Author

A little magic in the CSS and now it adjusts to the height too... at the minimum height it is a little out of screen, but it was before this change too... the only solution is to limit a little more the minimum resolution.

@github-actions

This comment has been minimized.

src/css/tabs/osd.css Outdated Show resolved Hide resolved
src/tabs/osd.html Outdated Show resolved Hide resolved
@McGiverGim
Copy link
Member Author

Pushed new version with the little fixes of latest review.

@github-actions

This comment has been minimized.

haslinghuis
haslinghuis previously approved these changes May 14, 2022
@haslinghuis
Copy link
Member

@McGiverGim please rebase

@sonarcloud
Copy link

sonarcloud bot commented May 20, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@github-actions
Copy link
Contributor

Do you want to test this code? Here you have an automated build:
Betaflight-Configurator-Android
Betaflight-Configurator-Linux
Betaflight-Configurator-macOS
Betaflight-Configurator-Windows
WARNING: It may be unstable and result in corrupted configurations or data loss. Use only for testing!

@ctzsnooze
Copy link
Member

ctzsnooze commented May 20, 2022

Works well on my Mac! Looks great - thank you!

@haslinghuis haslinghuis merged commit d92a49a into betaflight:master May 20, 2022
Finalizing Firmware 4.3 Release automation moved this from Ready for review to Finished (Merged) May 20, 2022
@mrRobot62
Copy link

sorry guys - same issue as I postet days ago - MacBook Pro, Catalina

image

Monitor resolution
image

@mrRobot62
Copy link

my recommendation limit width and height auf the main window - like this

image

@McGiverGim
Copy link
Member Author

Use the scroll to center the OSD. Of course limiting the size is another option but it's not necessary at this moment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

OSD scaling for larger pc monitors
8 participants