[gtk+/wip/baedert/box: 46/108] toolbar: Remove button-relief style property



commit efb9b8d189c813c8eb45eb44b17abb2a1d86e820
Author: Timm Bäder <mail baedert org>
Date:   Tue Oct 11 09:44:36 2016 +0200

    toolbar: Remove button-relief style property
    
    And in turn also public API to set the button relief on the toolbar as
    well as the vfunc from GtkToolShell.

 docs/reference/gtk/gtk4-sections.txt |    3 -
 gtk/gtkmenutoolbutton.c              |    3 -
 gtk/gtktoolbar.c                     |   71 ----------------------------------
 gtk/gtktoolbar.h                     |    2 -
 gtk/gtktoolbutton.c                  |    3 -
 gtk/gtktoolitem.c                    |   29 --------------
 gtk/gtktoolitem.h                    |    2 -
 gtk/gtktoolshell.c                   |   27 -------------
 gtk/gtktoolshell.h                   |    4 --
 9 files changed, 0 insertions(+), 144 deletions(-)
---
diff --git a/docs/reference/gtk/gtk4-sections.txt b/docs/reference/gtk/gtk4-sections.txt
index 04ee867..3aafca5 100644
--- a/docs/reference/gtk/gtk4-sections.txt
+++ b/docs/reference/gtk/gtk4-sections.txt
@@ -3769,7 +3769,6 @@ GtkToolShellIface
 gtk_tool_shell_get_ellipsize_mode
 gtk_tool_shell_get_icon_size
 gtk_tool_shell_get_orientation
-gtk_tool_shell_get_relief_style
 gtk_tool_shell_get_style
 gtk_tool_shell_get_text_alignment
 gtk_tool_shell_get_text_orientation
@@ -3803,7 +3802,6 @@ gtk_toolbar_unset_icon_size
 gtk_toolbar_get_show_arrow
 gtk_toolbar_get_style
 gtk_toolbar_get_icon_size
-gtk_toolbar_get_relief_style
 
 gtk_toolbar_set_style
 gtk_toolbar_set_icon_size
@@ -3845,7 +3843,6 @@ gtk_tool_item_get_ellipsize_mode
 gtk_tool_item_get_icon_size
 gtk_tool_item_get_orientation
 gtk_tool_item_get_toolbar_style
-gtk_tool_item_get_relief_style
 gtk_tool_item_get_text_alignment
 gtk_tool_item_get_text_orientation
 gtk_tool_item_retrieve_proxy_menu_item
diff --git a/gtk/gtkmenutoolbutton.c b/gtk/gtkmenutoolbutton.c
index b9f40b8..23aedb0 100644
--- a/gtk/gtkmenutoolbutton.c
+++ b/gtk/gtkmenutoolbutton.c
@@ -169,9 +169,6 @@ gtk_menu_tool_button_construct_contents (GtkMenuToolButton *button)
   gtk_container_add (GTK_CONTAINER (button), priv->box);
   gtk_widget_show_all (priv->box);
 
-  gtk_button_set_relief (GTK_BUTTON (priv->arrow_button),
-                        gtk_tool_item_get_relief_style (GTK_TOOL_ITEM (button)));
-  
   gtk_widget_queue_resize (GTK_WIDGET (button));
 }
 
diff --git a/gtk/gtktoolbar.c b/gtk/gtktoolbar.c
index e7f270d..80cd7cf 100644
--- a/gtk/gtktoolbar.c
+++ b/gtk/gtktoolbar.c
@@ -252,7 +252,6 @@ static gboolean   gtk_toolbar_arrow_button_press   (GtkWidget           *button,
                                                    GtkToolbar          *toolbar);
 static void       gtk_toolbar_arrow_button_clicked (GtkWidget           *button,
                                                    GtkToolbar          *toolbar);
-static void       gtk_toolbar_update_button_relief (GtkToolbar          *toolbar);
 static gboolean   gtk_toolbar_popup_menu           (GtkWidget           *toolbar);
 static void       gtk_toolbar_reconfigured         (GtkToolbar          *toolbar);
 
@@ -277,7 +276,6 @@ static gboolean   gtk_toolbar_render               (GtkCssGadget *gadget,
                                                     int           height,
                                                     gpointer      data);
 
-static GtkReliefStyle       get_button_relief    (GtkToolbar *toolbar);
 static gint                 get_max_child_expand (GtkToolbar *toolbar);
 
 /* methods on ToolbarContent 'class' */
@@ -339,7 +337,6 @@ static void            toolbar_tool_shell_iface_init        (GtkToolShellIface
 static GtkIconSize     toolbar_get_icon_size                (GtkToolShell        *shell);
 static GtkOrientation  toolbar_get_orientation              (GtkToolShell        *shell);
 static GtkToolbarStyle toolbar_get_style                    (GtkToolShell        *shell);
-static GtkReliefStyle  toolbar_get_relief_style             (GtkToolShell        *shell);
 static void            toolbar_rebuild_menu                 (GtkToolShell        *shell);
 
 
@@ -601,14 +598,6 @@ gtk_toolbar_class_init (GtkToolbarClass *klass)
                                                              G_MAXINT,
                                                              GTK_PARAM_READABLE));
 
-  gtk_widget_class_install_style_property (widget_class,
-                                          g_param_spec_enum ("button-relief",
-                                                             P_("Button relief"),
-                                                             P_("Type of bevel around toolbar buttons"),
-                                                              GTK_TYPE_RELIEF_STYLE,
-                                                              GTK_RELIEF_NONE,
-                                                              GTK_PARAM_READABLE));
-
   binding_set = gtk_binding_set_by_class (klass);
   
   add_arrow_bindings (binding_set, GDK_KEY_Left, GTK_DIR_LEFT);
@@ -641,7 +630,6 @@ toolbar_tool_shell_iface_init (GtkToolShellIface *iface)
   iface->get_icon_size    = toolbar_get_icon_size;
   iface->get_orientation  = toolbar_get_orientation;
   iface->get_style        = toolbar_get_style;
-  iface->get_relief_style = toolbar_get_relief_style;
   iface->rebuild_menu     = toolbar_rebuild_menu;
 }
 
@@ -679,8 +667,6 @@ gtk_toolbar_init (GtkToolbar *toolbar)
                    G_CALLBACK (gtk_toolbar_arrow_button_press), toolbar);
   g_signal_connect (priv->arrow_button, "clicked",
                    G_CALLBACK (gtk_toolbar_arrow_button_clicked), toolbar);
-  gtk_button_set_relief (GTK_BUTTON (priv->arrow_button),
-                        get_button_relief (toolbar));
 
   gtk_widget_set_focus_on_click (priv->arrow_button, FALSE);
 
@@ -1813,22 +1799,6 @@ gtk_toolbar_size_allocate (GtkWidget     *widget,
 }
 
 static void
-gtk_toolbar_update_button_relief (GtkToolbar *toolbar)
-{
-  GtkToolbarPrivate *priv = toolbar->priv;
-  GtkReliefStyle relief;
-
-  relief = get_button_relief (toolbar);
-
-  if (relief != gtk_button_get_relief (GTK_BUTTON (priv->arrow_button)))
-    {
-      gtk_toolbar_reconfigured (toolbar);
-  
-      gtk_button_set_relief (GTK_BUTTON (priv->arrow_button), relief);
-    }
-}
-
-static void
 gtk_toolbar_style_updated (GtkWidget *widget)
 {
   GtkToolbar *toolbar = GTK_TOOLBAR (widget);
@@ -1837,7 +1807,6 @@ gtk_toolbar_style_updated (GtkWidget *widget)
   GTK_WIDGET_CLASS (gtk_toolbar_parent_class)->style_updated (widget);
 
   priv->max_homogeneous_pixels = -1;
-  gtk_toolbar_update_button_relief (GTK_TOOLBAR (widget));
 }
 
 static GList *
@@ -2888,25 +2857,6 @@ gtk_toolbar_get_icon_size (GtkToolbar *toolbar)
 }
 
 /**
- * gtk_toolbar_get_relief_style:
- * @toolbar: a #GtkToolbar
- * 
- * Returns the relief style of buttons on @toolbar. See
- * gtk_button_set_relief().
- * 
- * Returns: The relief style of buttons on @toolbar.
- * 
- * Since: 2.4
- **/
-GtkReliefStyle
-gtk_toolbar_get_relief_style (GtkToolbar *toolbar)
-{
-  g_return_val_if_fail (GTK_IS_TOOLBAR (toolbar), GTK_RELIEF_NONE);
-  
-  return get_button_relief (toolbar);
-}
-
-/**
  * gtk_toolbar_set_show_arrow:
  * @toolbar: a #GtkToolbar
  * @show_arrow: Whether to show an overflow menu
@@ -3484,21 +3434,6 @@ toolbar_content_show_all (ToolbarContent  *content)
     gtk_widget_show_all (widget);
 }
 
-/*
- * Getters
- */
-static GtkReliefStyle
-get_button_relief (GtkToolbar *toolbar)
-{
-  GtkReliefStyle button_relief = GTK_RELIEF_NORMAL;
-
-  gtk_widget_style_get (GTK_WIDGET (toolbar),
-                        "button-relief", &button_relief,
-                        NULL);
-  
-  return button_relief;
-}
-
 static gint
 get_max_child_expand (GtkToolbar *toolbar)
 {
@@ -3581,12 +3516,6 @@ toolbar_get_style (GtkToolShell *shell)
   return priv->style;
 }
 
-static GtkReliefStyle
-toolbar_get_relief_style (GtkToolShell *shell)
-{
-  return get_button_relief (GTK_TOOLBAR (shell));
-}
-
 static void
 toolbar_rebuild_menu (GtkToolShell *shell)
 {
diff --git a/gtk/gtktoolbar.h b/gtk/gtktoolbar.h
index 9937579..73174f2 100644
--- a/gtk/gtktoolbar.h
+++ b/gtk/gtktoolbar.h
@@ -137,8 +137,6 @@ GDK_AVAILABLE_IN_ALL
 void            gtk_toolbar_unset_icon_size         (GtkToolbar      *toolbar);
 
 GDK_AVAILABLE_IN_ALL
-GtkReliefStyle  gtk_toolbar_get_relief_style        (GtkToolbar      *toolbar);
-GDK_AVAILABLE_IN_ALL
 gint            gtk_toolbar_get_drop_index          (GtkToolbar      *toolbar,
                                                     gint             x,
                                                     gint             y);
diff --git a/gtk/gtktoolbutton.c b/gtk/gtktoolbutton.c
index 019a8e3..22eec7e 100644
--- a/gtk/gtktoolbutton.c
+++ b/gtk/gtktoolbutton.c
@@ -584,9 +584,6 @@ gtk_tool_button_construct_contents (GtkToolItem *tool_item)
   if (box)
     gtk_widget_show (box);
 
-  gtk_button_set_relief (GTK_BUTTON (button->priv->button),
-                        gtk_tool_item_get_relief_style (GTK_TOOL_ITEM (button)));
-
   gtk_tool_item_rebuild_menu (tool_item);
   
   gtk_widget_queue_resize (GTK_WIDGET (button));
diff --git a/gtk/gtktoolitem.c b/gtk/gtktoolitem.c
index 0c59eae..5f29fe0 100644
--- a/gtk/gtktoolitem.c
+++ b/gtk/gtktoolitem.c
@@ -242,7 +242,6 @@ gtk_tool_item_class_init (GtkToolItemClass *klass)
  * - gtk_tool_shell_get_orientation()
  * - gtk_tool_shell_get_style()
  * - gtk_tool_shell_get_icon_size()
- * - gtk_tool_shell_get_relief_style()
  * to find out what the toolbar should look like and change
  * themselves accordingly.
  **/
@@ -805,34 +804,6 @@ gtk_tool_item_get_toolbar_style (GtkToolItem *tool_item)
 }
 
 /**
- * gtk_tool_item_get_relief_style:
- * @tool_item: a #GtkToolItem 
- * 
- * Returns the relief style of @tool_item. See gtk_button_set_relief().
- * Custom subclasses of #GtkToolItem should call this function in the handler
- * of the #GtkToolItem::toolbar_reconfigured signal to find out the
- * relief style of buttons.
- * 
- * Returns: a #GtkReliefStyle indicating the relief style used
- * for @tool_item.
- * 
- * Since: 2.4
- **/
-GtkReliefStyle 
-gtk_tool_item_get_relief_style (GtkToolItem *tool_item)
-{
-  GtkWidget *parent;
-  
-  g_return_val_if_fail (GTK_IS_TOOL_ITEM (tool_item), GTK_RELIEF_NONE);
-
-  parent = gtk_widget_get_parent (GTK_WIDGET (tool_item));
-  if (!parent || !GTK_IS_TOOL_SHELL (parent))
-    return GTK_RELIEF_NONE;
-
-  return gtk_tool_shell_get_relief_style (GTK_TOOL_SHELL (parent));
-}
-
-/**
  * gtk_tool_item_get_text_alignment:
  * @tool_item: a #GtkToolItem: 
  * 
diff --git a/gtk/gtktoolitem.h b/gtk/gtktoolitem.h
index 4f24364..9a24c88 100644
--- a/gtk/gtktoolitem.h
+++ b/gtk/gtktoolitem.h
@@ -133,8 +133,6 @@ GtkOrientation  gtk_tool_item_get_orientation          (GtkToolItem *tool_item);
 GDK_AVAILABLE_IN_ALL
 GtkToolbarStyle gtk_tool_item_get_toolbar_style        (GtkToolItem *tool_item);
 GDK_AVAILABLE_IN_ALL
-GtkReliefStyle  gtk_tool_item_get_relief_style         (GtkToolItem *tool_item);
-GDK_AVAILABLE_IN_ALL
 gfloat          gtk_tool_item_get_text_alignment       (GtkToolItem *tool_item);
 GDK_AVAILABLE_IN_ALL
 GtkOrientation  gtk_tool_item_get_text_orientation     (GtkToolItem *tool_item);
diff --git a/gtk/gtktoolshell.c b/gtk/gtktoolshell.c
index 7dae16e..104aa6c 100644
--- a/gtk/gtktoolshell.c
+++ b/gtk/gtktoolshell.c
@@ -44,7 +44,6 @@
 typedef GtkToolShellIface GtkToolShellInterface;
 G_DEFINE_INTERFACE (GtkToolShell, gtk_tool_shell, GTK_TYPE_WIDGET);
 
-static GtkReliefStyle gtk_tool_shell_real_get_relief_style (GtkToolShell *shell);
 static GtkOrientation gtk_tool_shell_real_get_text_orientation (GtkToolShell *shell);
 static gfloat gtk_tool_shell_real_get_text_alignment (GtkToolShell *shell);
 static PangoEllipsizeMode gtk_tool_shell_real_get_ellipsize_mode (GtkToolShell *shell);
@@ -52,18 +51,11 @@ static PangoEllipsizeMode gtk_tool_shell_real_get_ellipsize_mode (GtkToolShell *
 static void
 gtk_tool_shell_default_init (GtkToolShellInterface *iface)
 {
-  iface->get_relief_style = gtk_tool_shell_real_get_relief_style;
   iface->get_text_orientation = gtk_tool_shell_real_get_text_orientation;
   iface->get_text_alignment = gtk_tool_shell_real_get_text_alignment;
   iface->get_ellipsize_mode = gtk_tool_shell_real_get_ellipsize_mode;
 }
 
-static GtkReliefStyle
-gtk_tool_shell_real_get_relief_style (GtkToolShell *shell)
-{
-  return GTK_RELIEF_NONE;
-}
-
 static GtkOrientation
 gtk_tool_shell_real_get_text_orientation (GtkToolShell *shell)
 {
@@ -137,25 +129,6 @@ gtk_tool_shell_get_style (GtkToolShell *shell)
 }
 
 /**
- * gtk_tool_shell_get_relief_style:
- * @shell: a #GtkToolShell
- *
- * Returns the relief style of buttons on @shell. Tool items must not call this
- * function directly, but rely on gtk_tool_item_get_relief_style() instead.
- *
- * Returns: The relief style of buttons on @shell.
- *
- * Since: 2.14
- **/
-GtkReliefStyle
-gtk_tool_shell_get_relief_style (GtkToolShell *shell)
-{
-  GtkToolShellIface *iface = GTK_TOOL_SHELL_GET_IFACE (shell);
-
-  return iface->get_relief_style (shell);
-}
-
-/**
  * gtk_tool_shell_rebuild_menu:
  * @shell: a #GtkToolShell
  *
diff --git a/gtk/gtktoolshell.h b/gtk/gtktoolshell.h
index c57699a..561a77a 100644
--- a/gtk/gtktoolshell.h
+++ b/gtk/gtktoolshell.h
@@ -46,7 +46,6 @@ typedef struct _GtkToolShellIface      GtkToolShellIface;
  * @get_icon_size:        mandatory implementation of gtk_tool_shell_get_icon_size().
  * @get_orientation:      mandatory implementation of gtk_tool_shell_get_orientation().
  * @get_style:            mandatory implementation of gtk_tool_shell_get_style().
- * @get_relief_style:     optional implementation of gtk_tool_shell_get_relief_style().
  * @rebuild_menu:         optional implementation of gtk_tool_shell_rebuild_menu().
  * @get_text_orientation: optional implementation of gtk_tool_shell_get_text_orientation().
  * @get_text_alignment:   optional implementation of gtk_tool_shell_get_text_alignment().
@@ -64,7 +63,6 @@ struct _GtkToolShellIface
   GtkIconSize        (*get_icon_size)        (GtkToolShell *shell);
   GtkOrientation     (*get_orientation)      (GtkToolShell *shell);
   GtkToolbarStyle    (*get_style)            (GtkToolShell *shell);
-  GtkReliefStyle     (*get_relief_style)     (GtkToolShell *shell);
   void               (*rebuild_menu)         (GtkToolShell *shell);
   GtkOrientation     (*get_text_orientation) (GtkToolShell *shell);
   gfloat             (*get_text_alignment)   (GtkToolShell *shell);
@@ -82,8 +80,6 @@ GtkOrientation     gtk_tool_shell_get_orientation      (GtkToolShell *shell);
 GDK_AVAILABLE_IN_ALL
 GtkToolbarStyle    gtk_tool_shell_get_style            (GtkToolShell *shell);
 GDK_AVAILABLE_IN_ALL
-GtkReliefStyle     gtk_tool_shell_get_relief_style     (GtkToolShell *shell);
-GDK_AVAILABLE_IN_ALL
 void               gtk_tool_shell_rebuild_menu         (GtkToolShell *shell);
 GDK_AVAILABLE_IN_ALL
 GtkOrientation     gtk_tool_shell_get_text_orientation (GtkToolShell *shell);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]