ConsoleGuiTools
ConsoleGuiTools copied to clipboard
OCGV: Add ability to minimize UI
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;
}
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?
I like the idea of being able to customize the UI, however, I wonder if
-MinUIis 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
@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"
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...
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.
Or,
iocgv -UI [All*, None, Filter, Headers, Frame, StatusBar]
Where All is default.
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.
Actually, I would love the -NoFrame, -NoFilter, and -NoStatusBar that were proposed. I very frequently desire some of those but not others.
Fixed in #166