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

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

Issue 342027: Give the TabContentsContainer a white background so the user will (Closed)
Patch Set: render_area_event_box_ Created 11 years, 1 month 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/browser_window_gtk.h" 5 #include "chrome/browser/gtk/browser_window_gtk.h"
6 6
7 #include <gdk/gdkkeysyms.h> 7 #include <gdk/gdkkeysyms.h>
8 #include <X11/XF86keysym.h> 8 #include <X11/XF86keysym.h>
9 9
10 #include <string> 10 #include <string>
(...skipping 1702 matching lines...) Expand 10 before | Expand all | Expand 10 after
1713 prefs::kDevToolsSplitLocation); 1713 prefs::kDevToolsSplitLocation);
1714 if (split_offset != -1) { 1714 if (split_offset != -1) {
1715 gtk_paned_set_position(GTK_PANED(contents_split_), split_offset); 1715 gtk_paned_set_position(GTK_PANED(contents_split_), split_offset);
1716 } else { 1716 } else {
1717 gtk_widget_set_size_request(devtools_container_->widget(), -1, 1717 gtk_widget_set_size_request(devtools_container_->widget(), -1,
1718 kDefaultDevToolsHeight); 1718 kDefaultDevToolsHeight);
1719 } 1719 }
1720 gtk_widget_show_all(render_area_vbox_); 1720 gtk_widget_show_all(render_area_vbox_);
1721 gtk_widget_hide(devtools_container_->widget()); 1721 gtk_widget_hide(devtools_container_->widget());
1722 render_area_event_box_ = gtk_event_box_new(); 1722 render_area_event_box_ = gtk_event_box_new();
1723 // Set a white background so during startup the user sees white in the
1724 // content area before we get a TabContents in place.
1725 gtk_widget_modify_bg(render_area_event_box_, GTK_STATE_NORMAL,
1726 &gfx::kGdkWhite);
1723 gtk_container_add(GTK_CONTAINER(render_area_event_box_), render_area_vbox_); 1727 gtk_container_add(GTK_CONTAINER(render_area_event_box_), render_area_vbox_);
1724 gtk_widget_show(render_area_event_box_); 1728 gtk_widget_show(render_area_event_box_);
1725 gtk_box_pack_end(GTK_BOX(window_vbox_), render_area_event_box_, 1729 gtk_box_pack_end(GTK_BOX(window_vbox_), render_area_event_box_,
1726 TRUE, TRUE, 0); 1730 TRUE, TRUE, 0);
1727 1731
1728 if (IsBookmarkBarSupported()) { 1732 if (IsBookmarkBarSupported()) {
1729 bookmark_bar_.reset(new BookmarkBarGtk(this, 1733 bookmark_bar_.reset(new BookmarkBarGtk(this,
1730 browser_->profile(), 1734 browser_->profile(),
1731 browser_.get(), 1735 browser_.get(),
1732 tabstrip_.get())); 1736 tabstrip_.get()));
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
1819 } 1823 }
1820 1824
1821 SkColor frame_color = theme_provider->GetColor(frame_color_id); 1825 SkColor frame_color = theme_provider->GetColor(frame_color_id);
1822 1826
1823 // Paint the frame color on the left, right and bottom. 1827 // Paint the frame color on the left, right and bottom.
1824 GdkColor frame_color_gdk = SkColorToGdkColor(frame_color); 1828 GdkColor frame_color_gdk = SkColorToGdkColor(frame_color);
1825 gtk_widget_modify_bg(GTK_WIDGET(window_), GTK_STATE_NORMAL, 1829 gtk_widget_modify_bg(GTK_WIDGET(window_), GTK_STATE_NORMAL,
1826 &frame_color_gdk); 1830 &frame_color_gdk);
1827 1831
1828 // Set the color of the dev tools divider. 1832 // Set the color of the dev tools divider.
1829 gtk_widget_modify_bg(render_area_event_box_, GTK_STATE_NORMAL,
1830 &frame_color_gdk);
1831 gtk_widget_modify_bg(contents_split_, GTK_STATE_NORMAL, &frame_color_gdk); 1833 gtk_widget_modify_bg(contents_split_, GTK_STATE_NORMAL, &frame_color_gdk);
1832 1834
1833 // When the cursor is over the divider, GTK+ normally lightens the background 1835 // When the cursor is over the divider, GTK+ normally lightens the background
1834 // color by 1.3 (see LIGHTNESS_MULT in gtkstyle.c). Since we're setting the 1836 // color by 1.3 (see LIGHTNESS_MULT in gtkstyle.c). Since we're setting the
1835 // color, override the prelight also. 1837 // color, override the prelight also.
1836 color_utils::HSL hsl = { -1, 0.5, 0.65 }; 1838 color_utils::HSL hsl = { -1, 0.5, 0.65 };
1837 SkColor frame_prelight_color = color_utils::HSLShift(frame_color, hsl); 1839 SkColor frame_prelight_color = color_utils::HSLShift(frame_color, hsl);
1838 GdkColor frame_prelight_color_gdk = SkColorToGdkColor(frame_prelight_color); 1840 GdkColor frame_prelight_color_gdk = SkColorToGdkColor(frame_prelight_color);
1839 gtk_widget_modify_bg(contents_split_, GTK_STATE_PRELIGHT, 1841 gtk_widget_modify_bg(contents_split_, GTK_STATE_PRELIGHT,
1840 &frame_prelight_color_gdk); 1842 &frame_prelight_color_gdk);
(...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after
2298 // are taken from the WMs' source code. 2300 // are taken from the WMs' source code.
2299 return (wm_name == "Blackbox" || 2301 return (wm_name == "Blackbox" ||
2300 wm_name == "compiz" || 2302 wm_name == "compiz" ||
2301 wm_name == "e16" || // Enlightenment DR16 2303 wm_name == "e16" || // Enlightenment DR16
2302 wm_name == "KWin" || 2304 wm_name == "KWin" ||
2303 wm_name == "Metacity" || 2305 wm_name == "Metacity" ||
2304 wm_name == "Mutter" || 2306 wm_name == "Mutter" ||
2305 wm_name == "Openbox" || 2307 wm_name == "Openbox" ||
2306 wm_name == "Xfwm4"); 2308 wm_name == "Xfwm4");
2307 } 2309 }
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