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

Bug: Can't resize window using the top border #10813

Closed
DominoKorean opened this issue Dec 22, 2022 · 6 comments
Closed

Bug: Can't resize window using the top border #10813

DominoKorean opened this issue Dec 22, 2022 · 6 comments

Comments

@DominoKorean
Copy link

Description

When holding the window with the mouse to shrink or expand it vertically, the window is not resized and only moves.
Horizontal can be resized normally.

Steps To Reproduce

Grab and move the horizontal part of the window

Steps to fix

Let Files adjust the window freely

Files Version

Version: 2.4.8.0 OS Version: 10.0.19045.2364

Windows Version

Windows 10 Pro 22H2

Relevant Assets/Logs

2022-12-23.00-00-26.mp4
@yaira2
Copy link
Member

yaira2 commented Dec 22, 2022

Seems to be an issue with the drag area as it works to resize from the bottom of the window.

@yaira2 yaira2 changed the title The window cannot be vertically shortened or stretched. Bug: Can't resize window using the top border Dec 22, 2022
@yaira2 yaira2 moved this to 🆕 New in Files task board Dec 22, 2022
@yaira2 yaira2 moved this from 🆕 New to 🔖 Ready to build in Files task board Dec 22, 2022
@hecksmosis
Copy link
Contributor

Resizing works on the top only on the minimize, maximize and close buttons

@yaira2
Copy link
Member

yaira2 commented Mar 19, 2023

@Poker-sang is this solvable with the drag regions helper or is this a WinAppSdk issue?

@Poker-sang
Copy link
Contributor

Poker-sang commented Mar 20, 2023

@yaira2 Both. I just tested it.

Actually, it could be resized vertically, but the resize border on the top is too thin to hold.

If we SetTitleBar instead of my helper then we can make a thick resize border at the top of window (just like the Horizontal ones). But the top of the TabView cannot be grabbed any more.

In fact. This issue is caused by ExtendsContentIntoTitleBar. There are two properties, They are:

  • AppWindow.ExtendsContentIntoTitleBar
  • Window.ExtendsContentIntoTitleBar

When we use Window.ExtendsContentIntoTitleBar, we should write:

<SolidColorBrush x:Key="WindowCaptionBackground">Transparent</SolidColorBrush>
<SolidColorBrush x:Key="WindowCaptionBackgroundDisabled">Transparent</SolidColorBrush>
window.ExtendsContentIntoTitleBar = true;
window.SetTitleBar(titleBar);

It looks like:

  • green represents drag zone
  • red represents resize border
    image
    It has:
  • Normal resize border, but not long enough to cover the top of the window.
  • Small close, maximize, minimize buttons.
  • Toolbar below the title bar.

When we use AppWindow.ExtendsContentIntoTitleBar, we should write:

appWindow.TitleBar.ExtendsContentIntoTitleBar = true;
appWindow.TitleBar.SetDragRectangles(rects);
appWindow.TitleBar.ButtonBackgroundColor = Colors.Transparent;
appWindow.TitleBar.ButtonInactiveBackgroundColor = Colors.Transparent;
appWindow.TitleBar.ButtonHoverBackgroundColor = ((SolidColorBrush)App.Resources["SystemControlBackgroundBaseLowBrush"]).Color;
appWindow.TitleBar.ButtonForegroundColor = ((SolidColorBrush)App.Resources["SystemControlForegroundBaseHighBrush"]).Color;

It looks like:
image
It has:

  • Thin resize border, and has normal length.
  • Normal close, maximize, minimize buttons.
  • Toolbar in the title bar.

If we use both:

It looks like:
image
It has:

  • Both of the resize borders above, behaves just like File Explorer
  • All of the buttons above (I don't know how to fix it).
  • Toolbar below the title bar.

BTW, I prefer to use Window.ExtendsContentIntoTitleBar, what do you think?

@yaira2
Copy link
Member

yaira2 commented Mar 20, 2023

I think we use both to work around issues on Windows 10, perhaps @gave92 can fill us in.

@yaira2
Copy link
Member

yaira2 commented Aug 30, 2023

This issue is fixed in the development branch and will be included in the next release.

@yaira2 yaira2 closed this as completed Aug 30, 2023
@github-project-automation github-project-automation bot moved this from 🔖 Ready to build to ✅ Done in Files task board Aug 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

4 participants