[geary/wip/765516-gtk-widget-conversation-viewer: 194/207] Minor composer container cleanup.
- From: Michael Gratton <mjog src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geary/wip/765516-gtk-widget-conversation-viewer: 194/207] Minor composer container cleanup.
- Date: Tue, 4 Oct 2016 00:12:43 +0000 (UTC)
commit 096de14831fda71b2a9c164c5d9c6a32f5abc0a7
Author: Michael James Gratton <mike vee net>
Date: Mon Sep 19 16:38:42 2016 +1000
Minor composer container cleanup.
src/client/composer/composer-box.vala | 21 +++++++++------------
src/client/composer/composer-embed.vala | 6 ++++--
2 files changed, 13 insertions(+), 14 deletions(-)
---
diff --git a/src/client/composer/composer-box.vala b/src/client/composer/composer-box.vala
index fa64bab..70dbb61 100644
--- a/src/client/composer/composer-box.vala
+++ b/src/client/composer/composer-box.vala
@@ -18,28 +18,28 @@ public class ComposerBox : Gtk.Frame, ComposerContainer {
protected Gee.MultiMap<string, string>? old_accelerators { get; set; }
+ private MainToolbar main_toolbar { get; private set; }
+
public signal void vanished();
public ComposerBox(ComposerWidget composer) {
this.composer = composer;
+ this.composer.free_header();
+
+ this.main_toolbar = GearyApplication.instance.controller.main_window.main_toolbar;
+
get_style_context().add_class("geary-composer-box");
this.halign = Gtk.Align.FILL;
this.vexpand = true;
this.vexpand_set = true;
add(this.composer);
+ this.main_toolbar.set_conversation_header(composer.header);
this.composer.editor.focus_in_event.connect(on_focus_in);
this.composer.editor.focus_out_event.connect(on_focus_out);
show();
-
- if (this.composer.state == ComposerWidget.ComposerState.NEW) {
- this.composer.free_header();
- GearyApplication.instance.controller.main_window.main_toolbar.set_conversation_header(
- composer.header);
- get_style_context().add_class("geary-full-pane");
- }
}
public void remove_composer() {
@@ -54,18 +54,15 @@ public class ComposerBox : Gtk.Frame, ComposerContainer {
public void vanish() {
hide();
- if (get_style_context().has_class("geary-full-pane"))
- GearyApplication.instance.controller.main_window.main_toolbar.remove_conversation_header(
- composer.header);
+ this.main_toolbar.remove_conversation_header(composer.header);
this.composer.state = ComposerWidget.ComposerState.DETACHED;
this.composer.editor.focus_in_event.disconnect(on_focus_in);
this.composer.editor.focus_out_event.disconnect(on_focus_out);
-
vanished();
}
public void close_container() {
- if (visible)
+ if (this.visible)
vanish();
destroy();
}
diff --git a/src/client/composer/composer-embed.vala b/src/client/composer/composer-embed.vala
index e949b3e..278864f 100644
--- a/src/client/composer/composer-embed.vala
+++ b/src/client/composer/composer-embed.vala
@@ -119,7 +119,9 @@ public class ComposerEmbed : Gtk.EventBox, ComposerContainer {
this.composer.editor.focus_out_event.disconnect(on_focus_out);
this.composer.editor.vadjustment.value_changed.disconnect(on_inner_scroll);
+ this.composer.editor.vadjustment.changed.disconnect(on_adjust_changed);
this.composer.editor.user_changed_contents.disconnect(on_inner_size_changed);
+
disable_scroll_reroute(this);
this.composer.editor_scrolled.get_vscrollbar().show();
@@ -129,7 +131,7 @@ public class ComposerEmbed : Gtk.EventBox, ComposerContainer {
debug("Error setting class of editor: %s", error.message);
}
- remove(composer);
+ remove(this.composer);
close_container();
}
@@ -238,7 +240,7 @@ public class ComposerEmbed : Gtk.EventBox, ComposerContainer {
}
public void close_container() {
- if (visible)
+ if (this.visible)
vanish();
destroy();
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]