Home | History | Annotate | Download | only in message_center
      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 #ifndef UI_MESSAGE_CENTER_MESSAGE_CENTER_STYLE_H_
      6 #define UI_MESSAGE_CENTER_MESSAGE_CENTER_STYLE_H_
      7 
      8 #include "base/basictypes.h"
      9 #include "third_party/skia/include/core/SkColor.h"
     10 #include "ui/gfx/size.h"
     11 #include "ui/message_center/message_center_export.h"
     12 
     13 namespace message_center {
     14 
     15 // Exported values /////////////////////////////////////////////////////////////
     16 
     17 // Square image sizes in DIPs.
     18 MESSAGE_CENTER_EXPORT extern const int kNotificationButtonIconSize;
     19 MESSAGE_CENTER_EXPORT extern const int kNotificationIconSize;
     20 MESSAGE_CENTER_EXPORT extern const int kNotificationPreferredImageSize;
     21 MESSAGE_CENTER_EXPORT extern const float kNotificationPreferredImageRatio;
     22 MESSAGE_CENTER_EXPORT extern const int kSettingsIconSize;
     23 
     24 // Limits.
     25 MESSAGE_CENTER_EXPORT extern const size_t kMaxVisiblePopupNotifications;
     26 MESSAGE_CENTER_EXPORT extern const size_t kMaxVisibleMessageCenterNotifications;
     27 
     28 // DIP dimension
     29 MESSAGE_CENTER_EXPORT extern const int kNotificationWidth;  // H size of the
     30                                                             // whole card.
     31 
     32 // Colors.
     33 MESSAGE_CENTER_EXPORT extern const SkColor kMessageCenterBorderColor;
     34 MESSAGE_CENTER_EXPORT extern const SkColor kMessageCenterShadowColor;
     35 
     36 // Within a notification ///////////////////////////////////////////////////////
     37 
     38 // DIP dimensions (H = horizontal, V = vertical).
     39 extern const int kControlButtonSize;  // Square size of close & expand buttons.
     40 extern const int kIconToTextPadding;  // H space between icon & title/message.
     41 extern const int kTextTopPadding;     // V space between text elements.
     42 extern const int kIconBottomPadding;  // Minimum non-zero V space between icon
     43                                       // and frame.
     44 
     45 // Text sizes.
     46 extern const int kTitleFontSize;      // For title only.
     47 extern const int kTitleLineHeight;    // In DIPs.
     48 extern const int kMessageFontSize;    // For everything but title.
     49 extern const int kMessageLineHeight;  // In DIPs.
     50 
     51 // Colors.
     52 extern const SkColor kNotificationBackgroundColor; // Background of the card.
     53 extern const SkColor kLegacyIconBackgroundColor;   // Used behind icons smaller.
     54                                                    // than the icon view.
     55 extern const SkColor kRegularTextColor;            // Title, message, ...
     56 extern const SkColor kDimTextColor;
     57 extern const SkColor kFocusBorderColor;            // The focus border.
     58 
     59 // Limits.
     60 
     61 // Given the size of an image, returns the rect the image should be displayed
     62 // in, centered.
     63 gfx::Size GetImageSizeForWidth(int width, const gfx::Size& image_size);
     64 
     65 extern const int kNotificationMaximumImageHeight;  // For image notifications.
     66 extern const size_t kNotificationMaximumItems;     // For list notifications.
     67 
     68 // Timing.
     69 extern const int kAutocloseDefaultDelaySeconds;
     70 extern const int kAutocloseHighPriorityDelaySeconds;
     71 
     72 // Buttons.
     73 const int kButtonHeight = 38;              // In DIPs.
     74 const int kButtonHorizontalPadding = 16;   // In DIPs.
     75 const int kButtonIconTopPadding = 11;      // In DIPs.
     76 const int kButtonIconToTitlePadding = 16;  // In DIPs.
     77 
     78 #if !defined(OS_LINUX) || defined(USE_AURA)
     79 const SkColor kButtonSeparatorColor = SkColorSetRGB(234, 234, 234);
     80 const SkColor kHoveredButtonBackgroundColor = SkColorSetRGB(243, 243, 243);
     81 #endif
     82 
     83 // Progress bar.
     84 const int kProgressBarThickness = 5;
     85 const int kProgressBarTopPadding = 16;
     86 const int kProgressBarCornerRadius = 3;
     87 const SkColor kProgressBarBackgroundColor = SkColorSetRGB(216, 216, 216);
     88 const SkColor kProgressBarSliceColor = SkColorSetRGB(120, 120, 120);
     89 
     90 // Line limits.
     91 const int kTitleLineLimit = 3;
     92 const int kMessageCollapsedLineLimit = 3;
     93 const int kMessageExpandedLineLimit = 7;
     94 
     95 // Around notifications ////////////////////////////////////////////////////////
     96 
     97 // DIP dimensions (H = horizontal, V = vertical).
     98 MESSAGE_CENTER_EXPORT extern const int kMarginBetweenItems; // H & V space
     99                                                             // around & between
    100                                                             // notifications.
    101 
    102 // Colors.
    103 extern const SkColor kBackgroundLightColor;  // Behind notifications, gradient
    104 extern const SkColor kBackgroundDarkColor;   // from light to dark.
    105 
    106 extern const SkColor kShadowColor;           // Shadow in the tray.
    107 
    108 extern const SkColor kMessageCenterBackgroundColor;
    109 extern const SkColor kFooterDelimiterColor;  // Separator color for the tray.
    110 extern const SkColor kFooterTextColor;       // Text color for tray labels.
    111 
    112 }  // namespace message_center
    113 
    114 #endif  // UI_MESSAGE_CENTER_MESSAGE_CENTER_STYLE_H_
    115