X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=gtk%2Fgtkcheckmenuitem.c;h=343565d2d8d4e34d4a193fbf95c65dab6b7e613f;hb=a89d420270d1a856e072ed87c365b0176f102e6c;hp=27465f50398478bec3d76ce5839afd469bd21022;hpb=209a2d1ba02e17ad56af4c56293129686d4ca96c;p=~andy%2Fgtk diff --git a/gtk/gtkcheckmenuitem.c b/gtk/gtkcheckmenuitem.c index 27465f503..343565d2d 100644 --- a/gtk/gtkcheckmenuitem.c +++ b/gtk/gtkcheckmenuitem.c @@ -12,9 +12,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * License along with this library. If not, see . */ /* @@ -34,7 +32,6 @@ #include "gtkprivate.h" #include "gtkintl.h" #include "a11y/gtkcheckmenuitemaccessible.h" -#include "a11y/gtkchecksubmenuitemaccessible.h" /** * SECTION:gtkcheckmenuitem @@ -103,24 +100,6 @@ G_DEFINE_TYPE_WITH_CODE (GtkCheckMenuItem, gtk_check_menu_item, GTK_TYPE_MENU_IT G_IMPLEMENT_INTERFACE (GTK_TYPE_ACTIVATABLE, gtk_check_menu_item_activatable_interface_init)) -static AtkObject * -gtk_check_menu_item_get_accessible (GtkWidget *widget) -{ - GObject *object; - AtkObject *accessible; - - /* FIXME this is not really right, submenus can come and go */ - if (gtk_menu_item_get_submenu (GTK_MENU_ITEM (widget))) - object = g_object_new (GTK_TYPE_CHECK_SUBMENU_ITEM_ACCESSIBLE, NULL); - else - object = g_object_new (GTK_TYPE_CHECK_MENU_ITEM_ACCESSIBLE, NULL); - - accessible = ATK_OBJECT (object); - atk_object_initialize (accessible, widget); - - return accessible; -} - static void gtk_check_menu_item_class_init (GtkCheckMenuItemClass *klass) { @@ -169,7 +148,8 @@ gtk_check_menu_item_class_init (GtkCheckMenuItemClass *klass) GTK_PARAM_READABLE)); widget_class->draw = gtk_check_menu_item_draw; - widget_class->get_accessible = gtk_check_menu_item_get_accessible; + + gtk_widget_class_set_accessible_type (widget_class, GTK_TYPE_CHECK_MENU_ITEM_ACCESSIBLE); menu_item_class->activate = gtk_check_menu_item_activate; menu_item_class->hide_on_activate = FALSE; @@ -290,13 +270,14 @@ gtk_check_menu_item_new_with_label (const gchar *label) /** * gtk_check_menu_item_new_with_mnemonic: * @label: The text of the button, with an underscore in front of the - * mnemonic character - * @returns: a new #GtkCheckMenuItem + * character * * Creates a new #GtkCheckMenuItem containing a label. The label * will be created using gtk_label_new_with_mnemonic(), so underscores * in @label indicate the mnemonic for the menu item. - **/ + * + * Returns: a new #GtkCheckMenuItem + */ GtkWidget* gtk_check_menu_item_new_with_mnemonic (const gchar *label) { @@ -577,7 +558,7 @@ gtk_real_check_menu_item_draw_indicator (GtkCheckMenuItem *check_menu_item, if (priv->active || priv->always_show_toggle || - (gtk_widget_get_state_flags (widget) & GTK_STATE_FLAG_PRELIGHT)) + (state & GTK_STATE_FLAG_PRELIGHT)) { gtk_style_context_save (context); @@ -586,9 +567,6 @@ gtk_real_check_menu_item_draw_indicator (GtkCheckMenuItem *check_menu_item, else if (priv->active) state |= GTK_STATE_FLAG_ACTIVE; - if (!gtk_widget_is_sensitive (widget)) - state |= GTK_STATE_FLAG_INSENSITIVE; - gtk_style_context_set_state (context, state); if (priv->draw_as_radio)