]> Pileus Git - ~andy/gtk/blobdiff - gtk/gtktoolbar.c
Updated Norwegian nynorsk translation
[~andy/gtk] / gtk / gtktoolbar.c
index 981c1f0e778b85dad38ccc58d7c57d3bfec0f2ed..3a389bd9771f00f126894a9951c37867917c7f10 100644 (file)
@@ -17,9 +17,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/>.
  */
 
 /*
@@ -56,6 +54,8 @@
 #include "gtkprivate.h"
 #include "gtkintl.h"
 #include "gtktypebuiltins.h"
+#include "gtkwidgetpath.h"
+#include "gtkwidgetprivate.h"
 
 
 /**
@@ -858,16 +858,11 @@ gtk_toolbar_draw (GtkWidget *widget,
   GtkToolbar *toolbar = GTK_TOOLBAR (widget);
   GtkToolbarPrivate *priv = toolbar->priv;
   GtkStyleContext *context;
-  GtkStateFlags state;
   GList *list;
   guint border_width;
 
   border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
   context = gtk_widget_get_style_context (widget);
-  state = gtk_widget_get_state_flags (widget);
-
-  gtk_style_context_save (context);
-  gtk_style_context_set_state (context, state);
 
   gtk_render_background (context, cr, border_width, border_width,
                          gtk_widget_get_allocated_width (widget) - 2 * border_width,
@@ -887,8 +882,6 @@ gtk_toolbar_draw (GtkWidget *widget,
                                priv->arrow_button,
                                cr);
 
-  gtk_style_context_restore (context);
-
   return FALSE;
 }
 
@@ -1886,11 +1879,6 @@ gtk_toolbar_style_updated (GtkWidget *widget)
   GTK_WIDGET_CLASS (gtk_toolbar_parent_class)->style_updated (widget);
 
   priv->max_homogeneous_pixels = -1;
-
-  if (gtk_widget_get_realized (widget))
-    gtk_style_context_set_background (gtk_widget_get_style_context (widget),
-                                      gtk_widget_get_window (widget));
-
   gtk_toolbar_update_button_relief (GTK_TOOLBAR (widget));
 }
 
@@ -2757,6 +2745,9 @@ gtk_toolbar_button_press (GtkWidget      *toolbar,
       return return_value;
     }
 
+  if (event->type != GDK_BUTTON_PRESS)
+    return FALSE;
+
   window = gtk_widget_get_toplevel (toolbar);
 
   if (window)
@@ -3953,7 +3944,7 @@ gtk_toolbar_get_path_for_child (GtkContainer *container,
   g_list_foreach (children, add_widget_to_path, sibling_path);
   g_list_free (children);
 
-  path = gtk_widget_path_copy (gtk_widget_get_path (GTK_WIDGET (container)));
+  path = _gtk_widget_create_path (GTK_WIDGET (container));
   if (gtk_widget_get_visible (child))
     {
       vis_index = gtk_toolbar_get_visible_position (toolbar, child);
@@ -3972,11 +3963,17 @@ gtk_toolbar_get_path_for_child (GtkContainer *container,
   return path;
 }
 
+static void
+gtk_toolbar_invalidate_order_foreach (GtkWidget *widget)
+{
+  _gtk_widget_invalidate_style_context (widget, GTK_CSS_CHANGE_POSITION | GTK_CSS_CHANGE_SIBLING_POSITION);
+}
+
 static void
 gtk_toolbar_invalidate_order (GtkToolbar *toolbar)
 {
   gtk_container_forall (GTK_CONTAINER (toolbar),
-                        (GtkCallback) gtk_widget_reset_style,
+                        (GtkCallback) gtk_toolbar_invalidate_order_foreach,
                         NULL);
 }