• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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.
4 //
5 // A list of constants that are used in setting up GTK widgets.
6 //
7 // This contains named color constants, along with spacing constants from the
8 // GNOME Human Interface Guide.
9 
10 #ifndef UI_BASE_GTK_GTK_HIG_CONSTANTS_H_
11 #define UI_BASE_GTK_GTK_HIG_CONSTANTS_H_
12 
13 typedef struct _GdkColor GdkColor;
14 
15 // Define a macro for creating GdkColors from RGB values.  This is a macro to
16 // allow static construction of literals, etc.  Use this like:
17 //   GdkColor white = GDK_COLOR_RGB(0xff, 0xff, 0xff);
18 #define GDK_COLOR_RGB(r, g, b) {0, r * ::ui::kSkiaToGDKMultiplier,  \
19         g * ::ui::kSkiaToGDKMultiplier, b * ::ui::kSkiaToGDKMultiplier}
20 
21 namespace ui {
22 
23 // Multiply uint8 color components by this.
24 const int kSkiaToGDKMultiplier = 257;
25 
26 // Common color constants.
27 const GdkColor kGdkWhite = GDK_COLOR_RGB(0xFF, 0xFF, 0xFF);
28 const GdkColor kGdkBlack = GDK_COLOR_RGB(0x00, 0x00, 0x00);
29 const GdkColor kGdkGray = GDK_COLOR_RGB(0x7F, 0x7F, 0x7F);
30 
31 // Constants relating to the layout of dialog windows:
32 // (See http://library.gnome.org/devel/hig-book/stable/design-window.html.en)
33 
34 // Spacing between controls of the same group.
35 const int kControlSpacing = 6;
36 
37 // Horizontal spacing between a label and its control.
38 const int kLabelSpacing = 12;
39 
40 // Indent of the controls within each group.
41 const int kGroupIndent = 12;
42 
43 // Space around the outside of a dialog's contents.
44 const int kContentAreaBorder = 12;
45 
46 // Spacing between groups of controls.
47 const int kContentAreaSpacing = 18;
48 
49 // Horizontal Spacing between controls in a form.
50 const int kFormControlSpacing = 10;
51 
52 }  // namespace ui
53 
54 #endif  // UI_BASE_GTK_GTK_HIG_CONSTANTS_H_
55