[gthumb] grid view: fixed focused item visibility on startup
- From: Paolo Bacchilega <paobac src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gthumb] grid view: fixed focused item visibility on startup
- Date: Wed, 7 Dec 2011 19:15:11 +0000 (UTC)
commit bd825f15876f5ee983761ba0134fa7464910ece6
Author: Paolo Bacchilega <paobac src gnome org>
Date: Wed Dec 7 16:30:04 2011 +0100
grid view: fixed focused item visibility on startup
call the make_item_fully_visible function after the relayout
gthumb/gth-grid-view.c | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/gthumb/gth-grid-view.c b/gthumb/gth-grid-view.c
index c0efe61..cdade83 100644
--- a/gthumb/gth-grid-view.c
+++ b/gthumb/gth-grid-view.c
@@ -137,6 +137,7 @@ struct _GthGridViewPrivate {
GList *selection;
int focused_item;
int first_focused_item; /* Used to do multiple selection with the keyboard. */
+ guint make_focused_visible : 1;
guint layout_timeout;
int relayout_from_line;
@@ -888,6 +889,11 @@ _gth_grid_view_relayout_cb (gpointer data)
_gth_grid_view_relayout_from_line (self, self->priv->relayout_from_line);
+ if (self->priv->make_focused_visible) {
+ self->priv->make_focused_visible = FALSE;
+ _gth_grid_view_make_item_fully_visible (self, self->priv->focused_item);
+ }
+
return FALSE;
}
@@ -901,6 +907,9 @@ _gth_grid_view_queue_relayout_from_line (GthGridView *self,
else
self->priv->relayout_from_line = line;
+ if (! gtk_widget_get_realized (GTK_WIDGET (self)))
+ return;
+
if (self->priv->layout_timeout == 0)
self->priv->layout_timeout = g_timeout_add (LAYOUT_DELAY,
_gth_grid_view_relayout_cb,
@@ -2356,6 +2365,7 @@ gth_grid_view_cursor_changed (GthFileView *file_view,
new_item->state |= GTK_STATE_FLAG_FOCUSED | GTK_STATE_FLAG_ACTIVE;
_gth_grid_view_queue_draw_item (self, new_item);
+ self->priv->make_focused_visible = TRUE;
_gth_grid_view_make_item_fully_visible (self, self->priv->focused_item);
}
@@ -3651,6 +3661,7 @@ gth_grid_view_init (GthGridView *self)
self->priv->selection = NULL;
self->priv->focused_item = -1;
self->priv->first_focused_item = -1;
+ self->priv->make_focused_visible = FALSE;
self->priv->layout_timeout = 0;
self->priv->relayout_from_line = -1;
self->priv->update_caption_height = TRUE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]