13
0

T: Select name-entry when switching to "new session" tab

This commit is contained in:
Robin Gareus 2024-05-30 20:16:29 +02:00
parent 2af049abb1
commit 2165f3ffaa
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -240,9 +240,17 @@ SessionDialog::tab_page_switched(GtkNotebookPage*, guint page_number)
//check the status of each tab and sensitize the 'open' button appropriately //check the status of each tab and sensitize the 'open' button appropriately
open_button->set_sensitive(false); open_button->set_sensitive(false);
switch (page_number) { switch (page_number) {
case 0: new_name_changed(); break; case 0:
case 1: recent_session_row_selected(); break; new_name_changed();
case 2: existing_file_selected(); break; new_name_entry.select_region (0, -1);
new_name_entry.grab_focus ();
break;
case 1:
recent_session_row_selected();
break;
case 2:
existing_file_selected();
break;
} }
} }
@ -605,10 +613,7 @@ void
SessionDialog::setup_untitled_session () SessionDialog::setup_untitled_session ()
{ {
new_name_entry.set_text (string_compose (_("Untitled-%1"), Glib::DateTime::create_now_local().format ("%F-%H-%M-%S"))); new_name_entry.set_text (string_compose (_("Untitled-%1"), Glib::DateTime::create_now_local().format ("%F-%H-%M-%S")));
new_name_entry.select_region (0, -1);
new_name_was_edited = false; new_name_was_edited = false;
new_name_entry.grab_focus ();
} }
void void