Hide attachment widgets when no attachments
This saves a bit of space.
This commit is contained in:
parent
92ca4f46b2
commit
a49cf8821f
2 changed files with 18 additions and 2 deletions
|
|
@ -160,6 +160,7 @@ public class ComposerWidget : Gtk.EventBox {
|
|||
private Gtk.Button detach_button;
|
||||
private Gtk.Label message_overlay_label;
|
||||
private WebKit.DOM.Element? prev_selected_link = null;
|
||||
private Gtk.Separator attachments_separator;
|
||||
private Gtk.Box attachments_box;
|
||||
private Gtk.Button add_attachment_button;
|
||||
private Gtk.Button pending_attachments_button;
|
||||
|
|
@ -230,6 +231,7 @@ public class ComposerWidget : Gtk.EventBox {
|
|||
add_attachment_button.clicked.connect(on_add_attachment_button_clicked);
|
||||
pending_attachments_button = builder.get_object("add_pending_attachments") as Gtk.Button;
|
||||
pending_attachments_button.clicked.connect(on_pending_attachments_button_clicked);
|
||||
attachments_separator = builder.get_object("separator") as Gtk.Separator;
|
||||
attachments_box = builder.get_object("attachments_box") as Gtk.Box;
|
||||
hidden_on_attachment_drag_over = (Gtk.Alignment) builder.get_object("hidden_on_attachment_drag_over");
|
||||
hidden_on_attachment_drag_over_child = (Gtk.Widget) builder.get_object("hidden_on_attachment_drag_over_child");
|
||||
|
|
@ -246,6 +248,7 @@ public class ComposerWidget : Gtk.EventBox {
|
|||
// Set the visibilities later, after show_all is called on the widget.
|
||||
Idle.add(() => {
|
||||
inline_reply = (compose_type != ComposeType.NEW_MESSAGE);
|
||||
show_attachments();
|
||||
return false;
|
||||
});
|
||||
|
||||
|
|
@ -1054,7 +1057,7 @@ public class ComposerWidget : Gtk.EventBox {
|
|||
box.pack_start(remove_button, false, false);
|
||||
remove_button.clicked.connect(() => remove_attachment(attachment_file, box));
|
||||
|
||||
attachments_box.show_all();
|
||||
show_attachments();
|
||||
|
||||
check_pending_attachments();
|
||||
|
||||
|
|
@ -1077,9 +1080,21 @@ public class ComposerWidget : Gtk.EventBox {
|
|||
}
|
||||
}
|
||||
|
||||
show_attachments();
|
||||
|
||||
check_pending_attachments();
|
||||
}
|
||||
|
||||
private void show_attachments() {
|
||||
if (attachment_files.size > 0 ) {
|
||||
attachments_box.show_all();
|
||||
attachments_separator.show();
|
||||
} else {
|
||||
attachments_box.hide();
|
||||
attachments_separator.hide();
|
||||
}
|
||||
}
|
||||
|
||||
private void on_subject_changed() {
|
||||
reset_draft_timer();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -537,7 +537,7 @@
|
|||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="padding">8</property>
|
||||
<property name="padding">2</property>
|
||||
<property name="position">5</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
|
@ -547,6 +547,7 @@
|
|||
<property name="can_focus">False</property>
|
||||
<property name="margin_left">6</property>
|
||||
<property name="margin_right">6</property>
|
||||
<property name="margin_top">6</property>
|
||||
<property name="margin_bottom">6</property>
|
||||
<property name="spacing">8</property>
|
||||
<property name="layout_style">start</property>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue