summaryrefslogtreecommitdiffstats
path: root/chrome/browser/gtk/chrome_gtk_frame.h
diff options
context:
space:
mode:
authorerg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-13 19:04:00 +0000
committererg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-13 19:04:00 +0000
commit033de111cd6e9ff09f1c785ee8f3d38b0e14bab5 (patch)
tree37a6a08719339af92e617d56f358321004050a38 /chrome/browser/gtk/chrome_gtk_frame.h
parentedc75aaccb3dbc06e27173212f8f1e9fa6649ee1 (diff)
downloadchromium_src-033de111cd6e9ff09f1c785ee8f3d38b0e14bab5.zip
chromium_src-033de111cd6e9ff09f1c785ee8f3d38b0e14bab5.tar.gz
chromium_src-033de111cd6e9ff09f1c785ee8f3d38b0e14bab5.tar.bz2
GTK: Require gtk theme authors to specify their own frame colors.
1) Fix our heuristics to not be terribly wrong, while discouraging their use. If the theme author doesn't specify colors in the form of ChromeGtkFrame::frame-color, use the old MetaFrames/selection color fallback (tinting slightly darker). 2) Give the ChromeGtkFrame several optional widget style properties allowing theme authors to explicitly specify colors for the frame and scrollbars, and control the gradient on top of the chrome frame. TODO: Do we want to let theme authors override the close/min/max button images? BUG=62377, 35317 TEST=for now, compiles, as the needed data hasn't been added by theme authors. Review URL: http://codereview.chromium.org/4715005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@66064 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk/chrome_gtk_frame.h')
-rw-r--r--chrome/browser/gtk/chrome_gtk_frame.h56
1 files changed, 56 insertions, 0 deletions
diff --git a/chrome/browser/gtk/chrome_gtk_frame.h b/chrome/browser/gtk/chrome_gtk_frame.h
new file mode 100644
index 0000000..0fd7d28
--- /dev/null
+++ b/chrome/browser/gtk/chrome_gtk_frame.h
@@ -0,0 +1,56 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_GTK_CHROME_GTK_FRAME_H_
+#define CHROME_BROWSER_GTK_CHROME_GTK_FRAME_H_
+#pragma once
+
+#include <gdk/gdk.h>
+#include <gtk/gtkwindow.h>
+
+G_BEGIN_DECLS
+
+// This file declares two subclasses of GtkWindow for easier gtk+ theme
+// integration.
+//
+// The first is "MetaFrames," which is (was?) the name of a gobject class in
+// the metacity window manager. To actually get at those values, we need to
+// have an object whose gobject class name string matches the definitions in
+// the gtkrc file. MetaFrames derives from GtkWindow.
+//
+// Metaframes can not be instantiated. It has no constructor; instantiate
+// ChromeGtkFrame instead.
+typedef struct _MetaFrames MetaFrames;
+typedef struct _MetaFramesClass MetaFramesClass;
+
+struct _MetaFrames {
+ GtkWindow window;
+};
+
+struct _MetaFramesClass {
+ GtkWindowClass parent_class;
+};
+
+
+// The second is ChromeGtkFrame, which defines a number of optional style
+// properties so theme authors can control how chromium appears in gtk-theme
+// mode. It derives from MetaFrames in chrome so older themes that declare a
+// MetaFrames theme will still work. New themes should target this class.
+typedef struct _ChromeGtkFrame ChromeGtkFrame;
+typedef struct _ChromeGtkFrameClass ChromeGtkFrameClass;
+
+struct _ChromeGtkFrame {
+ MetaFrames frames;
+};
+
+struct _ChromeGtkFrameClass {
+ MetaFramesClass frames_class;
+};
+
+// Creates a GtkWindow object the the class name "ChromeGtkFrame".
+GtkWidget* chrome_gtk_frame_new();
+
+G_END_DECLS
+
+#endif // CHROME_BROWSER_GTK_CHROME_GTK_FRAME_H_