[baobab] ringschart: tooltip improvements
- From: Stefano Facchini <sfacchini src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [baobab] ringschart: tooltip improvements
- Date: Sun, 13 Jul 2014 21:01:47 +0000 (UTC)
commit 3928dcb056e20c2954b0c6c34012d0b5ed5f0ef5
Author: Stefano Facchini <stefano facchini gmail com>
Date: Sun Jul 13 22:55:31 2014 +0200
ringschart: tooltip improvements
1. Tooltips are now painted starting from the biggest element.
2. Text is ellipsized if too long, instead of just hiding the tooltip.
src/baobab-ringschart.vala | 9 +++------
1 files changed, 3 insertions(+), 6 deletions(-)
---
diff --git a/src/baobab-ringschart.vala b/src/baobab-ringschart.vala
index 22d8550..7d00c3b 100644
--- a/src/baobab-ringschart.vala
+++ b/src/baobab-ringschart.vala
@@ -129,6 +129,8 @@ namespace Baobab {
layout.set_markup (markup, -1);
layout.set_indent (0);
layout.set_spacing (0);
+ layout.set_width (Pango.SCALE * q_width / 2);
+ layout.set_ellipsize (Pango.EllipsizeMode.END);
Pango.Rectangle layout_rect;
layout.get_pixel_extents (null, out layout_rect);
@@ -149,11 +151,6 @@ namespace Baobab {
tooltip_rect.width = layout_rect.width + hpadding;
tooltip_rect.height = layout_rect.height + vpadding;
- // check tooltip's width is not greater than half of the widget
- if (tooltip_rect.width > q_width) {
- continue;
- }
-
// translate tooltip rectangle and edge angles to the original quadrant
var a = middle_angle;
int i = 0;
@@ -228,7 +225,7 @@ namespace Baobab {
if (highlighted_item != null &&
item.parent != null &&
item.parent.data == highlighted_item) {
- subtip_items.prepend (item);
+ subtip_items.append (item);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]