1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154
|
// Copyright (c) 2012 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.
#include "chrome/browser/ui/libgtkui/gtk2/chrome_gtk_frame.h"
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
G_BEGIN_DECLS
// MetaFrames declaration
G_DEFINE_TYPE(MetaFrames, meta_frames, GTK_TYPE_WINDOW)
static void meta_frames_class_init(MetaFramesClass* frames_class) {
// Noop since we don't declare anything.
}
static void meta_frames_init(MetaFrames* button) {
}
// ChromeGtkFrame declaration
G_DEFINE_TYPE(ChromeGtkFrame, chrome_gtk_frame, meta_frames_get_type())
static void chrome_gtk_frame_class_init(ChromeGtkFrameClass* frame_class) {
GtkWidgetClass* widget_class = reinterpret_cast<GtkWidgetClass*>(frame_class);
// Frame tints:
gtk_widget_class_install_style_property(
widget_class,
g_param_spec_boxed(
"frame-color",
"Frame Color",
"The color that the chrome frame will be. (If unspecified, "
" Chrome will take ChromeGtkFrame::bg[SELECTED] and slightly darken"
" it.)",
GDK_TYPE_COLOR,
G_PARAM_READABLE));
gtk_widget_class_install_style_property(
widget_class,
g_param_spec_boxed(
"inactive-frame-color",
"Inactive Frame Color",
"The color that the inactive chrome frame will be. (If"
" unspecified, Chrome will take ChromeGtkFrame::bg[INSENSITIVE]"
" and slightly darken it.)",
GDK_TYPE_COLOR,
G_PARAM_READABLE));
gtk_widget_class_install_style_property(
widget_class,
g_param_spec_boxed(
"incognito-frame-color",
"Incognito Frame Color",
"The color that the incognito frame will be. (If unspecified,"
" Chrome will take the frame color and tint it by Chrome's default"
" incognito tint.)",
GDK_TYPE_COLOR,
G_PARAM_READABLE));
gtk_widget_class_install_style_property(
widget_class,
g_param_spec_boxed(
"incognito-inactive-frame-color",
"Incognito Inactive Frame Color",
"The color that the inactive incognito frame will be. (If"
" unspecified, Chrome will take the frame color and tint it by"
" Chrome's default incognito tint.)",
GDK_TYPE_COLOR,
G_PARAM_READABLE));
// Frame gradient control:
gtk_widget_class_install_style_property(
widget_class,
g_param_spec_int(
"frame-gradient-size",
"Chrome Frame Gradient Size",
"The size of the gradient on top of the frame image. Specify 0 to"
" make the frame a solid color.",
0, // 0 disables the gradient
128, // The frame image is only up to 128 pixels tall.
16, // By default, gradients are 16 pixels high.
G_PARAM_READABLE));
gtk_widget_class_install_style_property(
widget_class,
g_param_spec_boxed(
"frame-gradient-color",
"Frame Gradient Color",
"The top color of the chrome frame gradient. (If unspecified,"
" chrome will create a lighter tint of frame-color",
GDK_TYPE_COLOR,
G_PARAM_READABLE));
gtk_widget_class_install_style_property(
widget_class,
g_param_spec_boxed(
"inactive-frame-gradient-color",
"Inactive Frame Gradient Color",
"The top color of the inactive chrome frame gradient. (If"
" unspecified, chrome will create a lighter tint of frame-color",
GDK_TYPE_COLOR,
G_PARAM_READABLE));
gtk_widget_class_install_style_property(
widget_class,
g_param_spec_boxed(
"incognito-frame-gradient-color",
"Incognito Frame Gradient Color",
"The top color of the incognito chrome frame gradient. (If"
" unspecified, chrome will create a lighter tint of frame-color",
GDK_TYPE_COLOR,
G_PARAM_READABLE));
gtk_widget_class_install_style_property(
widget_class,
g_param_spec_boxed(
"incognito-inactive-frame-gradient-color",
"Incognito Inactive Frame Gradient Color",
"The top color of the incognito inactive chrome frame gradient. (If"
" unspecified, chrome will create a lighter tint of frame-color",
GDK_TYPE_COLOR,
G_PARAM_READABLE));
// Scrollbar color properties:
gtk_widget_class_install_style_property(
widget_class,
g_param_spec_boxed(
"scrollbar-slider-prelight-color",
"Scrollbar Slider Prelight Color",
"The color applied to the mouse is above the tab",
GDK_TYPE_COLOR,
G_PARAM_READABLE));
gtk_widget_class_install_style_property(
widget_class,
g_param_spec_boxed(
"scrollbar-slider-normal-color",
"Scrollbar Slider Normal Color",
"The color applied to the slider normally",
GDK_TYPE_COLOR,
G_PARAM_READABLE));
gtk_widget_class_install_style_property(
widget_class,
g_param_spec_boxed(
"scrollbar-trough-color",
"Scrollbar Trough Color",
"The background color of the slider track",
GDK_TYPE_COLOR,
G_PARAM_READABLE));
}
static void chrome_gtk_frame_init(ChromeGtkFrame* frame) {
}
GtkWidget* chrome_gtk_frame_new(void) {
return GTK_WIDGET(g_object_new(chrome_gtk_frame_get_type(), "type",
GTK_WINDOW_TOPLEVEL, nullptr));
}
G_END_DECLS
|