Fixes message viewer resize problem. Closes #4309
This commit is contained in:
parent
4cea0fb0d2
commit
f048b0767e
4 changed files with 35 additions and 2 deletions
26
src/client/ui/background-box.vala
Normal file
26
src/client/ui/background-box.vala
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
/* Copyright 2011 Yorba Foundation
|
||||
*
|
||||
* This software is licensed under the GNU Lesser General Public License
|
||||
* (version 2.1 or later). See the COPYING file in this distribution.
|
||||
*/
|
||||
|
||||
// A single-child container that renders its a background color.
|
||||
public class BackgroundBox : Gtk.Frame {
|
||||
public BackgroundBox() {
|
||||
Object(label: null);
|
||||
shadow_type = Gtk.ShadowType.NONE;
|
||||
}
|
||||
|
||||
public override bool draw(Cairo.Context cr) {
|
||||
Gtk.StyleContext sc = get_style_context();
|
||||
|
||||
sc.save();
|
||||
sc.set_state(get_state_flags());
|
||||
Gtk.render_background(sc, cr, 0, 0, get_allocated_width(), get_allocated_height());
|
||||
sc.restore();
|
||||
|
||||
base.draw(cr);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -34,6 +34,7 @@ public class MessageViewer : Gtk.Viewport {
|
|||
set_border_width(0);
|
||||
message_box.set_border_width(0);
|
||||
message_box.spacing = 0;
|
||||
resize_mode = Gtk.ResizeMode.IMMEDIATE;
|
||||
}
|
||||
|
||||
// Removes all displayed e-mails from the view.
|
||||
|
|
@ -120,7 +121,7 @@ public class MessageViewer : Gtk.Viewport {
|
|||
debug("Could not get message text. %s", err.message);
|
||||
}
|
||||
|
||||
Gtk.EventBox box = new Gtk.EventBox();
|
||||
BackgroundBox box = new BackgroundBox();
|
||||
box.add(container);
|
||||
box.margin = MESSAGE_BOX_MARGIN;
|
||||
|
||||
|
|
@ -144,6 +145,8 @@ public class MessageViewer : Gtk.Viewport {
|
|||
|
||||
label_title.set_line_wrap(true);
|
||||
label_value.set_line_wrap(true);
|
||||
label_title.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR);
|
||||
label_value.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR);
|
||||
label_title.set_alignment(1.0f, 0.0f);
|
||||
label_value.set_alignment(0.0f, 0.0f);
|
||||
label_title.selectable = true;
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ client_src = [
|
|||
'geary-config.vala',
|
||||
'main.vala',
|
||||
|
||||
'ui/background-box.vala',
|
||||
'ui/composer-window.vala',
|
||||
'ui/geary-login.vala',
|
||||
'ui/folder-list-store.vala',
|
||||
|
|
|
|||
|
|
@ -14,6 +14,9 @@
|
|||
<object class="GtkGrid" id="header">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
|
|
@ -40,7 +43,7 @@
|
|||
<property name="hexpand">True</property>
|
||||
<property name="vexpand">True</property>
|
||||
<property name="editable">False</property>
|
||||
<property name="wrap_mode">word</property>
|
||||
<property name="wrap_mode">word-char</property>
|
||||
<property name="cursor_visible">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue