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

Gtk: change title prompt #5905

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

maciekbartczak
Copy link
Contributor

@maciekbartczak maciekbartczak commented Feb 20, 2025

This PR implements the title change functionality for the GTK app and closes #5769

Demo:

rename_terminal.mp4

For now I came up with a basic UI that i believe is sufficient, but I'm open to feedback and happy to iterate on it further.
#5769 (comment) - Regarding Mitchell's comment I checked Gnome Console and I could not find a similar feature.

@maciekbartczak maciekbartczak requested a review from a team as a code owner February 20, 2025 20:33
@@ -1809,6 +1819,13 @@ fn initContextMenu(self: *App) void {
c.g_menu_append(section, "Split Down", "win.split_down");
}

{
Copy link
Collaborator

Choose a reason for hiding this comment

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

Any menu changes should be deferred until #5781 lands.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I removed the menu entry definition from the code for now.

- use blueprint for the dialog content
- use zig-gobject bindings
- make the enum values lowercase
Comment on lines +1025 to +1026
dialog.addResponse("cancel", "Cancel");
dialog.addResponse("ok", "OK");
Copy link
Contributor Author

@maciekbartczak maciekbartczak Feb 21, 2025

Choose a reason for hiding this comment

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

This could possibly be done from the .blp since there is a responses property on the AlertDialog, however I could not get this to work. Also there are no examples to be found of how do define the responses from the blueprint, so I'm just leaving the definitions in the code right now.

- remove the menu entry defined in code
- set the current title in the input buffer
- fix formatting
- remove unnecessary @ptrCast
- set the default focus to the text entry field
@maciekbartczak
Copy link
Contributor Author

Two things that I modified from the original dialog version:

  • the input box has focus by default
  • the ok response has suggested apperance

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GTK: Add "Change Title" feature
2 participants