1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "chrome/browser/ui/libgtk2ui/chrome_gtk_frame.h"
9 // MetaFrames declaration
10 G_DEFINE_TYPE(MetaFrames
, meta_frames
, GTK_TYPE_WINDOW
)
12 static void meta_frames_class_init(MetaFramesClass
* frames_class
) {
13 // Noop since we don't declare anything.
16 static void meta_frames_init(MetaFrames
* button
) {
20 // ChromeGtkFrame declaration
21 G_DEFINE_TYPE(ChromeGtkFrame
, chrome_gtk_frame
, meta_frames_get_type())
23 static void chrome_gtk_frame_class_init(ChromeGtkFrameClass
* frame_class
) {
24 GtkWidgetClass
* widget_class
= reinterpret_cast<GtkWidgetClass
*>(frame_class
);
27 gtk_widget_class_install_style_property(
32 "The color that the chrome frame will be. (If unspecified, "
33 " Chrome will take ChromeGtkFrame::bg[SELECTED] and slightly darken"
37 gtk_widget_class_install_style_property(
40 "inactive-frame-color",
41 "Inactive Frame Color",
42 "The color that the inactive chrome frame will be. (If"
43 " unspecified, Chrome will take ChromeGtkFrame::bg[INSENSITIVE]"
44 " and slightly darken it.)",
47 gtk_widget_class_install_style_property(
50 "incognito-frame-color",
51 "Incognito Frame Color",
52 "The color that the incognito frame will be. (If unspecified,"
53 " Chrome will take the frame color and tint it by Chrome's default"
57 gtk_widget_class_install_style_property(
60 "incognito-inactive-frame-color",
61 "Incognito Inactive Frame Color",
62 "The color that the inactive incognito frame will be. (If"
63 " unspecified, Chrome will take the frame color and tint it by"
64 " Chrome's default incognito tint.)",
68 // Frame gradient control:
69 gtk_widget_class_install_style_property(
72 "frame-gradient-size",
73 "Chrome Frame Gradient Size",
74 "The size of the gradient on top of the frame image. Specify 0 to"
75 " make the frame a solid color.",
76 0, // 0 disables the gradient
77 128, // The frame image is only up to 128 pixels tall.
78 16, // By default, gradients are 16 pixels high.
80 gtk_widget_class_install_style_property(
83 "frame-gradient-color",
84 "Frame Gradient Color",
85 "The top color of the chrome frame gradient. (If unspecified,"
86 " chrome will create a lighter tint of frame-color",
89 gtk_widget_class_install_style_property(
92 "inactive-frame-gradient-color",
93 "Inactive Frame Gradient Color",
94 "The top color of the inactive chrome frame gradient. (If"
95 " unspecified, chrome will create a lighter tint of frame-color",
98 gtk_widget_class_install_style_property(
101 "incognito-frame-gradient-color",
102 "Incognito Frame Gradient Color",
103 "The top color of the incognito chrome frame gradient. (If"
104 " unspecified, chrome will create a lighter tint of frame-color",
107 gtk_widget_class_install_style_property(
110 "incognito-inactive-frame-gradient-color",
111 "Incognito Inactive Frame Gradient Color",
112 "The top color of the incognito inactive chrome frame gradient. (If"
113 " unspecified, chrome will create a lighter tint of frame-color",
117 // Scrollbar color properties:
118 gtk_widget_class_install_style_property(
121 "scrollbar-slider-prelight-color",
122 "Scrollbar Slider Prelight Color",
123 "The color applied to the mouse is above the tab",
126 gtk_widget_class_install_style_property(
129 "scrollbar-slider-normal-color",
130 "Scrollbar Slider Normal Color",
131 "The color applied to the slider normally",
134 gtk_widget_class_install_style_property(
137 "scrollbar-trough-color",
138 "Scrollbar Trough Color",
139 "The background color of the slider track",
144 static void chrome_gtk_frame_init(ChromeGtkFrame
* frame
) {
147 GtkWidget
* chrome_gtk_frame_new(void) {
148 return GTK_WIDGET(g_object_new(chrome_gtk_frame_get_type(),
149 "type", GTK_WINDOW_TOPLEVEL
,