Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(38)

Side by Side Diff: ash/common/shelf/app_list_button.cc

Issue 2527513002: Update ash shelf/tray focus rects. (Closed)
Patch Set: fixes Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/common/shelf/app_list_button.h" 5 #include "ash/common/shelf/app_list_button.h"
6 6
7 #include "ash/common/ash_constants.h" 7 #include "ash/common/ash_constants.h"
8 #include "ash/common/material_design/material_design_controller.h" 8 #include "ash/common/material_design/material_design_controller.h"
9 #include "ash/common/shelf/ink_drop_button_listener.h" 9 #include "ash/common/shelf/ink_drop_button_listener.h"
10 #include "ash/common/shelf/shelf_constants.h" 10 #include "ash/common/shelf/shelf_constants.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 if (ash::MaterialDesignController::IsShelfMaterial()) { 44 if (ash::MaterialDesignController::IsShelfMaterial()) {
45 SetInkDropMode(InkDropMode::ON_NO_GESTURE_HANDLER); 45 SetInkDropMode(InkDropMode::ON_NO_GESTURE_HANDLER);
46 set_ink_drop_base_color(kShelfInkDropBaseColor); 46 set_ink_drop_base_color(kShelfInkDropBaseColor);
47 set_ink_drop_visible_opacity(kShelfInkDropVisibleOpacity); 47 set_ink_drop_visible_opacity(kShelfInkDropVisibleOpacity);
48 } 48 }
49 SetAccessibleName( 49 SetAccessibleName(
50 l10n_util::GetStringUTF16(IDS_ASH_SHELF_APP_LIST_LAUNCHER_TITLE)); 50 l10n_util::GetStringUTF16(IDS_ASH_SHELF_APP_LIST_LAUNCHER_TITLE));
51 SetSize( 51 SetSize(
52 gfx::Size(GetShelfConstant(SHELF_SIZE), GetShelfConstant(SHELF_SIZE))); 52 gfx::Size(GetShelfConstant(SHELF_SIZE), GetShelfConstant(SHELF_SIZE)));
53 SetFocusPainter(views::Painter::CreateSolidFocusPainter( 53 SetFocusPainter(views::Painter::CreateSolidFocusPainter(
54 kFocusBorderColor, gfx::Insets(1, 1, 1, 1))); 54 kFocusBorderColor, kFocusBorderThickness, gfx::InsetsF()));
55 set_notify_action(CustomButton::NOTIFY_ON_PRESS); 55 set_notify_action(CustomButton::NOTIFY_ON_PRESS);
56 } 56 }
57 57
58 AppListButton::~AppListButton() {} 58 AppListButton::~AppListButton() {}
59 59
60 void AppListButton::OnAppListShown() { 60 void AppListButton::OnAppListShown() {
61 if (ash::MaterialDesignController::IsShelfMaterial()) 61 if (ash::MaterialDesignController::IsShelfMaterial())
62 AnimateInkDrop(views::InkDropState::ACTIVATED, nullptr); 62 AnimateInkDrop(views::InkDropState::ACTIVATED, nullptr);
63 else 63 else
64 SchedulePaint(); 64 SchedulePaint();
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 int center = std::max(width(), height()) / 2.f; 289 int center = std::max(width(), height()) / 2.f;
290 gfx::Point centroid(center, center); 290 gfx::Point centroid(center, center);
291 // For the left shelf alignment, we need to right-justify. For other shelf 291 // For the left shelf alignment, we need to right-justify. For other shelf
292 // alignments, left/top justification (i.e. no adjustments are necessary). 292 // alignments, left/top justification (i.e. no adjustments are necessary).
293 if (SHELF_ALIGNMENT_LEFT == wm_shelf_->GetAlignment()) 293 if (SHELF_ALIGNMENT_LEFT == wm_shelf_->GetAlignment())
294 centroid.set_x(width() - center); 294 centroid.set_x(width() - center);
295 return centroid; 295 return centroid;
296 } 296 }
297 297
298 } // namespace ash 298 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698