obs-studio icon indicating copy to clipboard operation
obs-studio copied to clipboard

UI: Reduce settings dialog default height

Open tytan652 opened this issue 3 years ago • 3 comments

Description

Reduce the size of the settings window if greater than the main window.

Motivation and Context

This change should avoid this to happen again on 720p:

Example OK, Cancel and Apply are not accessible without having to resize the window.

How Has This Been Tested?

  • Set manually the main window size at something 720p-like.
  • Open the settings window.
  • The settings window is smaller in height than the main window.

Types of changes

  • Tweak (non-breaking change to improve existing functionality)

Checklist:

  • [x] My code has been run through clang-format.
  • [x] I have read the contributing document.
  • [x] My code is not on the master branch.
  • [x] The code has been tested.
  • [x] All commit messages are properly formatted and commits squashed where appropriate.
  • [x] I have included updates to all appropriate documentation.

tytan652 avatar Sep 03 '22 10:09 tytan652

It annoys me that Qt in this case is ignoring the monitor's height and treating the default height more like a minimum height. This should be automatic - "if default window size doesn't fit, resize to be smaller, otherwise stay default". Maybe there's a way for us to force it? Maybe we're setting some default heights of internal widgets somewhere causing it to stretch to its default regardless?

WizardCM avatar Sep 05 '22 00:09 WizardCM

Made the fix in code rather than in UI file.

Edit: If the settings window is bigger than the main window in height, it will be reduce to the main window size less 20.

tytan652 avatar Sep 21 '22 19:09 tytan652

I wonder if we could use QScreen::availableGeometry to determine the safest maximum size for a window on the current display. Might provide a slightly better experience than basing it on the height of the main window. However, will need to be tested on Wayland.

WizardCM avatar Dec 10 '22 23:12 WizardCM

On one hand, basing this off the size of the main window feels janky.

On the other hand, if someone has made the main window that small despite having more screen real estate, it's not the worst thing to respect that decision in the settings window too.

I think it would be better to use the screen dimensions instead of the main window.

RytoEX avatar Mar 05 '23 20:03 RytoEX

On the other hand, if someone has made the main window that small despite having more screen real estate, it's not the worst thing to respect that decision in the settings window too.

If the asked height is too small for the windows, it will normally not respect the asked size change.

I think it would be better to use the screen dimensions instead of the main window.

We can't because of the Windows 10/11 taskbar which is the main cause of this PR.

tytan652 avatar Mar 06 '23 13:03 tytan652

On the other hand, if someone has made the main window that small despite having more screen real estate, it's not the worst thing to respect that decision in the settings window too.

If the asked height is too small for the windows, it will normally not respect the asked size change.

I think it would be better to use the screen dimensions instead of the main window.

We can't because of the Windows 10/11 taskbar which is the main cause of this PR.

You can just use 85/90% of the screen dimensions to account for the taskbar's minimum size, which should be sufficient in the vast majority of cases, if not all default cases.

RytoEX avatar Mar 06 '23 20:03 RytoEX

@RytoEX While not perfect this seems reasonable to me? Got any objections to having this merged?

PatTheMav avatar Dec 08 '23 13:12 PatTheMav

Off-thread review yielded that the constructor is too early for this to occur, as the widget does not yet have its screen updated. Overloading showEvent and handling this there is late enough for the widget's screen to be correct. @Warchamp7 is driving this.

RytoEX avatar Apr 08 '24 22:04 RytoEX

Rebased. Will clean up commits and implement some changes from off-thread review.

RytoEX avatar Apr 15 '24 21:04 RytoEX