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

Add and enforce minimum width #5599

Merged
4 commits merged into from
Apr 28, 2020
Merged

Add and enforce minimum width #5599

4 commits merged into from
Apr 28, 2020

Conversation

carlos-zamora
Copy link
Member

@carlos-zamora carlos-zamora commented Apr 27, 2020

Summary of the Pull Request

Enforces a minimum width of 460 wide. This allows tabs to always be seen (albeit partially).

NOTE: A minimum height was originally added to allow the About menu to be seen. This minimum height was removed from this PR because we don't foresee a circumstance where your Terminal is in that state, and you can't just resize it to make the content fit properly.

References

#4990 may be fixed/affected by this?

PR Checklist

Validation Steps Performed

Here's some images of what the terminal looks like when it's at its minimum size:

100% scaling

100% scaling: one tab

100% scaling: one tab

100% scaling: two tabs

100% scaling: two tabs

100% scaling: 3 tabs (scrolling enabled)

100% scaling: 3 tabs (scrolling enabled)

200% scaling

200% scaling: one tab

200% scaling: one tab

200% scaling: two tabs

200% scaling: two tabs

200% scaling: 3 tabs (scrolling enabled)

200% scaling: 3 tabs (scrolling enabled)

@carlos-zamora carlos-zamora added Area-User Interface Issues pertaining to the user interface of the Console or Terminal Area-Accessibility Issues related to accessibility Product-Terminal The new Windows Terminal. labels Apr 27, 2020
Copy link
Contributor

@DHowett-MSFT DHowett-MSFT left a comment

Choose a reason for hiding this comment

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

Please make sure this applies when snapToGridOnResize is false.

Please share a sample (screenshot?) of how big/small this minimum size is.

Maybe we should only enforce a minimum width.

@ghost ghost added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Apr 27, 2020
Copy link
Member

@zadjii-msft zadjii-msft left a comment

Choose a reason for hiding this comment

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

I concur with:

@ghost ghost removed the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Apr 27, 2020
@DHowett-MSFT
Copy link
Contributor

        template<typename TilMath>
        size scale(TilMath, const float scale) const
        {
            struct
            {
                float Width, Height;
            } sz;
            THROW_HR_IF(E_ABORT, !base::CheckMul(scale, _width).AssignIfValid(&sz.Width));
            THROW_HR_IF(E_ABORT, !base::CheckMul(scale, _height).AssignIfValid(&sz.Height));

            return til::size(TilMath(), sz);
        }

???????? definitely exists

sz.scale(til::math::rounding, 1.5f)

@carlos-zamora
Copy link
Member Author

        template<typename TilMath>
        size scale(TilMath, const float scale) const
        {
            struct
            {
                float Width, Height;
            } sz;
            THROW_HR_IF(E_ABORT, !base::CheckMul(scale, _width).AssignIfValid(&sz.Width));
            THROW_HR_IF(E_ABORT, !base::CheckMul(scale, _height).AssignIfValid(&sz.Height));

            return til::size(TilMath(), sz);
        }

???????? definitely exists

sz.scale(til::math::rounding, 1.5f)

Yeah. Michael just gave me a walkthrough on it and being able to cast the output. I've been out of the loop for a while haha.

@carlos-zamora
Copy link
Member Author

I concur with:

  • Please make sure this applies when snapToGridOnResize is false.

Just verified it, works fine.

  • Maybe we should only enforce a minimum width.

#5418 needs the width and height. Width ensures tabs can always be read. Height ensures about menu fits (see attached features above.

I can't actually get a repro on this one. But I can't get it on 0.11 either. @DHowett-MSFT or @zadjii-msft, if either of you can actually get a repro on this, would you mind checking it? Mainly just tagged it because there's a comment that enforcing a minimum size might help.

@carlos-zamora
Copy link
Member Author

Here's an idea of how big the minimum size is:
minimum size example

@DHowett-MSFT
Copy link
Contributor

This is too tall. people will hate it.

@DHowett-MSFT
Copy link
Contributor

Some people legitimately want a one-line-tall terminal. Let's not optimize around an ephemeral dialog.

@carlos-zamora
Copy link
Member Author

I hate it too :/ But how else can we get the About menu to fit?

@zadjii-msft
Copy link
Member

zadjii-msft commented Apr 27, 2020 via email

@DHowett-MSFT
Copy link
Contributor

I'm a hard NAK on the height. Width is fine. Min height = tab strip height. Let people make their about dialogs disappear.

@carlos-zamora carlos-zamora changed the title Enforce 460x380 minimum size Add and enforce minimum width Apr 27, 2020
@carlos-zamora
Copy link
Member Author

Updated the PR to only enforce the minimum width.

Copy link
Member

@zadjii-msft zadjii-msft left a comment

Choose a reason for hiding this comment

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

Nice, thanks for checking those things!

@DHowett-MSFT
Copy link
Contributor

Thanks

@carlos-zamora carlos-zamora added the AutoMerge Marked for automatic merge by the bot when requirements are met label Apr 28, 2020
@ghost
Copy link

ghost commented Apr 28, 2020

Hello @carlos-zamora!

Because this pull request has the AutoMerge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (@msftbot) and give me an instruction to get started! Learn more here.

@ghost ghost merged commit db5d2fe into master Apr 28, 2020
@ghost ghost deleted the dev/cazamor/a11y/resize branch April 28, 2020 23:24
@ghost
Copy link

ghost commented May 5, 2020

🎉Windows Terminal Release Candidate v0.11.1251.0 (1.0rc1) has been released which incorporates this pull request.:tada:

Handy links:

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Accessibility Issues related to accessibility Area-User Interface Issues pertaining to the user interface of the Console or Terminal AutoMerge Marked for automatic merge by the bot when requirements are met Product-Terminal The new Windows Terminal.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Minimize button disappears at minimum size
3 participants