Compare commits

...

3 Commits

Author SHA1 Message Date
Ghost User
692611b742 Merge branch 'avatar-history-view' into 'master'
WIP to use avatar on history view

See merge request GNOME/gitg!206
2024-06-19 14:34:15 +00:00
Sabri Ünal
afa7724628 ui: Add tooltips to search buttons
- Add tooltips to the previous result and next result buttons.
2024-06-19 10:40:33 +00:00
Alberto Fanjul
efa52f1744 WIP to use avatar on history view 2023-12-12 01:48:35 +00:00
2 changed files with 39 additions and 5 deletions

View File

@ -263,6 +263,7 @@
</child>
<child>
<object class="GtkButton" id="d_search_up_button">
<property name="tooltip-text" translatable="yes">Previous result</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<signal name="clicked" handler="search_up_clicked" swapped="no"/>
@ -278,6 +279,7 @@
</child>
<child>
<object class="GtkButton" id="d_search_down_button">
<property name="tooltip-text" translatable="yes">Next result</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<signal name="clicked" handler="search_down_clicked" swapped="no"/>

View File

@ -205,11 +205,43 @@ namespace Gitg
context.set_line_width(0.0);
context.arc(area.x + f(offset + radius),
area.y + area.height / 2.0,
radius,
0,
2 * Math.PI);
bool use_gravatar = true;
if (use_gravatar)
{
var ac = Gitg.AvatarCache.default();
var cancel_avatar = new Cancellable();
ac.load.begin(commit.get_author().get_email(), 50, cancel_avatar, (obj, res) => {
var pixbuf = ac.load.end(res);
if (cancel_avatar.is_cancelled())
{
return;
}
if (pixbuf != null)
{
Gdk.cairo_set_source_pixbuf(context, pixbuf, area.x, area.y);
context.paint();
}
else
{
context.arc(area.x + f(offset + radius),
area.y + area.height / 2.0,
radius,
0,
2 * Math.PI);
}
});
}
else
{
context.arc(area.x + f(offset + radius),
area.y + area.height / 2.0,
radius,
0,
2 * Math.PI);
}
context.set_source_rgb(0, 0, 0);
context.stroke_preserve();