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

Issue 10180011: Support painting panels with chromium themes on GTK. (Closed)

Created:
8 years, 8 months ago by jianli
Modified:
8 years, 7 months ago
Reviewers:
jennb, Evan Stade
CC:
chromium-reviews, jennb, Dmitry Titov, dcheng, Andrei
Visibility:
Public.

Description

Support painting panels with chromium themes on GTK. In this patch, I moved more panel-specific logic out of the base classes: * Title decoration to draw the title with pango markup * SendEnterNotifyToCloseButtonIfUnderMouse I overrode UsingCustomPopupFrame in PanelBrowserWindowGtk to always return false. That way, panels are always painted with custom frame. Now no matter which theme the user picks and which state (drawing attention or not) the panel is at, we paint the frame in the same code path. I also fixed the extra line shown in title-only panel by adding IsMinimized check to BrowserWindowGtk::ShouldDrawContentDropShadow. BUG=117205 TEST=Manual test by verifying panels being painted with correct theme Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=134635

Patch Set 1 #

Patch Set 2 : Sync #

Total comments: 37

Patch Set 3 : Fix per feedback #

Total comments: 6

Patch Set 4 : Fix clang #

Patch Set 5 : Fix per more feedback #

Total comments: 15

Patch Set 6 : Fix per feedback #

Patch Set 7 : Change default theme handling #

Total comments: 3

Patch Set 8 : Patch to land #

Unified diffs Side-by-side diffs Delta from patch set Stats (+272 lines, -259 lines) Patch
M chrome/browser/ui/gtk/browser_titlebar.h View 6 chunks +13 lines, -25 lines 0 comments Download
M chrome/browser/ui/gtk/browser_titlebar.cc View 1 2 4 chunks +3 lines, -55 lines 0 comments Download
M chrome/browser/ui/gtk/browser_window_gtk.h View 1 2 7 chunks +12 lines, -21 lines 0 comments Download
M chrome/browser/ui/gtk/browser_window_gtk.cc View 1 2 4 chunks +3 lines, -10 lines 0 comments Download
M chrome/browser/ui/panels/native_panel.h View 1 2 1 chunk +0 lines, -4 lines 0 comments Download
M chrome/browser/ui/panels/panel_browser_frame_view.h View 1 2 1 chunk +0 lines, -4 lines 0 comments Download
M chrome/browser/ui/panels/panel_browser_frame_view.cc View 1 2 1 chunk +0 lines, -4 lines 0 comments Download
M chrome/browser/ui/panels/panel_browser_titlebar_gtk.h View 1 2 3 chunks +20 lines, -0 lines 0 comments Download
M chrome/browser/ui/panels/panel_browser_titlebar_gtk.cc View 1 2 3 4 5 6 4 chunks +110 lines, -0 lines 0 comments Download
M chrome/browser/ui/panels/panel_browser_view.h View 1 2 1 chunk +0 lines, -1 line 0 comments Download
M chrome/browser/ui/panels/panel_browser_view.cc View 1 2 1 chunk +0 lines, -4 lines 0 comments Download
M chrome/browser/ui/panels/panel_browser_window_cocoa.h View 1 2 1 chunk +0 lines, -1 line 0 comments Download
M chrome/browser/ui/panels/panel_browser_window_cocoa.mm View 1 2 1 chunk +0 lines, -5 lines 0 comments Download
M chrome/browser/ui/panels/panel_browser_window_gtk.h View 1 2 3 4 5 4 chunks +20 lines, -6 lines 0 comments Download
M chrome/browser/ui/panels/panel_browser_window_gtk.cc View 1 2 3 4 5 6 7 11 chunks +91 lines, -101 lines 0 comments Download
M chrome/browser/ui/panels/panel_titlebar_view_cocoa.h View 1 2 1 chunk +0 lines, -3 lines 0 comments Download
M chrome/browser/ui/panels/panel_titlebar_view_cocoa.mm View 1 2 1 chunk +0 lines, -8 lines 0 comments Download
M chrome/browser/ui/panels/panel_window_controller_cocoa.h View 1 2 1 chunk +0 lines, -3 lines 0 comments Download
M chrome/browser/ui/panels/panel_window_controller_cocoa.mm View 1 2 1 chunk +0 lines, -4 lines 0 comments Download

Messages

Total messages: 14 (0 generated)
jianli
Evan, could you please review all changes related to BrowserTitlebar and BrowserWindowGtk? Jenn, could you ...
8 years, 8 months ago (2012-04-27 00:15:00 UTC) #1
dcheng
http://codereview.chromium.org/10180011/diff/13/chrome/browser/ui/panels/panel_browser_titlebar_gtk.cc File chrome/browser/ui/panels/panel_browser_titlebar_gtk.cc (right): http://codereview.chromium.org/10180011/diff/13/chrome/browser/ui/panels/panel_browser_titlebar_gtk.cc#newcode33 chrome/browser/ui/panels/panel_browser_titlebar_gtk.cc:33: const SkColor kInactiveTitleTextDefaultColor = 0x80888888; Consider using SkColorSetARGB. It ...
8 years, 8 months ago (2012-04-27 01:18:39 UTC) #2
jennb
Evan - I don't have graphics experience. Could you also take a close look at ...
8 years, 8 months ago (2012-04-27 18:36:13 UTC) #3
jianli
http://codereview.chromium.org/10180011/diff/13/chrome/browser/ui/gtk/browser_titlebar.cc File chrome/browser/ui/gtk/browser_titlebar.cc (right): http://codereview.chromium.org/10180011/diff/13/chrome/browser/ui/gtk/browser_titlebar.cc#newcode642 chrome/browser/ui/gtk/browser_titlebar.cc:642: break; On 2012/04/27 18:36:13, jennb wrote: > NOTREACHED() Done. ...
8 years, 8 months ago (2012-04-27 20:22:34 UTC) #4
jennb
LGTM if Evan and some graphics-skilled person agrees. Appreciate you improving the look of GTK ...
8 years, 8 months ago (2012-04-27 20:37:24 UTC) #5
jianli
http://codereview.chromium.org/10180011/diff/16001/chrome/browser/ui/panels/panel_browser_window_gtk.cc File chrome/browser/ui/panels/panel_browser_window_gtk.cc (right): http://codereview.chromium.org/10180011/diff/16001/chrome/browser/ui/panels/panel_browser_window_gtk.cc#newcode56 chrome/browser/ui/panels/panel_browser_window_gtk.cc:56: // the experiment and should work for most of ...
8 years, 8 months ago (2012-04-27 20:44:24 UTC) #6
Evan Stade
http://codereview.chromium.org/10180011/diff/18003/chrome/browser/ui/panels/panel_browser_window_gtk.cc File chrome/browser/ui/panels/panel_browser_window_gtk.cc (right): http://codereview.chromium.org/10180011/diff/18003/chrome/browser/ui/panels/panel_browser_window_gtk.cc#newcode55 chrome/browser/ui/panels/panel_browser_window_gtk.cc:55: // pre-determined, we use a reasonablly bigger value that ...
8 years, 8 months ago (2012-04-27 21:27:33 UTC) #7
jianli
http://codereview.chromium.org/10180011/diff/18003/chrome/browser/ui/panels/panel_browser_window_gtk.cc File chrome/browser/ui/panels/panel_browser_window_gtk.cc (right): http://codereview.chromium.org/10180011/diff/18003/chrome/browser/ui/panels/panel_browser_window_gtk.cc#newcode55 chrome/browser/ui/panels/panel_browser_window_gtk.cc:55: // pre-determined, we use a reasonablly bigger value that ...
8 years, 8 months ago (2012-04-27 22:21:06 UTC) #8
Evan Stade
http://codereview.chromium.org/10180011/diff/18003/chrome/browser/ui/panels/panel_browser_window_gtk.cc File chrome/browser/ui/panels/panel_browser_window_gtk.cc (right): http://codereview.chromium.org/10180011/diff/18003/chrome/browser/ui/panels/panel_browser_window_gtk.cc#newcode293 chrome/browser/ui/panels/panel_browser_window_gtk.cc:293: if (theme_provider->UsingDefaultTheme()) { On 2012/04/27 22:21:06, jianli wrote: > ...
8 years, 8 months ago (2012-04-27 22:29:23 UTC) #9
jianli
On 2012/04/27 22:29:23, Evan Stade wrote: > http://codereview.chromium.org/10180011/diff/18003/chrome/browser/ui/panels/panel_browser_window_gtk.cc > File chrome/browser/ui/panels/panel_browser_window_gtk.cc (right): > > http://codereview.chromium.org/10180011/diff/18003/chrome/browser/ui/panels/panel_browser_window_gtk.cc#newcode293 ...
8 years, 8 months ago (2012-04-27 22:40:11 UTC) #10
Evan Stade
On 2012/04/27 22:40:11, jianli wrote: > On 2012/04/27 22:29:23, Evan Stade wrote: > > > ...
8 years, 8 months ago (2012-04-27 23:22:37 UTC) #11
jianli
On 2012/04/27 23:22:37, Evan Stade wrote: > On 2012/04/27 22:40:11, jianli wrote: > > On ...
8 years, 8 months ago (2012-04-28 00:01:42 UTC) #12
Evan Stade
can you try this out and post screenshots for a variety of dark and light ...
8 years, 7 months ago (2012-04-30 20:41:55 UTC) #13
Evan Stade
8 years, 7 months ago (2012-04-30 23:07:21 UTC) #14
lgtm

http://codereview.chromium.org/10180011/diff/17023/chrome/browser/ui/panels/p...
File chrome/browser/ui/panels/panel_browser_window_gtk.cc (right):

http://codereview.chromium.org/10180011/diff/17023/chrome/browser/ui/panels/p...
chrome/browser/ui/panels/panel_browser_window_gtk.cc:260: return
GetAttentionBackgroundDefaultImage();
this function appears to be used regardless of whether we're on the default
theme, so the function name is misleading

http://codereview.chromium.org/10180011/diff/17023/chrome/browser/ui/panels/p...
chrome/browser/ui/panels/panel_browser_window_gtk.cc:268: return
theme_provider->GetImageNamed((paint_state == PAINT_AS_ACTIVE) ?
get rid of unnecessary parens

http://codereview.chromium.org/10180011/diff/17023/chrome/browser/ui/panels/p...
chrome/browser/ui/panels/panel_browser_window_gtk.cc:272: return
theme_provider->GetImageNamed((paint_state == PAINT_AS_ACTIVE) ?
ditto

Powered by Google App Engine
This is Rietveld 408576698