mirror of
https://gitlab.gnome.org/GNOME/gitg
synced 2024-09-13 21:21:17 +00:00
Align author name and date in commit dialog
This commit is contained in:
parent
c1765a6f41
commit
98c1120a62
|
@ -297,18 +297,34 @@ class Dialog : Gtk.Dialog
|
||||||
var name = d_author.get_name();
|
var name = d_author.get_name();
|
||||||
var email = d_author.get_email();
|
var email = d_author.get_email();
|
||||||
|
|
||||||
d_label_user.set_label(@"$name <$email>");
|
var s = @"$name <$email>";
|
||||||
|
d_label_user.set_label(s);
|
||||||
|
|
||||||
|
var rtl = (get_style_context().get_state() & Gtk.StateFlags.DIR_RTL) != 0;
|
||||||
|
|
||||||
|
if (rtl == (Pango.find_base_dir(s, -1) != Pango.Direction.RTL))
|
||||||
|
{
|
||||||
|
d_label_user.xalign = 1.0f;
|
||||||
|
}
|
||||||
|
|
||||||
var t = d_author.get_time();
|
var t = d_author.get_time();
|
||||||
var now = new DateTime.now_local();
|
var now = new DateTime.now_local();
|
||||||
|
string date_string;
|
||||||
|
|
||||||
if (now.difference(t) < TimeSpan.SECOND * 5)
|
if (now.difference(t) < TimeSpan.SECOND * 5)
|
||||||
{
|
{
|
||||||
d_label_date.set_label("");
|
date_string = "";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
d_label_date.set_label((new Gitg.Date.for_date_time(t)).for_display());
|
date_string = (new Gitg.Date.for_date_time(t)).for_display();
|
||||||
|
}
|
||||||
|
|
||||||
|
d_label_date.set_label(date_string);
|
||||||
|
|
||||||
|
if (rtl == (Pango.find_base_dir(date_string, -1) != Pango.Direction.RTL))
|
||||||
|
{
|
||||||
|
d_label_date.xalign = 1.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
var ac = Gitg.AvatarCache.default();
|
var ac = Gitg.AvatarCache.default();
|
||||||
|
|
|
@ -81,9 +81,9 @@
|
||||||
<object class="GtkLabel" id="label_user">
|
<object class="GtkLabel" id="label_user">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<property name="halign">start</property>
|
|
||||||
<property name="valign">end</property>
|
<property name="valign">end</property>
|
||||||
<property name="hexpand">True</property>
|
<property name="hexpand">True</property>
|
||||||
|
<property name="xalign">0</property>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="left_attach">1</property>
|
<property name="left_attach">1</property>
|
||||||
|
@ -96,9 +96,9 @@
|
||||||
<object class="GtkLabel" id="label_date">
|
<object class="GtkLabel" id="label_date">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<property name="halign">start</property>
|
|
||||||
<property name="valign">start</property>
|
<property name="valign">start</property>
|
||||||
<property name="hexpand">True</property>
|
<property name="hexpand">True</property>
|
||||||
|
<property name="xalign">0</property>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="left_attach">1</property>
|
<property name="left_attach">1</property>
|
||||||
|
|
Loading…
Reference in a new issue