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