| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/ui/gtk/gtk_expanded_container.h" | 5 #include "chrome/browser/ui/gtk/gtk_expanded_container.h" |
| 6 | 6 |
| 7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 | 10 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 GValue v = { 0 }; | 27 GValue v = { 0 }; |
| 28 g_value_init(&v, G_TYPE_INT); | 28 g_value_init(&v, G_TYPE_INT); |
| 29 gtk_container_child_get_property(GTK_CONTAINER(container), child, "x", &v); | 29 gtk_container_child_get_property(GTK_CONTAINER(container), child, "x", &v); |
| 30 *x = g_value_get_int(&v); | 30 *x = g_value_get_int(&v); |
| 31 gtk_container_child_get_property(GTK_CONTAINER(container), child, "y", &v); | 31 gtk_container_child_get_property(GTK_CONTAINER(container), child, "y", &v); |
| 32 *y = g_value_get_int(&v); | 32 *y = g_value_get_int(&v); |
| 33 g_value_unset(&v); | 33 g_value_unset(&v); |
| 34 } | 34 } |
| 35 | 35 |
| 36 void ChildSizeAllocate(GtkWidget* child, gpointer userdata) { | 36 void ChildSizeAllocate(GtkWidget* child, gpointer userdata) { |
| 37 if (!gtk_widget_get_visible(child)) | 37 if (!GTK_WIDGET_VISIBLE(child)) |
| 38 return; | 38 return; |
| 39 | 39 |
| 40 SizeAllocateData* data = reinterpret_cast<SizeAllocateData*>(userdata); | 40 SizeAllocateData* data = reinterpret_cast<SizeAllocateData*>(userdata); |
| 41 | 41 |
| 42 GtkRequisition child_requisition; | 42 GtkRequisition child_requisition; |
| 43 child_requisition.width = data->allocation->width - data->border_width * 2; | 43 child_requisition.width = data->allocation->width - data->border_width * 2; |
| 44 child_requisition.height = data->allocation->height - data->border_width * 2; | 44 child_requisition.height = data->allocation->height - data->border_width * 2; |
| 45 | 45 |
| 46 // We need to give whoever is pulling our strings a chance to adjust the | 46 // We need to give whoever is pulling our strings a chance to adjust the |
| 47 // size of our children. | 47 // size of our children. |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 gtk_fixed_set_has_window(GTK_FIXED(container), has_window); | 184 gtk_fixed_set_has_window(GTK_FIXED(container), has_window); |
| 185 } | 185 } |
| 186 | 186 |
| 187 gboolean gtk_expanded_container_get_has_window( | 187 gboolean gtk_expanded_container_get_has_window( |
| 188 GtkExpandedContainer* container) { | 188 GtkExpandedContainer* container) { |
| 189 g_return_val_if_fail(GTK_IS_EXPANDED_CONTAINER(container), FALSE); | 189 g_return_val_if_fail(GTK_IS_EXPANDED_CONTAINER(container), FALSE); |
| 190 return gtk_fixed_get_has_window(GTK_FIXED(container)); | 190 return gtk_fixed_get_has_window(GTK_FIXED(container)); |
| 191 } | 191 } |
| 192 | 192 |
| 193 G_END_DECLS | 193 G_END_DECLS |
| OLD | NEW |