mirror of https://github.com/oupson/FooTerm.git
Change tab name
This commit is contained in:
parent
ef8f570ba5
commit
533617d59f
|
@ -30,9 +30,13 @@ namespace Footerm {
|
|||
[GtkChild]
|
||||
private unowned Footerm.TerminalPane terminal_pane;
|
||||
|
||||
public signal void title_changed (string new_title);
|
||||
|
||||
construct {
|
||||
this.new_pane.on_server_selected.connect ((s) => {
|
||||
this.footerm_pane_stack.set_visible_child (this.terminal_pane);
|
||||
this.title_changed (s.name);
|
||||
this.terminal_pane.title_changed.connect ((s) => this.title_changed (s));
|
||||
this.terminal_pane.connect_to_server_async (s);
|
||||
});
|
||||
}
|
||||
|
|
|
@ -37,6 +37,8 @@ namespace Footerm {
|
|||
private int old_terminal_width = 0;
|
||||
private int old_terminal_height = 0;
|
||||
|
||||
public signal void title_changed(string new_title);
|
||||
|
||||
construct {
|
||||
this.configure_terminal();
|
||||
}
|
||||
|
@ -83,6 +85,13 @@ namespace Footerm {
|
|||
this.terminal.set_enable_sixel(true);
|
||||
this.terminal.char_size_changed.connect(this.terminal_appearance_changed);
|
||||
this.terminal.contents_changed.connect(this.terminal_appearance_changed);
|
||||
this.terminal.window_title_changed.connect((t) => {
|
||||
var terminal_title = t.window_title;
|
||||
if (terminal_title.length == 0) {
|
||||
terminal_title = this.server.name;
|
||||
}
|
||||
this.title_changed(terminal_title);
|
||||
});
|
||||
this.setup_terminal_theme();
|
||||
}
|
||||
|
||||
|
|
|
@ -32,13 +32,19 @@ namespace Footerm {
|
|||
this.view.close_page.connect (this.close_page);
|
||||
var action = new SimpleAction ("new_tab", null);
|
||||
action.activate.connect (() => {
|
||||
var a = view.append (new Footerm.Pane ());
|
||||
a.set_title ("New Pane");
|
||||
view.set_selected_page (a);
|
||||
this.create_new_pane ();
|
||||
});
|
||||
this.add_action (action);
|
||||
var a = view.append (new Footerm.Pane ());
|
||||
a.set_title ("New Pane");
|
||||
this.create_new_pane ();
|
||||
}
|
||||
|
||||
private void create_new_pane () {
|
||||
var pane = new Footerm.Pane ();
|
||||
var tab_page = this.view.append (pane);
|
||||
tab_page.set_title ("New Pane");
|
||||
pane.title_changed.connect ((title) => {
|
||||
tab_page.set_title (title);
|
||||
});
|
||||
}
|
||||
|
||||
private bool close_page (Adw.TabView tab_view, Adw.TabPage page) {
|
||||
|
|
Loading…
Reference in New Issue