Closes #7365 Draft saving notifications are now less distracting
This commit is contained in:
parent
1b1ddc8735
commit
302ffc4fdc
4 changed files with 22 additions and 9 deletions
|
|
@ -83,6 +83,11 @@ public class ComposerWindow : Gtk.Window {
|
||||||
</style>
|
</style>
|
||||||
</head><body id="message-body"></body></html>""";
|
</head><body id="message-body"></body></html>""";
|
||||||
|
|
||||||
|
private const string draft_save_label_style = """
|
||||||
|
.draft-save-label {
|
||||||
|
color: shade (@bg_color, 0.6);
|
||||||
|
}""";
|
||||||
|
|
||||||
private const int DRAFT_TIMEOUT_MSEC = 2000; // 2 seconds
|
private const int DRAFT_TIMEOUT_MSEC = 2000; // 2 seconds
|
||||||
|
|
||||||
public const string ATTACHMENT_KEYWORDS_GENERIC = ".doc|.pdf|.xls|.ppt|.rtf|.pps";
|
public const string ATTACHMENT_KEYWORDS_GENERIC = ".doc|.pdf|.xls|.ppt|.rtf|.pps";
|
||||||
|
|
@ -235,6 +240,7 @@ public class ComposerWindow : Gtk.Window {
|
||||||
subject_entry = builder.get_object("subject") as Gtk.Entry;
|
subject_entry = builder.get_object("subject") as Gtk.Entry;
|
||||||
Gtk.Alignment message_area = builder.get_object("message area") as Gtk.Alignment;
|
Gtk.Alignment message_area = builder.get_object("message area") as Gtk.Alignment;
|
||||||
draft_save_label = (Gtk.Label) builder.get_object("draft_save_label");
|
draft_save_label = (Gtk.Label) builder.get_object("draft_save_label");
|
||||||
|
GtkUtil.apply_style(draft_save_label, draft_save_label_style);
|
||||||
actions = builder.get_object("compose actions") as Gtk.ActionGroup;
|
actions = builder.get_object("compose actions") as Gtk.ActionGroup;
|
||||||
// Can only happen after actions exits
|
// Can only happen after actions exits
|
||||||
compose_as_html = GearyApplication.instance.config.compose_as_html;
|
compose_as_html = GearyApplication.instance.config.compose_as_html;
|
||||||
|
|
|
||||||
|
|
@ -108,4 +108,16 @@ void set_source_color_from_string(Cairo.Context ctx, string spec) {
|
||||||
ctx.set_source_rgb(rgba.red, rgba.green, rgba.blue);
|
ctx.set_source_rgb(rgba.red, rgba.green, rgba.blue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void apply_style(Gtk.Widget widget, string style) {
|
||||||
|
try {
|
||||||
|
Gtk.CssProvider style_provider = new Gtk.CssProvider();
|
||||||
|
style_provider.load_from_data(style, -1);
|
||||||
|
|
||||||
|
Gtk.StyleContext style_context = widget.get_style_context();
|
||||||
|
style_context.add_provider(style_provider, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);
|
||||||
|
} catch (Error e) {
|
||||||
|
warning("Could not load style: %s", e.message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -49,15 +49,7 @@ public class ConversationFindBar : Gtk.Layout {
|
||||||
entry.buffer.deleted_text.connect(on_entry_buffer_deleted_text);
|
entry.buffer.deleted_text.connect(on_entry_buffer_deleted_text);
|
||||||
entry.activate.connect(on_entry_activate);
|
entry.activate.connect(on_entry_activate);
|
||||||
|
|
||||||
try {
|
GtkUtil.apply_style(entry, entry_not_found_style);
|
||||||
Gtk.CssProvider style_provider = new Gtk.CssProvider();
|
|
||||||
style_provider.load_from_data(entry_not_found_style, -1);
|
|
||||||
|
|
||||||
Gtk.StyleContext style_context = entry.get_style_context();
|
|
||||||
style_context.add_provider(style_provider, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);
|
|
||||||
} catch (Error e) {
|
|
||||||
warning("Could not load built-in style for find bar entry: %s", e.message);
|
|
||||||
}
|
|
||||||
|
|
||||||
result_label = (Gtk.Label) builder.get_object("label: result");
|
result_label = (Gtk.Label) builder.get_object("label: result");
|
||||||
update_result_label();
|
update_result_label();
|
||||||
|
|
|
||||||
|
|
@ -559,6 +559,9 @@
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<property name="xalign">0</property>
|
<property name="xalign">0</property>
|
||||||
|
<style>
|
||||||
|
<class name="draft-save-label"/>
|
||||||
|
</style>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="expand">False</property>
|
<property name="expand">False</property>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue