Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 40 additions & 36 deletions src/Composer.vala
Original file line number Diff line number Diff line change
Expand Up @@ -85,16 +85,17 @@ public class Mail.Composer : Hdy.ApplicationWindow {
headerbar.get_style_context ().add_class (Gtk.STYLE_CLASS_FLAT);
headerbar.get_style_context ().add_class ("default-decoration");

from_combo = new Gtk.ComboBoxText () {
hexpand = true
};

var from_label = new Gtk.Label (_("From:")) {
mnemonic_widget = from_combo,
xalign = 1
};
from_label.get_style_context ().add_class (Gtk.STYLE_CLASS_DIM_LABEL);

from_combo = new Gtk.ComboBoxText () {
hexpand = true
};

var from_box = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 6) {
var from_box = new Gtk.Box (HORIZONTAL, 6) {
margin_bottom = 6
};
from_box.add (from_label);
Expand All @@ -104,19 +105,15 @@ public class Mail.Composer : Hdy.ApplicationWindow {
child = from_box
};

var to_label = new Gtk.Label (_("To:")) {
xalign = 1
to_val = new Gtk.Entry () {
hexpand = true
};
to_label.get_style_context ().add_class (Gtk.STYLE_CLASS_DIM_LABEL);

var subject_label = new Gtk.Label (_("Subject:")) {
var to_label = new Gtk.Label (_("To:")) {
mnemonic_widget = to_val,
xalign = 1
};
subject_label.get_style_context ().add_class (Gtk.STYLE_CLASS_DIM_LABEL);

to_val = new Gtk.Entry () {
hexpand = true
};
to_label.get_style_context ().add_class (Gtk.STYLE_CLASS_DIM_LABEL);

cc_button = new Gtk.ToggleButton.with_label (_("Cc"));

Expand All @@ -127,16 +124,17 @@ public class Mail.Composer : Hdy.ApplicationWindow {
to_grid.add (cc_button);
to_grid.add (bcc_button);

cc_val = new Gtk.Entry () {
hexpand = true
};

var cc_label = new Gtk.Label (_("Cc:")) {
mnemonic_widget = cc_val,
xalign = 1
};
cc_label.get_style_context ().add_class (Gtk.STYLE_CLASS_DIM_LABEL);

cc_val = new Gtk.Entry () {
hexpand = true
};

var cc_box = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 6) {
var cc_box = new Gtk.Box (HORIZONTAL, 6) {
margin_top = 6
};
cc_box.add (cc_label);
Expand All @@ -145,16 +143,17 @@ public class Mail.Composer : Hdy.ApplicationWindow {
cc_revealer = new Gtk.Revealer ();
cc_revealer.add (cc_box);

bcc_val = new Gtk.Entry () {
hexpand = true
};

var bcc_label = new Gtk.Label (_("Bcc:")) {
mnemonic_widget = bcc_val,
xalign = 1
};
bcc_label.get_style_context ().add_class (Gtk.STYLE_CLASS_DIM_LABEL);

bcc_val = new Gtk.Entry () {
hexpand = true
};

var bcc_box = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 6) {
var bcc_box = new Gtk.Box (HORIZONTAL, 6) {
margin_top = 6
};
bcc_box.add (bcc_label);
Expand All @@ -167,6 +166,12 @@ public class Mail.Composer : Hdy.ApplicationWindow {
margin_top = 6
};

var subject_label = new Gtk.Label (_("Subject:")) {
mnemonic_widget = subject_val,
xalign = 1
};
subject_label.get_style_context ().add_class (Gtk.STYLE_CLASS_DIM_LABEL);

subject_val.changed.connect (() => {
title = subject_val.text;
});
Expand Down Expand Up @@ -270,16 +275,18 @@ public class Mail.Composer : Hdy.ApplicationWindow {
action_bar.pack_start (signature_button);
action_bar.pack_end (send);

var view_overlay = new Gtk.Overlay ();
view_overlay.add (web_view);
var view_overlay = new Gtk.Overlay () {
child = web_view
};

message_url_overlay = new Granite.Widgets.OverlayBar (view_overlay);
message_url_overlay.no_show_all = true;

var main_box = new Gtk.Box (VERTICAL, 0);
main_box.add (headerbar);
main_box.add (recipient_grid);
main_box.add (editor_toolbar);
main_box.add (new Gtk.Separator (Gtk.Orientation.HORIZONTAL));
main_box.add (new Gtk.Separator (HORIZONTAL));
main_box.add (view_overlay);
main_box.add (attachment_box);
main_box.add (action_bar);
Expand Down Expand Up @@ -315,9 +322,7 @@ public class Mail.Composer : Hdy.ApplicationWindow {
bind_property ("has-recipients", send, "sensitive");
bind_property ("title", headerbar, "title");

cc_button.clicked.connect (() => {
cc_revealer.reveal_child = cc_button.active;
});
cc_button.bind_property ("active", cc_revealer, "reveal-child", SYNC_CREATE);

cc_val.changed.connect (() => {
on_sanitize_recipient_entry (cc_val);
Expand All @@ -328,9 +333,7 @@ public class Mail.Composer : Hdy.ApplicationWindow {
}
});

bcc_button.clicked.connect (() => {
bcc_revealer.reveal_child = bcc_button.active;
});
bcc_button.bind_property ("active", bcc_revealer, "reveal-child", SYNC_CREATE);

bcc_val.changed.connect (() => {
on_sanitize_recipient_entry (bcc_val);
Expand Down Expand Up @@ -384,12 +387,12 @@ public class Mail.Composer : Hdy.ApplicationWindow {
}

if ("bcc" in result) {
bcc_button.clicked ();
bcc_button.active = true;
bcc_val.text = result["bcc"].to_array ()[0];
}

if ("cc" in result) {
cc_button.clicked ();
cc_button.active = true;
cc_val.text = result["cc"].to_array ()[0];
}

Expand Down Expand Up @@ -1057,7 +1060,8 @@ public class Mail.Composer : Hdy.ApplicationWindow {
margin_bottom = 3;
margin_start = 3;
margin_end = 3;
add (box);

child = box;

remove_button.clicked.connect (() => {
destroy ();
Expand Down
Loading