diff options
author | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-19 20:36:02 +0000 |
---|---|---|
committer | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-19 20:36:02 +0000 |
commit | 196418a8dc82f248ca5354c3dedb92ec47357a10 (patch) | |
tree | f854652b54e927965f6682554b72f2b6efd60adf /chrome/browser/gtk/browser_titlebar.h | |
parent | ac799e2dbd956970216255745285176bbef74826 (diff) | |
download | chromium_src-196418a8dc82f248ca5354c3dedb92ec47357a10.zip chromium_src-196418a8dc82f248ca5354c3dedb92ec47357a10.tar.gz chromium_src-196418a8dc82f248ca5354c3dedb92ec47357a10.tar.bz2 |
GTK Theme: Make inactive titlebar legible.
I'm pretty certain we'll never be able to match the text color on custom popup
windows, but at the very least make it legible. Tested in both light and dark
themes.
http://crbug.com/18856
Review URL: http://codereview.chromium.org/173061
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23734 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk/browser_titlebar.h')
-rw-r--r-- | chrome/browser/gtk/browser_titlebar.h | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/chrome/browser/gtk/browser_titlebar.h b/chrome/browser/gtk/browser_titlebar.h index 29b3cb2..7263aec 100644 --- a/chrome/browser/gtk/browser_titlebar.h +++ b/chrome/browser/gtk/browser_titlebar.h @@ -14,13 +14,17 @@ #include "base/scoped_ptr.h" #include "chrome/browser/gtk/menu_gtk.h" +#include "chrome/common/notification_observer.h" +#include "chrome/common/notification_registrar.h" class BrowserWindowGtk; class CustomDrawButton; +class GtkThemeProvider; class TabContents; class TabStripGtk; -class BrowserTitlebar : public MenuGtk::Delegate { +class BrowserTitlebar : public MenuGtk::Delegate, + public NotificationObserver { public: BrowserTitlebar(BrowserWindowGtk* browser_window, GtkWindow* window); virtual ~BrowserTitlebar() { } @@ -83,6 +87,10 @@ class BrowserTitlebar : public MenuGtk::Delegate { // Update the titlebar spacing based on the custom frame and maximized state. void UpdateTitlebarAlignment(); + // Updates the color of the title bar. Called whenever we have a state + // change in the window. + void UpdateTextColor(); + // Callback for changes to window state. This includes // maximizing/restoring/minimizing the window. static gboolean OnWindowStateChanged(GtkWindow* window, @@ -103,6 +111,11 @@ class BrowserTitlebar : public MenuGtk::Delegate { virtual bool IsItemChecked(int command_id) const; virtual void ExecuteCommand(int command_id); + // Overridden from NotificationObserver: + virtual void Observe(NotificationType type, + const NotificationSource& source, + const NotificationDetails& details); + // Pointers to the browser window that owns us and it's GtkWindow. BrowserWindowGtk* browser_window_; GtkWindow* window_; @@ -127,6 +140,10 @@ class BrowserTitlebar : public MenuGtk::Delegate { // Whether we are using a custom frame. bool using_custom_frame_; + // Whether we have focus (gtk_window_is_active() sometimes returns the wrong + // value, so manually track the focus-in and focus-out events.) + bool window_has_focus_; + // We change the size of these three buttons when the window is maximized, so // we use these structs to keep track of their original size. GtkRequisition close_button_req_; @@ -144,6 +161,11 @@ class BrowserTitlebar : public MenuGtk::Delegate { // The throbber used when the window is in app mode or popup window mode. Throbber throbber_; + + // Theme provider for building buttons. + GtkThemeProvider* theme_provider_; + + NotificationRegistrar registrar_; }; #endif // CHROME_BROWSER_GTK_BROWSER_TITLEBAR_H_ |