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

Unified Diff: chrome/browser/gtk/bookmark_utils_gtk.cc

Issue 155342: A little bit of bookmark bar cleanup, a little bit of padding improvement.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/gtk/bookmark_bar_gtk.cc ('k') | chrome/browser/gtk/browser_toolbar_gtk.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/gtk/bookmark_utils_gtk.cc
===================================================================
--- chrome/browser/gtk/bookmark_utils_gtk.cc (revision 20336)
+++ chrome/browser/gtk/bookmark_utils_gtk.cc (working copy)
@@ -30,6 +30,15 @@
// Only used for the background of the drag widget.
const GdkColor kBackgroundColor = GDK_COLOR_RGB(0xe6, 0xed, 0xf4);
+// Padding between the chrome button highlight border and the contents (favicon,
+// text).
+// TODO(estade): we need to adjust the top and bottom padding, but first we need
+// to give the bookmark bar more space (at the expense of the toolbar).
+const int kButtonPaddingTop = 0;
+const int kButtonPaddingBottom = 0;
+const int kButtonPaddingLeft = 2;
+const int kButtonPaddingRight = 0;
+
void* AsVoid(const BookmarkNode* node) {
return const_cast<BookmarkNode*>(node);
}
@@ -40,6 +49,7 @@
const char kBookmarkNode[] = "bookmark-node";
+// Spacing between the buttons on the bar.
const int kBarButtonPadding = 4;
GdkPixbuf* GetFolderIcon() {
@@ -123,8 +133,14 @@
GtkWidget* box = gtk_hbox_new(FALSE, kBarButtonPadding);
gtk_box_pack_start(GTK_BOX(box), image, FALSE, FALSE, 0);
gtk_box_pack_start(GTK_BOX(box), label, FALSE, FALSE, 0);
- gtk_container_add(GTK_CONTAINER(button), box);
+ GtkWidget* alignment = gtk_alignment_new(0.0, 0.0, 1.0, 1.0);
+ gtk_alignment_set_padding(GTK_ALIGNMENT(alignment),
+ kButtonPaddingTop, kButtonPaddingBottom,
+ kButtonPaddingLeft, kButtonPaddingRight);
+ gtk_container_add(GTK_CONTAINER(alignment), box);
+ gtk_container_add(GTK_CONTAINER(button), alignment);
+
SetButtonTextColors(label, properties);
g_object_set_data(G_OBJECT(button), bookmark_utils::kBookmarkNode,
AsVoid(node));
@@ -132,7 +148,7 @@
gtk_chrome_button_set_use_gtk_rendering(GTK_CHROME_BUTTON(button),
properties->use_gtk_rendering);
- gtk_widget_show_all(box);
+ gtk_widget_show_all(alignment);
}
std::string BuildTooltipFor(const BookmarkNode* node) {
« no previous file with comments | « chrome/browser/gtk/bookmark_bar_gtk.cc ('k') | chrome/browser/gtk/browser_toolbar_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698