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"
7 G_GNUC_BEGIN_IGNORE_DEPRECATIONS
11 // MetaFrames declaration
12 G_DEFINE_TYPE(MetaFrames
, meta_frames
, GTK_TYPE_WINDOW
)
14 static void meta_frames_class_init(MetaFramesClass
* frames_class
) {
15 // Noop since we don't declare anything.
18 static void meta_frames_init(MetaFrames
* button
) {
22 // ChromeGtkFrame declaration
23 G_DEFINE_TYPE(ChromeGtkFrame
, chrome_gtk_frame
, meta_frames_get_type())
25 static void chrome_gtk_frame_class_init(ChromeGtkFrameClass
* frame_class
) {
26 GtkWidgetClass
* widget_class
= reinterpret_cast<GtkWidgetClass
*>(frame_class
);
29 gtk_widget_class_install_style_property(
34 "The color that the chrome frame will be. (If unspecified, "
35 " Chrome will take ChromeGtkFrame::bg[SELECTED] and slightly darken"
39 gtk_widget_class_install_style_property(
42 "inactive-frame-color",
43 "Inactive Frame Color",
44 "The color that the inactive chrome frame will be. (If"
45 " unspecified, Chrome will take ChromeGtkFrame::bg[INSENSITIVE]"
46 " and slightly darken it.)",
49 gtk_widget_class_install_style_property(
52 "incognito-frame-color",
53 "Incognito Frame Color",
54 "The color that the incognito frame will be. (If unspecified,"
55 " Chrome will take the frame color and tint it by Chrome's default"
59 gtk_widget_class_install_style_property(
62 "incognito-inactive-frame-color",
63 "Incognito Inactive Frame Color",
64 "The color that the inactive incognito frame will be. (If"
65 " unspecified, Chrome will take the frame color and tint it by"
66 " Chrome's default incognito tint.)",
70 // Frame gradient control:
71 gtk_widget_class_install_style_property(
74 "frame-gradient-size",
75 "Chrome Frame Gradient Size",
76 "The size of the gradient on top of the frame image. Specify 0 to"
77 " make the frame a solid color.",
78 0, // 0 disables the gradient
79 128, // The frame image is only up to 128 pixels tall.
80 16, // By default, gradients are 16 pixels high.
82 gtk_widget_class_install_style_property(
85 "frame-gradient-color",
86 "Frame Gradient Color",
87 "The top color of the chrome frame gradient. (If unspecified,"
88 " chrome will create a lighter tint of frame-color",
91 gtk_widget_class_install_style_property(
94 "inactive-frame-gradient-color",
95 "Inactive Frame Gradient Color",
96 "The top color of the inactive chrome frame gradient. (If"
97 " unspecified, chrome will create a lighter tint of frame-color",
100 gtk_widget_class_install_style_property(
103 "incognito-frame-gradient-color",
104 "Incognito Frame Gradient Color",
105 "The top color of the incognito chrome frame gradient. (If"
106 " unspecified, chrome will create a lighter tint of frame-color",
109 gtk_widget_class_install_style_property(
112 "incognito-inactive-frame-gradient-color",
113 "Incognito Inactive Frame Gradient Color",
114 "The top color of the incognito inactive chrome frame gradient. (If"
115 " unspecified, chrome will create a lighter tint of frame-color",
119 // Scrollbar color properties:
120 gtk_widget_class_install_style_property(
123 "scrollbar-slider-prelight-color",
124 "Scrollbar Slider Prelight Color",
125 "The color applied to the mouse is above the tab",
128 gtk_widget_class_install_style_property(
131 "scrollbar-slider-normal-color",
132 "Scrollbar Slider Normal Color",
133 "The color applied to the slider normally",
136 gtk_widget_class_install_style_property(
139 "scrollbar-trough-color",
140 "Scrollbar Trough Color",
141 "The background color of the slider track",
146 static void chrome_gtk_frame_init(ChromeGtkFrame
* frame
) {
149 GtkWidget
* chrome_gtk_frame_new(void) {
150 return GTK_WIDGET(g_object_new(chrome_gtk_frame_get_type(),
151 "type", GTK_WINDOW_TOPLEVEL
,