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

Enable Close/Quit/Collapse/Expand buttons on Border #2814

Closed
drweb86 opened this issue Aug 16, 2023 · 3 comments
Closed

Enable Close/Quit/Collapse/Expand buttons on Border #2814

drweb86 opened this issue Aug 16, 2023 · 3 comments
Assignees
Labels
enhancement v2 For discussions, issues, etc... relavant for v2
Milestone

Comments

@drweb86
Copy link

drweb86 commented Aug 16, 2023

Mini-Spec

Three scenarios so far:

  • User clicks on a button in the Border (top/right) that causes a Modal to quit.
  • User clicks on a button in the Border (top/right) that causes an Overlapped to close/hide.
  • User clicks on a button in the Border (top/right) that causes the view to collapse/expand.

We will create 3 new View subclasses, one for each of these:

  • ApplicationQuitter - Glyph is an X. MouseClick, and KeyBinding (Space) invoke Command.QuitToplevel (to be renamed to Command.Close). The command handler simply calls Application.RequestStop().
  • ViewHider -  Glyph is an X. MouseClick, and KeyBinding (Space) invoke Command.Close. The command handler simply calls SuperView.Parent.Visible = false. (or perhaps we add Close() as a verb on View?).
  • ViewExpander - Glyph is a up/down arrow. MouseClick, and KeyBinding (Space) invoke Command.ToggleExpandCollapse. Command hander
    • Disables/Hides/Enables/Shows SuperView.Parent's subviews
    • Sets the Height of the SuperView.Parent to 3 or Dim.Auto

Devs will add these views via view.Border.Add.

This is what ViewExpander will look like/do:

9rGXIUs 1

I've built a POC of ViewExpander in #3376

Background

This is a sub-issue of:

Will be fixed in this PR as a proof:

Background

Is your feature request related to a problem? Please describe.
I want user to be able to close button by [X] button near dialog title from top right side. And I want them to be shown in Query dialogs by default. Because when you pass no button its not clear, that you need Escape button to be pressed to close it.

Describe the solution you'd like
For dialogs and querries to have [x] button: Dialog Title [x]

Describe alternatives you've considered
Have close button as now.

@BDisp
Copy link
Collaborator

BDisp commented Aug 16, 2023

I remember a long time ago, to add [ Ok ] button on MessageBox if no buttons are provided on the parameters, but wasn't accepted at the time. I really don't like when there is no button at all, but also I think if it's only to close the dialog it isn't need to explicit add a button in the parameters. Good luck :-)

@tig
Copy link
Collaborator

tig commented Aug 16, 2023

This will be easy to accomplish in v2 once adornments are full implemented.

@tig tig added enhancement v2 For discussions, issues, etc... relavant for v2 labels Aug 18, 2023
@tig tig moved this to 🆕 Not Triaged in Terminal.Gui V2 Beta May 13, 2024
@tig tig added this to the V2 Beta milestone May 25, 2024
@tig tig changed the title Add Close button to Windows, Like this Dialog Title [x] Enable Close/Quit/Collapse/Expand buttons on Border May 25, 2024
@tig tig moved this to 📋 Approved - Need Owner in Terminal.Gui V2 Initial Release Jul 11, 2024
@tig tig self-assigned this Aug 6, 2024
@tig
Copy link
Collaborator

tig commented Aug 13, 2024

Closing as dupe of #3407

@tig tig closed this as completed Aug 13, 2024
@github-project-automation github-project-automation bot moved this from 📋 Approved - Need Owner to ✅ Done in Terminal.Gui V2 Initial Release Aug 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement v2 For discussions, issues, etc... relavant for v2
Projects
Status: ✅ Done
Status: 🆕 Not Triaged
Development

No branches or pull requests

3 participants