Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
E
eog
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GNOME
eog
Commits
4676ea3d
Commit
4676ea3d
authored
3 years ago
by
Felix Riemann
Browse files
Options
Downloads
Plain Diff
Merge branch 'Ordissimo/eog-draw-thumbnails'
See !76
parents
fe3f68d7
cba7fe58
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/eog-list-store.c
+18
-0
18 additions, 0 deletions
src/eog-list-store.c
src/eog-list-store.h
+2
-0
2 additions, 0 deletions
src/eog-list-store.h
src/eog-thumb-view.c
+44
-0
44 additions, 0 deletions
src/eog-thumb-view.c
with
64 additions
and
0 deletions
src/eog-list-store.c
+
18
−
0
View file @
4676ea3d
...
...
@@ -39,6 +39,13 @@ struct _EogListStorePrivate {
G_DEFINE_TYPE_WITH_PRIVATE
(
EogListStore
,
eog_list_store
,
GTK_TYPE_LIST_STORE
);
enum
{
SIGNAL_DRAW_THUMBNAIL
,
SIGNAL_LAST
};
static
gint
signals
[
SIGNAL_LAST
];
static
void
foreach_monitors_free
(
gpointer
data
)
{
...
...
@@ -85,6 +92,15 @@ eog_list_store_class_init (EogListStoreClass *klass)
object_class
->
dispose
=
eog_list_store_dispose
;
object_class
->
finalize
=
eog_list_store_finalize
;
signals
[
SIGNAL_DRAW_THUMBNAIL
]
=
g_signal_new
(
"draw-thumbnail"
,
EOG_TYPE_LIST_STORE
,
G_SIGNAL_RUN_LAST
,
G_STRUCT_OFFSET
(
EogListStoreClass
,
draw_thumbnail
),
NULL
,
NULL
,
g_cclosure_marshal_VOID__VOID
,
G_TYPE_NONE
,
0
);
}
/*
...
...
@@ -289,6 +305,8 @@ eog_job_thumbnail_cb (EogJobThumbnail *job, gpointer data)
}
g_object_unref
(
file
);
g_signal_emit
(
store
,
signals
[
SIGNAL_DRAW_THUMBNAIL
],
0
);
}
static
void
...
...
This diff is collapsed.
Click to expand it.
src/eog-list-store.h
+
2
−
0
View file @
4676ea3d
...
...
@@ -64,6 +64,8 @@ struct _EogListStore {
struct
_EogListStoreClass
{
GtkListStoreClass
parent_class
;
void
(
*
draw_thumbnail
)
(
EogListStore
*
store
);
/* Padding for future expansion */
void
(
*
_eog_reserved1
)
(
void
);
void
(
*
_eog_reserved2
)
(
void
);
...
...
This diff is collapsed.
Click to expand it.
src/eog-thumb-view.c
+
44
−
0
View file @
4676ea3d
...
...
@@ -82,6 +82,7 @@ struct _EogThumbViewPrivate {
gint
n_images
;
gulong
image_add_id
;
gulong
image_removed_id
;
gulong
image_thumbnail_id
;
gboolean
indices_changed
;
};
...
...
@@ -179,6 +180,11 @@ eog_thumb_view_dispose (GObject *object)
priv
->
image_removed_id
=
0
;
}
if
(
model
&&
priv
->
image_thumbnail_id
)
{
g_signal_handler_disconnect
(
model
,
priv
->
image_thumbnail_id
);
priv
->
image_thumbnail_id
=
0
;
}
G_OBJECT_CLASS
(
eog_thumb_view_parent_class
)
->
dispose
(
object
);
}
...
...
@@ -645,6 +651,7 @@ eog_thumb_view_init (EogThumbView *thumbview)
thumbview
->
priv
->
visible_range_changed_id
=
0
;
thumbview
->
priv
->
image_add_id
=
0
;
thumbview
->
priv
->
image_removed_id
=
0
;
thumbview
->
priv
->
image_thumbnail_id
=
0
;
}
/**
...
...
@@ -703,6 +710,29 @@ eog_thumb_view_row_deleted_cb (GtkTreeModel *tree_model,
eog_thumb_view_update_columns
(
view
);
}
static
void
eog_thumb_view_row_changed_cb
(
GtkTreeModel
*
model
,
GtkTreePath
*
path
,
GtkTreeIter
*
iter
,
gpointer
data
)
{
guint
signal_id
;
signal_id
=
GPOINTER_TO_UINT
(
data
);
/* PREVENT GtkIconView "row-changed" handler to be reached, as it will
* perform a full invalidate and relayout of all items, See bug:
* https://bugzilla.gnome.org/show_bug.cgi?id=691448#c9 */
g_signal_stop_emission
(
model
,
signal_id
,
0
);
}
static
void
eog_thumb_view_draw_thumbnail_cb
(
EogListStore
*
store
,
EogThumbView
*
view
)
{
gtk_widget_queue_draw
(
GTK_WIDGET
(
view
));
return
;
}
/**
* eog_thumb_view_set_model:
* @thumbview: A #EogThumbView.
...
...
@@ -736,8 +766,18 @@ eog_thumb_view_set_model (EogThumbView *thumbview, EogListStore *store)
priv
->
image_removed_id
);
}
if
(
priv
->
image_thumbnail_id
!=
0
)
{
g_signal_handler_disconnect
(
existing
,
priv
->
image_thumbnail_id
);
}
}
guint
signal_id
=
g_signal_lookup
(
"row-changed"
,
GTK_TYPE_TREE_MODEL
);
g_signal_connect
(
GTK_TREE_MODEL
(
store
),
"row-changed"
,
G_CALLBACK
(
eog_thumb_view_row_changed_cb
),
GUINT_TO_POINTER
(
signal_id
));
priv
->
image_add_id
=
g_signal_connect
(
G_OBJECT
(
store
),
"row-inserted"
,
G_CALLBACK
(
eog_thumb_view_row_inserted_cb
),
thumbview
);
...
...
@@ -745,6 +785,10 @@ eog_thumb_view_set_model (EogThumbView *thumbview, EogListStore *store)
"row-deleted"
,
G_CALLBACK
(
eog_thumb_view_row_deleted_cb
),
thumbview
);
priv
->
image_thumbnail_id
=
g_signal_connect
(
G_OBJECT
(
store
),
"draw-thumbnail"
,
G_CALLBACK
(
eog_thumb_view_draw_thumbnail_cb
),
thumbview
);
thumbview
->
priv
->
start_thumb
=
thumbview
->
priv
->
end_thumb
=
0
;
thumbview
->
priv
->
n_images
=
eog_list_store_length
(
store
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment