[libhandy] view-switcher-bar: Drop the icon-size property
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libhandy] view-switcher-bar: Drop the icon-size property
- Date: Wed, 5 Aug 2020 17:43:59 +0000 (UTC)
commit 3af5cb1684e77def221e74941b310a5e519723c3
Author: Adrien Plazas <kekun plazas laposte net>
Date: Wed Aug 5 15:14:28 2020 +0200
view-switcher-bar: Drop the icon-size property
We want to drop it from HdyViewSwitcher, so we need to drop it here too.
debian/libhandy-1-0.symbols | 2 --
doc/hdy-migrating-0-0-to-1.xml | 4 +++
src/hdy-view-switcher-bar.c | 65 ------------------------------------------
src/hdy-view-switcher-bar.h | 6 ----
src/hdy-view-switcher-bar.ui | 1 -
tests/test-view-switcher-bar.c | 19 ------------
6 files changed, 4 insertions(+), 93 deletions(-)
---
diff --git a/debian/libhandy-1-0.symbols b/debian/libhandy-1-0.symbols
index 045461c6..6eacc80f 100644
--- a/debian/libhandy-1-0.symbols
+++ b/debian/libhandy-1-0.symbols
@@ -292,13 +292,11 @@ libhandy-1.so.0 libhandy-1-0 #MINVER#
hdy_value_object_new_collect@LIBHANDY_1_0 0.0.8
hdy_value_object_new_string@LIBHANDY_1_0 0.0.8
hdy_value_object_new_take_string@LIBHANDY_1_0 0.0.8
- hdy_view_switcher_bar_get_icon_size@LIBHANDY_1_0 0.0.10
hdy_view_switcher_bar_get_policy@LIBHANDY_1_0 0.0.10
hdy_view_switcher_bar_get_reveal@LIBHANDY_1_0 0.0.10
hdy_view_switcher_bar_get_stack@LIBHANDY_1_0 0.0.10
hdy_view_switcher_bar_get_type@LIBHANDY_1_0 0.0.10
hdy_view_switcher_bar_new@LIBHANDY_1_0 0.0.10
- hdy_view_switcher_bar_set_icon_size@LIBHANDY_1_0 0.0.10
hdy_view_switcher_bar_set_policy@LIBHANDY_1_0 0.0.10
hdy_view_switcher_bar_set_reveal@LIBHANDY_1_0 0.0.10
hdy_view_switcher_bar_set_stack@LIBHANDY_1_0 0.0.10
diff --git a/doc/hdy-migrating-0-0-to-1.xml b/doc/hdy-migrating-0-0-to-1.xml
index 860d8f66..93b89568 100644
--- a/doc/hdy-migrating-0-0-to-1.xml
+++ b/doc/hdy-migrating-0-0-to-1.xml
@@ -215,6 +215,10 @@
property is %NULL or if it has less than two pages, even if you set
#HdyViewSwitcherBar:reveal to %TRUE.
</para>
+ <para>
+ The “icon-size” property has been dropped without replacement, you must
+ stop using it.
+ </para>
</refsect3>
<refsect3>
diff --git a/src/hdy-view-switcher-bar.c b/src/hdy-view-switcher-bar.c
index 32a3cf72..111d3e61 100644
--- a/src/hdy-view-switcher-bar.c
+++ b/src/hdy-view-switcher-bar.c
@@ -69,7 +69,6 @@
enum {
PROP_0,
PROP_POLICY,
- PROP_ICON_SIZE,
PROP_STACK,
PROP_REVEAL,
LAST_PROP,
@@ -84,7 +83,6 @@ struct _HdyViewSwitcherBar
HdyViewSwitcher *view_switcher;
HdyViewSwitcherPolicy policy;
- GtkIconSize icon_size;
gboolean reveal;
};
@@ -122,9 +120,6 @@ hdy_view_switcher_bar_get_property (GObject *object,
case PROP_POLICY:
g_value_set_enum (value, hdy_view_switcher_bar_get_policy (self));
break;
- case PROP_ICON_SIZE:
- g_value_set_int (value, hdy_view_switcher_bar_get_icon_size (self));
- break;
case PROP_STACK:
g_value_set_object (value, hdy_view_switcher_bar_get_stack (self));
break;
@@ -149,9 +144,6 @@ hdy_view_switcher_bar_set_property (GObject *object,
case PROP_POLICY:
hdy_view_switcher_bar_set_policy (self, g_value_get_enum (value));
break;
- case PROP_ICON_SIZE:
- hdy_view_switcher_bar_set_icon_size (self, g_value_get_int (value));
- break;
case PROP_STACK:
hdy_view_switcher_bar_set_stack (self, g_value_get_object (value));
break;
@@ -188,21 +180,6 @@ hdy_view_switcher_bar_class_init (HdyViewSwitcherBarClass *klass)
HDY_TYPE_VIEW_SWITCHER_POLICY, HDY_VIEW_SWITCHER_POLICY_NARROW,
G_PARAM_EXPLICIT_NOTIFY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
- /**
- * HdyViewSwitcherBar:icon-size:
- *
- * Use the "icon-size" property to hint the icons to use, you almost certainly
- * want to leave this as %GTK_ICON_SIZE_BUTTON.
- *
- * Since: 0.0.10
- */
- props[PROP_ICON_SIZE] =
- g_param_spec_int ("icon-size",
- _("Icon Size"),
- _("Symbolic size to use for named icon"),
- 0, G_MAXINT, GTK_ICON_SIZE_BUTTON,
- G_PARAM_EXPLICIT_NOTIFY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
-
/**
* HdyViewSwitcherBar:stack:
*
@@ -248,7 +225,6 @@ hdy_view_switcher_bar_init (HdyViewSwitcherBar *self)
* can pick up the correct default value.
*/
self->policy = HDY_VIEW_SWITCHER_POLICY_NARROW;
- self->icon_size = GTK_ICON_SIZE_BUTTON;
gtk_widget_init_template (GTK_WIDGET (self));
@@ -315,47 +291,6 @@ hdy_view_switcher_bar_set_policy (HdyViewSwitcherBar *self,
gtk_widget_queue_resize (GTK_WIDGET (self));
}
-/**
- * hdy_view_switcher_bar_get_icon_size:
- * @self: a #HdyViewSwitcherBar
- *
- * Get the icon size of the images used in the #HdyViewSwitcher.
- *
- * Returns: the icon size of the images
- *
- * Since: 0.0.10
- */
-GtkIconSize
-hdy_view_switcher_bar_get_icon_size (HdyViewSwitcherBar *self)
-{
- g_return_val_if_fail (HDY_IS_VIEW_SWITCHER_BAR (self), GTK_ICON_SIZE_BUTTON);
-
- return self->icon_size;
-}
-
-/**
- * hdy_view_switcher_bar_set_icon_size:
- * @self: a #HdyViewSwitcherBar
- * @icon_size: the new icon size
- *
- * Change the icon size hint for the icons in a #HdyViewSwitcher.
- *
- * Since: 0.0.10
- */
-void
-hdy_view_switcher_bar_set_icon_size (HdyViewSwitcherBar *self,
- GtkIconSize icon_size)
-{
- g_return_if_fail (HDY_IS_VIEW_SWITCHER_BAR (self));
-
- if (self->icon_size == icon_size)
- return;
-
- self->icon_size = icon_size;
-
- g_object_notify_by_pspec (G_OBJECT (self), props[PROP_ICON_SIZE]);
-}
-
/**
* hdy_view_switcher_bar_get_stack:
* @self: a #HdyViewSwitcherBar
diff --git a/src/hdy-view-switcher-bar.h b/src/hdy-view-switcher-bar.h
index 80873dc0..be2db35d 100644
--- a/src/hdy-view-switcher-bar.h
+++ b/src/hdy-view-switcher-bar.h
@@ -33,12 +33,6 @@ HDY_AVAILABLE_IN_ALL
void hdy_view_switcher_bar_set_policy (HdyViewSwitcherBar *self,
HdyViewSwitcherPolicy policy);
-HDY_AVAILABLE_IN_ALL
-GtkIconSize hdy_view_switcher_bar_get_icon_size (HdyViewSwitcherBar *self);
-HDY_AVAILABLE_IN_ALL
-void hdy_view_switcher_bar_set_icon_size (HdyViewSwitcherBar *self,
- GtkIconSize icon_size);
-
HDY_AVAILABLE_IN_ALL
GtkStack *hdy_view_switcher_bar_get_stack (HdyViewSwitcherBar *self);
HDY_AVAILABLE_IN_ALL
diff --git a/src/hdy-view-switcher-bar.ui b/src/hdy-view-switcher-bar.ui
index f682933f..a2b1266b 100644
--- a/src/hdy-view-switcher-bar.ui
+++ b/src/hdy-view-switcher-bar.ui
@@ -7,7 +7,6 @@
<property name="visible">True</property>
<child type="center">
<object class="HdyViewSwitcher" id="view_switcher">
- <property name="icon-size" bind-source="HdyViewSwitcherBar" bind-property="icon-size"
bind-flags="sync-create|bidirectional" />
<property name="margin-start">10</property>
<property name="margin-end">10</property>
<property name="narrow-ellipsize">end</property>
diff --git a/tests/test-view-switcher-bar.c b/tests/test-view-switcher-bar.c
index 00cc1cb9..f19e2a3c 100644
--- a/tests/test-view-switcher-bar.c
+++ b/tests/test-view-switcher-bar.c
@@ -29,24 +29,6 @@ test_hdy_view_switcher_bar_policy (void)
}
-static void
-test_hdy_view_switcher_bar_icon_size (void)
-{
- g_autoptr (HdyViewSwitcherBar) bar = NULL;
-
- bar = g_object_ref_sink (HDY_VIEW_SWITCHER_BAR (hdy_view_switcher_bar_new ()));
- g_assert_nonnull (bar);
-
- g_assert_cmpint (hdy_view_switcher_bar_get_icon_size (bar), ==, GTK_ICON_SIZE_BUTTON);
-
- hdy_view_switcher_bar_set_icon_size (bar, GTK_ICON_SIZE_MENU);
- g_assert_cmpint (hdy_view_switcher_bar_get_icon_size (bar), ==, GTK_ICON_SIZE_MENU);
-
- hdy_view_switcher_bar_set_icon_size (bar, GTK_ICON_SIZE_BUTTON);
- g_assert_cmpint (hdy_view_switcher_bar_get_icon_size (bar), ==, GTK_ICON_SIZE_BUTTON);
-}
-
-
static void
test_hdy_view_switcher_bar_stack (void)
{
@@ -95,7 +77,6 @@ main (gint argc,
hdy_init ();
g_test_add_func("/Handy/ViewSwitcherBar/policy", test_hdy_view_switcher_bar_policy);
- g_test_add_func("/Handy/ViewSwitcherBar/icon_size", test_hdy_view_switcher_bar_icon_size);
g_test_add_func("/Handy/ViewSwitcherBar/stack", test_hdy_view_switcher_bar_stack);
g_test_add_func("/Handy/ViewSwitcherBar/reveal", test_hdy_view_switcher_bar_reveal);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]