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

OCGV: Add ability to minimize UI #116

Closed
tig opened this issue Sep 29, 2020 · 9 comments
Closed

OCGV: Add ability to minimize UI #116

tig opened this issue Sep 29, 2020 · 9 comments
Labels
enhancement New feature or request Module-ConsoleGuiTools This issue is about Microsoft.PowerShell.ConsoleGuiTools

Comments

@tig
Copy link
Collaborator

tig commented Sep 29, 2020

The window border, filter box, and status bar use valuable screen real estate. I'd like to have an option of not having it visible.

I considered having parameters for all of them:

  • -NoFrame
  • -NoFilter
  • -NoStatusBar

But that seems overkill. Instead, just:

  • -MinUI

I just pushed a change to Terminal.Gui that will enable hiding the statusbar. Then all that's needed is to change the logic that creates the Window to:

        private Window AddTopLevelWindow()
        {
            // Creates the top-level window to show
            var win = new Window(_applicationData.Title)
            {
                X = _applicationData.MinUi ? -1 : 0,
                Y = _applicationData.MinUi ? -1 : 0,
                // By using Dim.Fill(), it will automatically resize without manual intervention
                Width = Dim.Fill(_applicationData.MinUi ? -1 : 0),
                Height = Dim.Fill(_applicationData.MinUi ? -1 : 1)
            };

            Application.Top.Add(win);
            return win;
        }
@TylerLeonhardt TylerLeonhardt added enhancement New feature or request Module-ConsoleGuiTools This issue is about Microsoft.PowerShell.ConsoleGuiTools labels Sep 30, 2020
@SteveL-MSFT
Copy link
Member

I like the idea of being able to customize the UI, however, I wonder if -MinUI is sufficient or over time we end up with lots of switches/parameters? Perhaps accept a hashtable that accepts customization options?

@tig
Copy link
Collaborator Author

tig commented Oct 15, 2020

I like the idea of being able to customize the UI, however, I wonder if -MinUI is sufficient or over time we end up with lots of switches/parameters? Perhaps accept a hashtable that accepts customization options?

Steve, is there a built-in way for PS cmdlets to take multiple options (OR) in a parameter? E.g.

ocgv -UIOptions A | B | C

@TylerLeonhardt
Copy link
Member

TylerLeonhardt commented Oct 15, 2020

@tig it can accept an array.

ocgv -HideUIElement Filter,Frame,foo,bar

The type of the parameter HideUIElement can be an enum array so tab completion "just works"

@tig
Copy link
Collaborator Author

tig commented Oct 15, 2020

Based on this feedback I will revisit this PR using HideUIElement as the parameter and implement flags as suggested.

But, I will include a All in the enum...

@TylerLeonhardt
Copy link
Member

I'm not married to the name HideUIElement but I do think this kind of parameter seems pretty cool. I like adding All and None where None is the default value.

@tig
Copy link
Collaborator Author

tig commented Oct 15, 2020

Or,

iocgv -UI [All*, None, Filter, Headers, Frame, StatusBar]

Where All is default.

@TylerLeonhardt
Copy link
Member

hmm... I'm not sure. If we go with -UI and then we add another thing to the enum, it wouldn't show up and I'm not sure if that's a good thing or a bad thing because I would want new things to be visible first so the user can see the new capability.

@RokeJulianLockhart
Copy link

Actually, I would love the -NoFrame, -NoFilter, and -NoStatusBar that were proposed. I very frequently desire some of those but not others.

@tig
Copy link
Collaborator Author

tig commented Aug 24, 2022

Fixed in #166

@tig tig closed this as completed Aug 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Module-ConsoleGuiTools This issue is about Microsoft.PowerShell.ConsoleGuiTools
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants