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

Side by Side Diff: chrome/browser/gtk/bookmark_bar_gtk.cc

Issue 155821: GTK Themes: In GTK mode, bookmark buttons should be the same size as "Other bookmarks". (Closed)
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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/gtk/bookmark_bar_gtk.h" 5 #include "chrome/browser/gtk/bookmark_bar_gtk.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "app/gfx/text_elider.h" 9 #include "app/gfx/text_elider.h"
10 #include "app/l10n_util.h" 10 #include "app/l10n_util.h"
(...skipping 29 matching lines...) Expand all
40 40
41 // The height of the bar. 41 // The height of the bar.
42 const int kBookmarkBarHeight = 29; 42 const int kBookmarkBarHeight = 29;
43 43
44 // Left-padding for the instructional text. 44 // Left-padding for the instructional text.
45 const int kInstructionsPadding = 6; 45 const int kInstructionsPadding = 6;
46 46
47 // Color of the instructional text. 47 // Color of the instructional text.
48 const GdkColor kInstructionsColor = GDK_COLOR_RGB(128, 128, 142); 48 const GdkColor kInstructionsColor = GDK_COLOR_RGB(128, 128, 142);
49 49
50 void SetToolBarStyle() {
51 static bool style_was_set = false;
52
53 if (style_was_set)
54 return;
55 style_was_set = true;
56
57 gtk_rc_parse_string(
58 "style \"chrome-bookmark-toolbar\" {"
59 " xthickness = 0\n"
60 " ythickness = 0\n"
61 " GtkWidget::focus-padding = 0\n"
62 " GtkContainer::border-width = 0\n"
63 " GtkToolBar::internal-padding = 0\n"
64 " GtkToolBar::shadow-type = GTK_SHADOW_NONE\n"
65 "}\n"
66 "widget \"*chrome-bookmark-toolbar\" style \"chrome-bookmark-toolbar\"");
67 }
68
50 } // namespace 69 } // namespace
51 70
52 BookmarkBarGtk::BookmarkBarGtk(Profile* profile, Browser* browser, 71 BookmarkBarGtk::BookmarkBarGtk(Profile* profile, Browser* browser,
53 BrowserWindowGtk* window) 72 BrowserWindowGtk* window)
54 : profile_(NULL), 73 : profile_(NULL),
55 page_navigator_(NULL), 74 page_navigator_(NULL),
56 browser_(browser), 75 browser_(browser),
57 window_(window), 76 window_(window),
58 model_(NULL), 77 model_(NULL),
59 instructions_(NULL), 78 instructions_(NULL),
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 &kInstructionsColor); 141 &kInstructionsColor);
123 gtk_container_add(GTK_CONTAINER(instructions_), instructions_label); 142 gtk_container_add(GTK_CONTAINER(instructions_), instructions_label);
124 gtk_box_pack_start(GTK_BOX(bookmark_hbox_), instructions_, 143 gtk_box_pack_start(GTK_BOX(bookmark_hbox_), instructions_,
125 FALSE, FALSE, 0); 144 FALSE, FALSE, 0);
126 145
127 gtk_widget_set_app_paintable(bookmark_hbox_, TRUE); 146 gtk_widget_set_app_paintable(bookmark_hbox_, TRUE);
128 g_signal_connect(G_OBJECT(bookmark_hbox_), "expose-event", 147 g_signal_connect(G_OBJECT(bookmark_hbox_), "expose-event",
129 G_CALLBACK(&OnHBoxExpose), this); 148 G_CALLBACK(&OnHBoxExpose), this);
130 149
131 bookmark_toolbar_.Own(gtk_toolbar_new()); 150 bookmark_toolbar_.Own(gtk_toolbar_new());
151 SetToolBarStyle();
152 gtk_widget_set_name(bookmark_toolbar_.get(), "chrome-bookmark-toolbar");
132 gtk_widget_set_app_paintable(bookmark_toolbar_.get(), TRUE); 153 gtk_widget_set_app_paintable(bookmark_toolbar_.get(), TRUE);
133 g_signal_connect(G_OBJECT(bookmark_toolbar_.get()), "expose-event", 154 g_signal_connect(G_OBJECT(bookmark_toolbar_.get()), "expose-event",
134 G_CALLBACK(&OnToolbarExpose), this); 155 G_CALLBACK(&OnToolbarExpose), this);
135 gtk_box_pack_start(GTK_BOX(bookmark_hbox_), bookmark_toolbar_.get(), 156 gtk_box_pack_start(GTK_BOX(bookmark_hbox_), bookmark_toolbar_.get(),
136 TRUE, TRUE, 0); 157 TRUE, TRUE, 0);
137 158
138 gtk_drag_dest_set(bookmark_toolbar_.get(), GTK_DEST_DEFAULT_DROP, 159 gtk_drag_dest_set(bookmark_toolbar_.get(), GTK_DEST_DEFAULT_DROP,
139 NULL, 0, GDK_ACTION_MOVE); 160 NULL, 0, GDK_ACTION_MOVE);
140 GtkDndUtil::SetDestTargetListFromCodeMask(bookmark_toolbar_.get(), 161 GtkDndUtil::SetDestTargetListFromCodeMask(bookmark_toolbar_.get(),
141 GtkDndUtil::CHROME_BOOKMARK_ITEM | 162 GtkDndUtil::CHROME_BOOKMARK_ITEM |
(...skipping 669 matching lines...) Expand 10 before | Expand all | Expand 10 after
811 bar->InitBackground(); 832 bar->InitBackground();
812 gfx::Point tabstrip_origin = 833 gfx::Point tabstrip_origin =
813 bar->window_->tabstrip()->GetTabStripOriginForWidget(widget); 834 bar->window_->tabstrip()->GetTabStripOriginForWidget(widget);
814 bar->background_ninebox_->RenderTopCenterStrip( 835 bar->background_ninebox_->RenderTopCenterStrip(
815 cr, tabstrip_origin.x(), tabstrip_origin.y(), 836 cr, tabstrip_origin.x(), tabstrip_origin.y(),
816 event->area.x + event->area.width - tabstrip_origin.x()); 837 event->area.x + event->area.width - tabstrip_origin.x());
817 cairo_destroy(cr); 838 cairo_destroy(cr);
818 839
819 return FALSE; // Propagate expose to children. 840 return FALSE; // Propagate expose to children.
820 } 841 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698