]> Pileus Git - ~andy/gtk/blobdiff - gtk/gtkstatusbar.c
a11y: Emit text-changed signals directly
[~andy/gtk] / gtk / gtkstatusbar.c
index 49d43464d81a2e8971a41347803df7b40275fb2a..47350376ad2cbe885e0c107f983abb09f326339e 100644 (file)
@@ -13,9 +13,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 <http://www.gnu.org/licenses/>.
  */
 
 /*
 
 #include "config.h"
 
+#include "gtkstatusbar.h"
+
+#include "gtkboxprivate.h"
 #include "gtkframe.h"
 #include "gtklabel.h"
 #include "gtkmarshalers.h"
-#include "gtkstatusbar.h"
 #include "gtkwindow.h"
 #include "gtkprivate.h"
 #include "gtkintl.h"
 #include "gtkbuildable.h"
+#include "gtkorientable.h"
 #include "gtktypebuiltins.h"
+#include "a11y/gtkstatusbaraccessible.h"
 
 /**
  * SECTION:gtkstatusbar
@@ -118,7 +120,7 @@ static void     gtk_statusbar_hierarchy_changed (GtkWidget         *widget,
 
 static guint              statusbar_signals[SIGNAL_LAST] = { 0 };
 
-G_DEFINE_TYPE_WITH_CODE (GtkStatusbar, gtk_statusbar, GTK_TYPE_HBOX,
+G_DEFINE_TYPE_WITH_CODE (GtkStatusbar, gtk_statusbar, GTK_TYPE_BOX,
                          G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE,
                                                 gtk_statusbar_buildable_interface_init));
 
@@ -184,6 +186,8 @@ gtk_statusbar_class_init (GtkStatusbarClass *class)
                                                               GTK_PARAM_READABLE));
 
    g_type_class_add_private (class, sizeof (GtkStatusbarPrivate));
+
+   gtk_widget_class_set_accessible_type (widget_class, GTK_TYPE_STATUSBAR_ACCESSIBLE);
 }
 
 static void
@@ -217,7 +221,8 @@ gtk_statusbar_init (GtkStatusbar *statusbar)
 
   priv->label = gtk_label_new ("");
   gtk_label_set_single_line_mode (GTK_LABEL (priv->label), TRUE);
-  gtk_misc_set_alignment (GTK_MISC (priv->label), 0.0, 0.5);
+  gtk_widget_set_halign (priv->label, GTK_ALIGN_START);
+  gtk_widget_set_valign (priv->label, GTK_ALIGN_CENTER);
   gtk_label_set_ellipsize (GTK_LABEL (priv->label), PANGO_ELLIPSIZE_END);
   gtk_container_add (GTK_CONTAINER (message_area), priv->label);
   gtk_widget_show (priv->label);
@@ -385,10 +390,10 @@ gtk_statusbar_push (GtkStatusbar *statusbar,
 
 /**
  * gtk_statusbar_pop:
- * @statusbar: a #GtkStatusBar
+ * @statusbar: a #GtkStatusbar
  * @context_id: a context identifier
  * 
- * Removes the first message in the #GtkStatusBar's stack
+ * Removes the first message in the #GtkStatusbar's stack
  * with the given context id. 
  *
  * Note that this may not change the displayed message, if 
@@ -435,7 +440,7 @@ gtk_statusbar_pop (GtkStatusbar *statusbar,
 
 /**
  * gtk_statusbar_remove:
- * @statusbar: a #GtkStatusBar
+ * @statusbar: a #GtkStatusbar
  * @context_id: a context identifier
  * @message_id: a message identifier, as returned by gtk_statusbar_push()
  *
@@ -487,7 +492,7 @@ gtk_statusbar_remove (GtkStatusbar *statusbar,
 
 /**
  * gtk_statusbar_remove_all:
- * @statusbar: a #GtkStatusBar
+ * @statusbar: a #GtkStatusbar
  * @context_id: a context identifier
  *
  * Forces the removal of all messages from a statusbar's
@@ -558,7 +563,7 @@ gtk_statusbar_remove_all (GtkStatusbar *statusbar,
 
 /**
  * gtk_statusbar_get_message_area:
- * @statusbar: a #GtkStatusBar
+ * @statusbar: a #GtkStatusbar
  *
  * Retrieves the box containing the label widget.
  *
@@ -659,12 +664,7 @@ gtk_statusbar_size_allocate (GtkWidget     *widget,
       gtk_window_resize_grip_is_visible (GTK_WINDOW (window)))
     {
       gtk_window_get_resize_grip_area (GTK_WINDOW (window), &rect);
-      if (gtk_widget_translate_coordinates (gtk_widget_get_parent (widget),
-                                            window,
-                                            allocation->x,
-                                            allocation->y,
-                                            &x,
-                                            &y))
+      if (gtk_widget_translate_coordinates (widget, window, 0, 0, &x, &y))
         {
           translated_rect.x = x;
           translated_rect.y = y;