X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;f=cut-n-paste%2Ftoolbar-editor%2Fegg-editable-toolbar.c;h=8405abc612fbaeaf8036f3b3c4c04d15176dd1bb;hb=b329a61d561198cd405721372580d05476c2240a;hp=d65b7eb97086a6e2dd6c4cbbd9ea288b094620ef;hpb=ee149b4e364bd98778084dd3fe24b4ca7abed7ae;p=evince.git diff --git a/cut-n-paste/toolbar-editor/egg-editable-toolbar.c b/cut-n-paste/toolbar-editor/egg-editable-toolbar.c index d65b7eb9..8405abc6 100644 --- a/cut-n-paste/toolbar-editor/egg-editable-toolbar.c +++ b/cut-n-paste/toolbar-editor/egg-editable-toolbar.c @@ -14,7 +14,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * $Id$ */ @@ -25,26 +25,7 @@ #include "egg-toolbars-model.h" #include "egg-toolbar-editor.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include #include #include @@ -219,7 +200,12 @@ drag_begin_cb (GtkWidget *widget, gtk_widget_hide (widget); - action = g_object_get_data (G_OBJECT (widget), "gtk-action"); +#if GTK_CHECK_VERSION (2, 16, 0) + action = gtk_activatable_get_related_action (GTK_ACTIVATABLE (widget)); +#else +action = gtk_widget_get_action (widget); +#endif + if (action == NULL) return; flags = egg_toolbars_model_get_name_flags (etoolbar->priv->model, @@ -245,7 +231,12 @@ drag_end_cb (GtkWidget *widget, { gtk_widget_show (widget); - action = g_object_get_data (G_OBJECT (widget), "gtk-action"); +#if GTK_CHECK_VERSION (2, 16, 0) + action = gtk_activatable_get_related_action (GTK_ACTIVATABLE (widget)); +#else + action = gtk_widget_get_action (widget); +#endif + if (action == NULL) return; flags = egg_toolbars_model_get_name_flags (etoolbar->priv->model, @@ -516,9 +507,14 @@ configure_item_cursor (GtkToolItem *item, static void configure_item_tooltip (GtkToolItem *item) { - GtkAction *action = g_object_get_data (G_OBJECT (item), - "gtk-action"); - + GtkAction *action; + +#if GTK_CHECK_VERSION (2, 16, 0) + action = gtk_activatable_get_related_action (GTK_ACTIVATABLE (item)); +#else + action = gtk_widget_get_action (GTK_WIDGET (item)); +#endif + if (action != NULL) { g_object_notify (G_OBJECT (action), "tooltip"); @@ -876,7 +872,7 @@ toolbar_visibility_refresh (EggEditableToolbar *etoolbar) priv->visibility_id = gtk_ui_manager_new_merge_id (priv->manager); - showing = GTK_WIDGET_VISIBLE (etoolbar); + showing = gtk_widget_get_visible (GTK_WIDGET (etoolbar)); n_toolbars = egg_toolbars_model_n_toolbars (priv->model); for (i = 0; i < n_toolbars; i++) @@ -958,7 +954,7 @@ toolbar_visibility_refresh (EggEditableToolbar *etoolbar) gtk_action_set_visible (GTK_ACTION (action), (egg_toolbars_model_get_flags (priv->model, i) & EGG_TB_MODEL_NOT_REMOVABLE) == 0); gtk_action_set_sensitive (GTK_ACTION (action), showing); - gtk_toggle_action_set_active (action, GTK_WIDGET_VISIBLE + gtk_toggle_action_set_active (action, gtk_widget_get_visible (get_dock_nth (etoolbar, i))); for (list = priv->visibility_paths; list != NULL; list = g_list_next (list)) @@ -1827,7 +1823,7 @@ new_pixbuf_from_widget (GtkWidget *widget) } static GdkPixbuf * -new_separator_pixbuf () +new_separator_pixbuf (void) { GtkWidget *separator; GdkPixbuf *pixbuf;