diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | ChangeLog.ja | 4 | ||||
-rw-r--r-- | src/gtkutils.c | 15 |
3 files changed, 19 insertions, 4 deletions
@@ -1,5 +1,9 @@ 2005-07-11 + * gtkut_tree_view_scroll_to_cell(): added margin for visibility. + +2005-07-11 + * src/compose.c: compose_parse_header(): use Content-Type's charset as a fallback encoding of broken header strings. diff --git a/ChangeLog.ja b/ChangeLog.ja index f3c44f89..97e024dc 100644 --- a/ChangeLog.ja +++ b/ChangeLog.ja @@ -1,5 +1,9 @@ 2005-07-11 + * gtkut_tree_view_scroll_to_cell(): 視認性のためにマージンを追加。 + +2005-07-11 + * src/compose.c: compose_parse_header(): 不正なヘッダ文字列の フォールバックエンコーディングとして Content-Type の charset を使用。 diff --git a/src/gtkutils.c b/src/gtkutils.c index 06b985e1..fb17d5c5 100644 --- a/src/gtkutils.c +++ b/src/gtkutils.c @@ -565,6 +565,7 @@ void gtkut_tree_view_scroll_to_cell(GtkTreeView *treeview, GtkTreePath *path) GdkRectangle cell_rect; GdkRectangle vis_rect; gint dest_x, dest_y; + gint margin = 0; if (!path) return; @@ -577,10 +578,16 @@ void gtkut_tree_view_scroll_to_cell(GtkTreeView *treeview, GtkTreePath *path) dest_x = vis_rect.x; dest_y = vis_rect.y; - if (cell_rect.y < vis_rect.y) - dest_y = cell_rect.y; - if (cell_rect.y + cell_rect.height > vis_rect.y + vis_rect.height) - dest_y = cell_rect.y + cell_rect.height - vis_rect.height; + /* add margin */ + if (cell_rect.height * 2 < vis_rect.height) + margin = cell_rect.height + 2; + + if (cell_rect.y < vis_rect.y + margin) + dest_y = cell_rect.y - margin; + if (cell_rect.y + cell_rect.height > + vis_rect.y + vis_rect.height - margin) + dest_y = cell_rect.y + cell_rect.height - vis_rect.height + + margin; gtk_tree_view_scroll_to_point(treeview, dest_x, dest_y); } |