Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(362)

Side by Side Diff: chrome/browser/ui/gtk/gtk_chrome_shrinkable_hbox.cc

Issue 9147044: GTK: More GSEALing. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: jhawkins refactor Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_chrome_shrinkable_hbox.h" 5 #include "chrome/browser/ui/gtk/gtk_chrome_shrinkable_hbox.h"
6 6
7 #include <gtk/gtk.h> 7 #include <gtk/gtk.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 gtk_widget_show(child); 44 gtk_widget_show(child);
45 ++(*reinterpret_cast<int*>(userdata)); 45 ++(*reinterpret_cast<int*>(userdata));
46 } 46 }
47 } 47 }
48 48
49 void ChildSizeAllocate(GtkWidget* child, gpointer userdata) { 49 void ChildSizeAllocate(GtkWidget* child, gpointer userdata) {
50 if (!gtk_widget_get_visible(child)) 50 if (!gtk_widget_get_visible(child))
51 return; 51 return;
52 52
53 SizeAllocateData* data = reinterpret_cast<SizeAllocateData*>(userdata); 53 SizeAllocateData* data = reinterpret_cast<SizeAllocateData*>(userdata);
54 GtkAllocation child_allocation = child->allocation; 54 GtkAllocation child_allocation;
55 gtk_widget_get_allocation(child, &child_allocation);
55 56
56 if (data->homogeneous) { 57 if (data->homogeneous) {
57 // Make sure the child is not overlapped with others' boundary. 58 // Make sure the child is not overlapped with others' boundary.
58 if (child_allocation.width > data->homogeneous_child_width) { 59 if (child_allocation.width > data->homogeneous_child_width) {
59 child_allocation.x += 60 child_allocation.x +=
60 (child_allocation.width - data->homogeneous_child_width) / 2; 61 (child_allocation.width - data->homogeneous_child_width) / 2;
61 child_allocation.width = data->homogeneous_child_width; 62 child_allocation.width = data->homogeneous_child_width;
62 } 63 }
63 } else { 64 } else {
64 guint padding; 65 guint padding;
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 281
281 gint gtk_chrome_shrinkable_hbox_get_visible_child_count( 282 gint gtk_chrome_shrinkable_hbox_get_visible_child_count(
282 GtkChromeShrinkableHBox* box) { 283 GtkChromeShrinkableHBox* box) {
283 gint visible_children_count = 0; 284 gint visible_children_count = 0;
284 gtk_container_foreach(GTK_CONTAINER(box), CountVisibleChildren, 285 gtk_container_foreach(GTK_CONTAINER(box), CountVisibleChildren,
285 &visible_children_count); 286 &visible_children_count);
286 return visible_children_count; 287 return visible_children_count;
287 } 288 }
288 289
289 G_END_DECLS 290 G_END_DECLS
OLDNEW
« no previous file with comments | « chrome/browser/ui/gtk/fullscreen_exit_bubble_gtk.cc ('k') | chrome/browser/ui/gtk/gtk_custom_menu.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698