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

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

Issue 196044: GTK Theme: Don't render IDR_THEME_TOOLBAR on GtkWidgets. (Closed)
Patch Set: Created 11 years, 3 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 | « chrome/browser/gtk/find_bar_gtk.cc ('k') | 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/rounded_window.h" 5 #include "chrome/browser/gtk/rounded_window.h"
6 6
7 #include <gtk/gtk.h> 7 #include <gtk/gtk.h>
8 8
9 #include "app/l10n_util.h" 9 #include "app/l10n_util.h"
10 #include "chrome/common/gtk_util.h" 10 #include "chrome/common/gtk_util.h"
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 data, FRAME_MASK); 141 data, FRAME_MASK);
142 GdkRegion* mask_region = gdk_region_polygon(&mask_points[0], 142 GdkRegion* mask_region = gdk_region_polygon(&mask_points[0],
143 mask_points.size(), 143 mask_points.size(),
144 GDK_EVEN_ODD_RULE); 144 GDK_EVEN_ODD_RULE);
145 gdk_window_shape_combine_region(widget->window, mask_region, 0, 0); 145 gdk_window_shape_combine_region(widget->window, mask_region, 0, 0);
146 gdk_region_destroy(mask_region); 146 gdk_region_destroy(mask_region);
147 } 147 }
148 148
149 GdkDrawable* drawable = GDK_DRAWABLE(event->window); 149 GdkDrawable* drawable = GDK_DRAWABLE(event->window);
150 GdkGC* gc = gdk_gc_new(drawable); 150 GdkGC* gc = gdk_gc_new(drawable);
151 gdk_gc_set_clip_rectangle(gc, &event->area);
151 gdk_gc_set_rgb_fg_color(gc, &data->border_color); 152 gdk_gc_set_rgb_fg_color(gc, &data->border_color);
152 153
153 // Stroke the frame border. 154 // Stroke the frame border.
154 std::vector<GdkPoint> points = MakeFramePolygonPoints( 155 std::vector<GdkPoint> points = MakeFramePolygonPoints(
155 data, FRAME_STROKE); 156 data, FRAME_STROKE);
156 if (data->drawn_borders == BORDER_ALL) { 157 if (data->drawn_borders == BORDER_ALL) {
157 // If we want to have borders everywhere, we need to draw a polygon instead 158 // If we want to have borders everywhere, we need to draw a polygon instead
158 // of a set of lines. 159 // of a set of lines.
159 gdk_draw_polygon(drawable, gc, FALSE, &points[0], points.size()); 160 gdk_draw_polygon(drawable, gc, FALSE, &points[0], points.size());
160 } else { 161 } else {
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 205
205 void SetRoundedWindowBorderColor(GtkWidget* widget, GdkColor color) { 206 void SetRoundedWindowBorderColor(GtkWidget* widget, GdkColor color) {
206 DCHECK(widget); 207 DCHECK(widget);
207 RoundedWindowData* data = static_cast<RoundedWindowData*>( 208 RoundedWindowData* data = static_cast<RoundedWindowData*>(
208 g_object_get_data(G_OBJECT(widget), kRoundedData)); 209 g_object_get_data(G_OBJECT(widget), kRoundedData));
209 DCHECK(data); 210 DCHECK(data);
210 data->border_color = color; 211 data->border_color = color;
211 } 212 }
212 213
213 } // namespace gtk_util 214 } // namespace gtk_util
OLDNEW
« no previous file with comments | « chrome/browser/gtk/find_bar_gtk.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698