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

Issue 149432: Add button tinting to the toolbar buttons. (Closed)

Created:
11 years, 5 months ago by tony
Modified:
9 years, 7 months ago
CC:
chromium-reviews_googlegroups.com
Visibility:
Public.

Description

Add button tinting to the toolbar buttons. Make CustomDrawButtonBase aware of the ThemeProvider. If the theme changes, we reload new pixbufs from the ThemeProvider. This breaks RTL of the toolbar buttons, I'll add that back in a follow up change to BrowserThemeProvider. BUG=15506 TEST=Change themes or set the GTK+ theme. The star button and go button should be tinted according to the theme (other buttons as well if not using GTK+ buttons).

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+121 lines, -38 lines) Patch
M chrome/browser/gtk/back_forward_button_gtk.cc View 2 chunks +3 lines, -2 lines 0 comments Download
M chrome/browser/gtk/browser_toolbar_gtk.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/gtk/custom_button.h View 4 chunks +37 lines, -3 lines 0 comments Download
M chrome/browser/gtk/custom_button.cc View 2 chunks +69 lines, -27 lines 0 comments Download
M chrome/browser/gtk/go_button_gtk.cc View 2 chunks +5 lines, -2 lines 0 comments Download
M chrome/browser/gtk/toolbar_star_toggle_gtk.cc View 1 chunk +5 lines, -2 lines 0 comments Download

Messages

Total messages: 9 (0 generated)
tony
11 years, 5 months ago (2009-07-09 23:50:17 UTC) #1
Elliot Glaysher
LGTM. It's too bad a CustomButton will have half of its state changed by one ...
11 years, 5 months ago (2009-07-09 23:56:08 UTC) #2
tony
Oh, you mean CustomDrawButton::SetUseSystemTheme? Hmm, I see. I could rename the method to UserChangedTheme(bool use_gtk) ...
11 years, 5 months ago (2009-07-10 00:02:29 UTC) #3
Elliot Glaysher
It might be better to just use a UserChangedTheme; that's what I'm doing instead of ...
11 years, 5 months ago (2009-07-10 00:12:35 UTC) #4
tony
On 2009/07/10 00:12:35, Elliot Glaysher wrote: > It might be better to just use a ...
11 years, 5 months ago (2009-07-10 00:20:48 UTC) #5
Evan Stade
On 2009/07/10 00:02:29, tony wrote: > Oh, you mean CustomDrawButton::SetUseSystemTheme? Hmm, I see. > > ...
11 years, 5 months ago (2009-07-10 00:21:37 UTC) #6
tony
Ok, I looked at this a bit more. If I remove the notification stuff, then ...
11 years, 5 months ago (2009-07-10 17:05:37 UTC) #7
Elliot Glaysher
Go right ahead and keep it the way it was originally proposed. FYI: I'm looking ...
11 years, 5 months ago (2009-07-10 17:47:26 UTC) #8
Evan Stade
11 years, 5 months ago (2009-07-10 18:19:40 UTC) #9
The notification observer approach seems the cleanest from a code
standpoint. Sure it's wasteful in some sense but we won't get a
noticeable performance hit, and I don't know how much we are concerned
with theme changing performance anyway. I think this is a case where
readability/fewer lines of code trumps performance microseconds.


On Fri, Jul 10, 2009 at 10:05 AM, <tony@chromium.org> wrote:
> Ok, I looked at this a bit more.
>
> If I remove the notification stuff, then I need to add new calls that
> change the theme for the go button and the star button. =A0In the limit,
> we need to plumb through update calls for all themes that change where
> as with notifications, we get updates for free.
>
> On the other hand, I could switch the existing SetUseSystemTheme to use
> notifications, but that would add a NotificationObserver to both
> CustomDrawButtonBase and CustomDrawButton. =A0This is ok, but seems like
> overkill in CustomDrawButton because most buttons can't be GTK+ themed
> (there's no icon for it). =A0There's currently only the 4 toolbar buttons=
,
> although you can imagine that eventually the menus would be some GTK+
> icons as well. =A0There are as many CustomDrawButtons that probably won't
> be GTK+ themed (tab close button, find bar next/prev, new tab button,
> min/max/restore/close). =A0Since only some CustomDrawButtons need to know
> about GTK+ themes, it seems wasteful to put a NotificationObserver
> there.
>
> In conclusion, I think we should just stick with the hybrid mode we have
> now. =A0Most CustomDrawButtonBase classes will need to be updated with ne=
w
> pixbufs when the theme changes. =A0A few CustomDrawButtons will need to b=
e
> updated to GTK+ style when the theme changes. =A0The former uses
> notifications and the latter we just call directly.
>
> Thoughts?
>
> http://codereview.chromium.org/149432
>

Powered by Google App Engine
This is Rietveld 408576698