mirror of https://github.com/oupson/FooTerm.git
Change way title is handled in window.vala to avoid cyclic references
This commit is contained in:
parent
ec55437898
commit
e15dbaed1b
|
@ -30,14 +30,14 @@ namespace Footerm {
|
|||
[GtkChild]
|
||||
private unowned Footerm.TerminalPane terminal_pane;
|
||||
|
||||
public signal void title_changed (string new_title);
|
||||
public signal void title_changed (Footerm.Pane pane, string new_title);
|
||||
|
||||
construct {
|
||||
this.new_pane.title_changed.connect ((s) => this.title_changed (s));
|
||||
this.new_pane.title_changed.connect ((s) => this.title_changed (this, s));
|
||||
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.title_changed (this, s.name);
|
||||
this.terminal_pane.title_changed.connect ((s) => this.title_changed (this, s));
|
||||
this.terminal_pane.connect_to_server_async (s);
|
||||
});
|
||||
}
|
||||
|
|
|
@ -42,9 +42,12 @@ namespace Footerm {
|
|||
var pane = new Footerm.Pane ();
|
||||
var tab_page = this.view.append (pane);
|
||||
tab_page.set_title ("New Pane");
|
||||
pane.title_changed.connect ((title) => {
|
||||
pane.title_changed.connect (on_page_title_changed);
|
||||
}
|
||||
|
||||
private void on_page_title_changed (Footerm.Pane pane, string title) {
|
||||
var tab_page = this.view.get_page (pane);
|
||||
tab_page.set_title (title);
|
||||
});
|
||||
}
|
||||
|
||||
private bool close_page (Adw.TabView tab_view, Adw.TabPage page) {
|
||||
|
|
Loading…
Reference in New Issue