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 const SkColor kSearchTextColor
= SkColorSetRGB(0x33, 0x33, 0x33);
14 // In Windows, transparent background color will cause ugly text rendering,
15 // therefore kContentsBackgroundColor should be used. See crbug.com/406989
16 #if defined(OS_CHROMEOS)
17 const SkColor kLabelBackgroundColor
= SK_ColorTRANSPARENT
;
19 const SkColor kLabelBackgroundColor
= kContentsBackgroundColor
;
22 const SkColor kTopSeparatorColor
= SkColorSetRGB(0xC0, 0xC0, 0xC0);
23 const SkColor kBottomSeparatorColor
= SkColorSetRGB(0xC0, 0xC0, 0xC0);
25 // The color of the separator used inside dialogs in the app list.
26 const SkColor kDialogSeparatorColor
= SkColorSetRGB(0xD1, 0xD1, 0xD1);
28 // The mouse hover colour (3% black).
29 const SkColor kHighlightedColor
= SkColorSetARGB(8, 0, 0, 0);
30 // The keyboard select colour (6% black).
31 const SkColor kSelectedColor
= SkColorSetARGB(15, 0, 0, 0);
33 const SkColor kPagerHoverColor
= SkColorSetRGB(0xB4, 0xB4, 0xB4);
34 const SkColor kPagerNormalColor
= SkColorSetRGB(0xE2, 0xE2, 0xE2);
35 const SkColor kPagerSelectedColor
= SkColorSetRGB(0x46, 0x8F, 0xFC);
37 const SkColor kResultBorderColor
= SkColorSetRGB(0xE5, 0xE5, 0xE5);
38 const SkColor kResultDefaultTextColor
= SkColorSetRGB(0x33, 0x33, 0x33);
39 const SkColor kResultDimmedTextColor
= SkColorSetRGB(0x84, 0x84, 0x84);
40 const SkColor kResultURLTextColor
= SkColorSetRGB(0x00, 0x99, 0x33);
42 const SkColor kGridTitleColor
= SkColorSetRGB(0x33, 0x33, 0x33);
44 const SkColor kFolderTitleColor
= SkColorSetRGB(0x33, 0x33, 0x33);
45 const SkColor kFolderTitleHintTextColor
= SkColorSetRGB(0xA0, 0xA0, 0xA0);
46 // Color of the folder ink bubble.
47 const SkColor kFolderBubbleColor
= SK_ColorWHITE
;
48 // Color of the folder bubble shadow.
49 const SkColor kFolderShadowColor
= SkColorSetRGB(0xBF, 0xBF, 0xBF);
50 const float kFolderBubbleRadius
= 23;
51 const float kFolderBubbleOffsetY
= 1;
53 const SkColor kCardBackgroundColor
= SK_ColorWHITE
;
55 // Duration in milliseconds for page transition.
56 const int kPageTransitionDurationInMs
= 180;
58 // Duration in milliseconds for over scroll page transition.
59 const int kOverscrollPageTransitionDurationMs
= 50;
61 // Duration in milliseconds for fading in the target page when opening
62 // or closing a folder, and the duration for the top folder icon animation
63 // for flying in or out the folder.
64 const int kFolderTransitionInDurationMs
= 400;
66 // Duration in milliseconds for fading out the old page when opening or closing
68 const int kFolderTransitionOutDurationMs
= 30;
70 // The height of the custom page widget when collapsed on the start page.
71 const int kCustomPageCollapsedHeight
= 78;
73 // Animation curve used for fading in the target page when opening or closing
75 const gfx::Tween::Type kFolderFadeInTweenType
= gfx::Tween::EASE_IN_2
;
77 // Animation curve used for fading out the target page when opening or closing
79 const gfx::Tween::Type kFolderFadeOutTweenType
= gfx::Tween::FAST_OUT_LINEAR_IN
;
81 // Preferred number of columns and rows in apps grid.
82 const int kPreferredCols
= 4;
83 const int kPreferredRows
= 4;
84 const int kGridIconDimension
= 48;
86 // Preferred search result icon sizes.
87 const int kListIconSize
= 24;
88 const int kListBadgeIconSize
= 16;
89 const int kListBadgeIconOffsetX
= 6;
90 const int kListBadgeIconOffsetY
= 6;
91 const int kTileIconSize
= 48;
93 // Preferred number of columns and rows in the centered app list apps grid.
94 const int kCenteredPreferredCols
= 6;
95 const int kCenteredPreferredRows
= 3;
97 // Preferred number of columns and rows in the experimental app list apps grid.
98 const int kExperimentalPreferredCols
= 6;
99 const int kExperimentalPreferredRows
= 4;
101 // Radius of the circle, in which if entered, show re-order preview.
102 const int kReorderDroppingCircleRadius
= 35;
104 // The padding around the outside of the experimental app list apps grid
106 const int kExperimentalAppsGridPadding
= 24;
108 // The padding around the outside of the experimental app list search box (top
110 const int kExperimentalSearchBoxPadding
= 16;
112 // Max items allowed in a folder.
113 size_t kMaxFolderItems
= 16;
115 // Number of the top items in a folder, which are shown inside the folder icon
116 // and animated when opening and closing a folder.
117 const size_t kNumFolderTopItems
= 4;
119 // Maximum length of the folder name in chars.
120 const size_t kMaxFolderNameChars
= 40;
122 // Font style for app item labels.
123 const ui::ResourceBundle::FontStyle kItemTextFontStyle
=
124 ui::ResourceBundle::SmallFont
;
126 // The UMA histogram that logs which page gets opened by the user.
127 const char kPageOpenedHistogram
[] = "Apps.AppListPageOpened";
129 // The UMA histogram that logs the type of search result opened.
130 const char kSearchResultOpenDisplayTypeHistogram
[] =
131 "Apps.AppListSearchResultOpenDisplayType";
133 // The UMA histogram that logs how long the search query was when a result was
135 const char kSearchQueryLength
[] = "Apps.AppListSearchQueryLength";
137 // The UMA histogram that logs the Manhattan distance from the origin of the
138 // search results to the selected result.
139 const char kSearchResultDistanceFromOrigin
[] =
140 "Apps.AppListSearchResultDistanceFromOrigin";
142 #if defined(OS_LINUX)
143 #if defined(GOOGLE_CHROME_BUILD)
144 const char kAppListWMClass
[] = "chrome_app_list";
145 #else // CHROMIUM_BUILD
146 const char kAppListWMClass
[] = "chromium_app_list";
150 gfx::ShadowValue
GetShadowForZHeight(int z_height
) {
152 return gfx::ShadowValue();
156 return gfx::ShadowValue(gfx::Vector2d(0, 1), 2,
157 SkColorSetARGB(0x4C, 0, 0, 0));
159 return gfx::ShadowValue(gfx::Vector2d(0, 2), 4,
160 SkColorSetARGB(0x33, 0, 0, 0));
162 return gfx::ShadowValue(gfx::Vector2d(0, 8), 12,
163 SkColorSetARGB(0x3F, 0, 0, 0));
167 const gfx::ShadowValues
& IconStartShadows() {
168 CR_DEFINE_STATIC_LOCAL(const gfx::ShadowValues
, icon_shadows
,
169 (1, gfx::ShadowValue(gfx::Vector2d(0, 1), 2,
170 SkColorSetARGB(0x33, 0, 0, 0))));
174 const gfx::ShadowValues
& IconEndShadows() {
175 CR_DEFINE_STATIC_LOCAL(const gfx::ShadowValues
, icon_shadows
,
176 (1, gfx::ShadowValue(gfx::Vector2d(0, 4), 4,
177 SkColorSetARGB(0x50, 0, 0, 0))));
181 } // namespace app_list