-
Notifications
You must be signed in to change notification settings - Fork 63
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
Fix exit using 'StatusBar'. Finally/Properly addresses Issue #61 #85
Fix exit using 'StatusBar'. Finally/Properly addresses Issue #61 #85
Conversation
Co-Authored-By: Tyler James Leonhardt <tylerl0706@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should probably do a rebase/merge what's currently in master into this branch as I still see changes that were in the other PRs
This is looking good though!
Now? |
Since the status bar items aren't buttons, maybe it's a good idea to include a 3rd one That way the status bar represents more of a legend. |
Also just want to confirm... What happens when you press |
It exits with no items selected. Which makes perfect sense to me. |
Seems like a reasonable ask. Done. |
@tig do you know if the filter "filters on type" now? I know that was an active issue in gui.cs. If so, we can get rid of the apply button here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One typo
// Use Key.Unknown for SPACE with no delgate because ListView already | ||
// handles SPACE | ||
new StatusItem(Key.Unknown, "~SPACE~ Mark Item", null), | ||
new StatusItem(Key.Enter, "~ENTER~ Accept", () => Accept()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just thought of another concern with ENTER
... if the user types in the filter box, they might be inclined to hit ENTER
to apply the filter. (especially if it doesn't filter-on-type which was a known issue in gui.cs)
I know I do this all the time in basically any search box.
I would hate for my ocgv to accidentally close from me wanting to apply the search.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternative would be to have Ctrl+Enter to accept?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still prefer Ctrl+X for Exit (used by Nano) or Ctrl+Q for Quit (used by Micro), but ok waiting on user feedback.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, this is how Windows (and Mac and I think Linux) GUI modal windows work. ENTER accepts and ESC cancels.
The filter is real-time, right? So there is no need for a user to hit ENTER to make it do it's thing, right?
One thing we could do, if this proves to be a problem (which I don't think it will be), is to make it so that if the filter TextField
has focus, ignore ENTER (or move focus to the list).
But I don't think this will be a problem because Out-ConsoleGridView
is a modal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest we ship it as-is and wait for user feedback. The model, as-is, is simple and matches an existing well established idiom.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
especially if it doesn't filter-on-type which was a known issue in gui.cs
Tyler, do you know if there's an issue filed against gui.cs
for this? I can't find one; happy to create and look into it regardless.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like it's fixed: gui-cs/Terminal.Gui#349
If the filter Changed event is working now, then can you remove the apply button in this PR? I don't want any confusion with the ENTER
key.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. This is much better this way.
Note there are bugs in the filter code though. I'll report them separately, but they have to do with filtering for single chars. Some seem to exist in ogv
and some seem specific to the ocgv
implementation...
In the gif, the first time it's run, a portion of the left and right borders is missing? |
Yes; Fixed here: #83 |
I will merge this in and will have a fix for the filter shortly after. |
See Issue #61.
Here's how it looks/works: