[gtk+/wip/window-scales: 66/69] GtkWidget: Add scale-factor property
- From: Alexander Larsson <alexl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/window-scales: 66/69] GtkWidget: Add scale-factor property
- Date: Fri, 28 Jun 2013 10:24:23 +0000 (UTC)
commit 8e89015f4d9bce844d6affcd36d23df5995442be
Author: Alexander Larsson <alexl redhat com>
Date: Fri Jun 28 09:15:38 2013 +0200
GtkWidget: Add scale-factor property
gtk/gtkwidget.c | 25 ++++++++++++++++++++++++-
1 files changed, 24 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 982a2d3..d54abba 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -641,7 +641,8 @@ enum {
PROP_VEXPAND,
PROP_HEXPAND_SET,
PROP_VEXPAND_SET,
- PROP_EXPAND
+ PROP_EXPAND,
+ PROP_SCALE_FACTOR
};
typedef struct _GtkStateData GtkStateData;
@@ -1607,6 +1608,25 @@ G_GNUC_END_IGNORE_DEPRECATIONS
1.0,
1.0,
GTK_PARAM_READWRITE));
+
+ /**
+ * GtkWidget:scale-factor:
+ *
+ * The scale factor of the widget. See gtk_widget_get_scale_factor() for
+ * more details about widget scaling.
+ *
+ * Since: 3.10
+ */
+ g_object_class_install_property (gobject_class,
+ PROP_SCALE_FACTOR,
+ g_param_spec_int ("scale-factor",
+ P_("Scale factor"),
+ P_("The scaling factor of the window"),
+ 1,
+ G_MAXINT,
+ 1,
+ GTK_PARAM_READABLE));
+
/**
* GtkWidget::show:
* @widget: the object which received the signal.
@@ -3883,6 +3903,9 @@ gtk_widget_get_property (GObject *object,
case PROP_OPACITY:
g_value_set_double (value, gtk_widget_get_opacity (widget));
break;
+ case PROP_SCALE_FACTOR:
+ g_value_set_int (value, gtk_widget_get_scale_factor (widget));
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]