aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2021-12-17 07:26:50 +0100
committerPřemysl Eric Janouch <p@janouch.name>2021-12-17 07:39:12 +0100
commitc136c089fab3e5aff6ef8339f8aea93cf142d1c7 (patch)
tree8a0fed3060628d8dfaa23d33577ce1f661f3b8f4
parent1c2a441cb56860d6bf558270b4a77d64dac2b954 (diff)
downloadfiv-c136c089fab3e5aff6ef8339f8aea93cf142d1c7.tar.gz
fiv-c136c089fab3e5aff6ef8339f8aea93cf142d1c7.tar.xz
fiv-c136c089fab3e5aff6ef8339f8aea93cf142d1c7.zip
Add a GObject property for view filtering
-rw-r--r--fastiv-view.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/fastiv-view.c b/fastiv-view.c
index 985f52c..5039aec 100644
--- a/fastiv-view.c
+++ b/fastiv-view.c
@@ -87,6 +87,7 @@ static FastivIoOrientation view_right[9] = {
enum {
PROP_SCALE = 1,
PROP_SCALE_TO_FIT,
+ PROP_FILTER,
N_PROPERTIES
};
@@ -113,6 +114,9 @@ fastiv_view_get_property(
case PROP_SCALE_TO_FIT:
g_value_set_boolean(value, self->scale_to_fit);
break;
+ case PROP_FILTER:
+ g_value_set_boolean(value, self->filter);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec);
}
@@ -755,6 +759,8 @@ fastiv_view_key_press_event(GtkWidget *widget, GdkEventKey *event)
case GDK_KEY_i:
self->filter = !self->filter;
+ g_object_notify_by_pspec(
+ G_OBJECT(self), view_properties[PROP_FILTER]);
gtk_widget_queue_draw(widget);
return TRUE;
@@ -791,6 +797,9 @@ fastiv_view_class_init(FastivViewClass *klass)
view_properties[PROP_SCALE_TO_FIT] = g_param_spec_boolean(
"scale-to-fit", "Scale to fit", "Scale images down to fit the window",
TRUE, G_PARAM_READABLE);
+ view_properties[PROP_FILTER] = g_param_spec_boolean(
+ "filter", "Use filtering", "Scale images smoothly",
+ TRUE, G_PARAM_READABLE);
g_object_class_install_properties(
object_class, N_PROPERTIES, view_properties);