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 "ui/app_list/app_list_constants.h"
9 const SkColor kContentsBackgroundColor
= SkColorSetRGB(0xF2, 0xF2, 0xF2);
10 const SkColor kSearchBoxBackground
= SK_ColorWHITE
;
12 // In Windows, transparent background color will cause ugly text rendering,
13 // therefore kContentsBackgroundColor should be used. See crbug.com/406989
14 #if defined(OS_CHROMEOS)
15 const SkColor kLabelBackgroundColor
= SK_ColorTRANSPARENT
;
17 const SkColor kLabelBackgroundColor
= kContentsBackgroundColor
;
20 const SkColor kTopSeparatorColor
= SkColorSetRGB(0xC0, 0xC0, 0xC0);
21 const SkColor kBottomSeparatorColor
= SkColorSetRGB(0xC0, 0xC0, 0xC0);
23 // The color of the separator used inside dialogs in the app list.
24 const SkColor kDialogSeparatorColor
= SkColorSetRGB(0xD1, 0xD1, 0xD1);
26 // Non-views Mac requires opaque colors to paint correctly.
27 #if defined(OS_MACOSX) && !defined(TOOLKIT_VIEWS)
28 // The mouse hover colour (3% black over kContentsBackgroundColor).
29 const SkColor kHighlightedColor
= SkColorSetRGB(0xEE, 0xEE, 0xEE);
30 // The keyboard select colour (6% black over kContentsBackgroundColor).
31 const SkColor kSelectedColor
= SkColorSetRGB(0xE6, 0xE6, 0xE6);
33 // The mouse hover colour (3% black).
34 const SkColor kHighlightedColor
= SkColorSetARGB(8, 0, 0, 0);
35 // The keyboard select colour (6% black).
36 const SkColor kSelectedColor
= SkColorSetARGB(15, 0, 0, 0);
39 const SkColor kPagerHoverColor
= SkColorSetRGB(0xB4, 0xB4, 0xB4);
40 const SkColor kPagerNormalColor
= SkColorSetRGB(0xE2, 0xE2, 0xE2);
41 const SkColor kPagerSelectedColor
= SkColorSetRGB(0x46, 0x8F, 0xFC);
43 const SkColor kResultBorderColor
= SkColorSetRGB(0xE5, 0xE5, 0xE5);
44 const SkColor kResultDefaultTextColor
= SkColorSetRGB(0x33, 0x33, 0x33);
45 const SkColor kResultDimmedTextColor
= SkColorSetRGB(0x96, 0x96, 0x96);
46 const SkColor kResultURLTextColor
= SkColorSetRGB(0x00, 0x99, 0x33);
48 const SkColor kGridTitleColor
= SkColorSetRGB(0x33, 0x33, 0x33);
49 const SkColor kGridTitleHoverColor
= kGridTitleColor
;
51 const SkColor kFolderTitleColor
= SkColorSetRGB(0x33, 0x33, 0x33);
52 const SkColor kFolderTitleHintTextColor
= SkColorSetRGB(0xA0, 0xA0, 0xA0);
53 // Color of the folder ink bubble.
54 const SkColor kFolderBubbleColor
= SK_ColorWHITE
;
55 // Color of the folder bubble shadow.
56 const SkColor kFolderShadowColor
= SkColorSetRGB(0xBF, 0xBF, 0xBF);
57 const float kFolderBubbleRadius
= 23;
58 const float kFolderShadowRadius
= 23.5;
59 const float kFolderShadowOffsetY
= 1;
61 const SkColor kCardBackgroundColor
= SK_ColorWHITE
;
63 // Duration in milliseconds for page transition.
64 const int kPageTransitionDurationInMs
= 180;
66 // Duration in milliseconds for over scroll page transition.
67 const int kOverscrollPageTransitionDurationMs
= 50;
69 // Duration in milliseconds for fading in the target page when opening
70 // or closing a folder, and the duration for the top folder icon animation
71 // for flying in or out the folder.
72 const int kFolderTransitionInDurationMs
= 400;
74 // Duration in milliseconds for fading out the old page when opening or closing
76 const int kFolderTransitionOutDurationMs
= 30;
78 // The height of the custom page widget when collapsed on the start page.
79 const int kCustomPageCollapsedHeight
= 78;
81 // Animation curve used for fading in the target page when opening or closing
83 const gfx::Tween::Type kFolderFadeInTweenType
= gfx::Tween::EASE_IN_2
;
85 // Animation curve used for fading out the target page when opening or closing
87 const gfx::Tween::Type kFolderFadeOutTweenType
= gfx::Tween::FAST_OUT_LINEAR_IN
;
89 // Preferred number of columns and rows in apps grid.
90 const int kPreferredCols
= 4;
91 const int kPreferredRows
= 4;
92 const int kGridIconDimension
= 48;
94 // Preferred search result icon sizes.
95 const int kListIconSize
= 24;
96 const int kTileIconSize
= 48;
98 // Preferred number of columns and rows in the centered app list apps grid.
99 const int kCenteredPreferredCols
= 6;
100 const int kCenteredPreferredRows
= 3;
102 // Preferred number of columns and rows in the experimental app list apps grid.
103 const int kExperimentalPreferredCols
= 6;
104 const int kExperimentalPreferredRows
= 4;
106 // Radius of the circle, in which if entered, show re-order preview.
107 const int kReorderDroppingCircleRadius
= 35;
109 // The padding around the outside of the experimental app list apps grid
111 const int kExperimentalAppsGridPadding
= 24;
113 // The padding around the outside of the experimental app list search box (top
115 const int kExperimentalSearchBoxPadding
= 16;
117 // Max items allowed in a folder.
118 size_t kMaxFolderItems
= 16;
120 // Number of the top items in a folder, which are shown inside the folder icon
121 // and animated when opening and closing a folder.
122 const size_t kNumFolderTopItems
= 4;
124 // Maximum length of the folder name in chars.
125 const size_t kMaxFolderNameChars
= 40;
127 // Font style for app item labels.
128 const ui::ResourceBundle::FontStyle kItemTextFontStyle
=
129 ui::ResourceBundle::SmallFont
;
131 #if defined(OS_LINUX)
132 #if defined(GOOGLE_CHROME_BUILD)
133 const char kAppListWMClass
[] = "chrome_app_list";
134 #else // CHROMIUM_BUILD
135 const char kAppListWMClass
[] = "chromium_app_list";
139 gfx::ShadowValue
GetShadowForZHeight(int z_height
) {
141 return gfx::ShadowValue();
145 return gfx::ShadowValue(gfx::Point(0, 1), 2,
146 SkColorSetARGB(0x4C, 0, 0, 0));
148 return gfx::ShadowValue(gfx::Point(0, 2), 4,
149 SkColorSetARGB(0x33, 0, 0, 0));
151 return gfx::ShadowValue(gfx::Point(0, 8), 12,
152 SkColorSetARGB(0x3F, 0, 0, 0));
156 } // namespace app_list