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

Side by Side Diff: ash/common/system/chromeos/palette/palette_tray.cc

Issue 2269383002: Magnifier border is now more visible on light backgrounds. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Created 4 years, 4 months 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/system/chromeos/palette/palette_tray.h" 5 #include "ash/common/system/chromeos/palette/palette_tray.h"
6 6
7 #include "ash/common/shelf/shelf_constants.h" 7 #include "ash/common/shelf/shelf_constants.h"
8 #include "ash/common/shelf/wm_shelf.h" 8 #include "ash/common/shelf/wm_shelf.h"
9 #include "ash/common/shelf/wm_shelf_util.h" 9 #include "ash/common/shelf/wm_shelf_util.h"
10 #include "ash/common/shell_window_ids.h" 10 #include "ash/common/shell_window_ids.h"
(...skipping 25 matching lines...) Expand all
36 // Predefined padding for the icon used in this tray. These are to be set to the 36 // Predefined padding for the icon used in this tray. These are to be set to the
37 // border of the icon, depending on the current |shelf_alignment()|. 37 // border of the icon, depending on the current |shelf_alignment()|.
38 const int kHorizontalShelfHorizontalPadding = 8; 38 const int kHorizontalShelfHorizontalPadding = 8;
39 const int kHorizontalShelfVerticalPadding = 4; 39 const int kHorizontalShelfVerticalPadding = 4;
40 const int kVerticalShelfHorizontalPadding = 2; 40 const int kVerticalShelfHorizontalPadding = 2;
41 const int kVerticalShelfVerticalPadding = 5; 41 const int kVerticalShelfVerticalPadding = 5;
42 42
43 // Width of the palette itself (dp). 43 // Width of the palette itself (dp).
44 const int kPaletteWidth = 360; 44 const int kPaletteWidth = 360;
45 45
46 // Size of icon in the shelf (dp).
47 const int kShelfIconSize = 18;
48
46 // Creates a separator. 49 // Creates a separator.
47 views::Separator* CreateSeparator(views::Separator::Orientation orientation) { 50 views::Separator* CreateSeparator(views::Separator::Orientation orientation) {
48 const int kSeparatorInset = 10; 51 const int kSeparatorInset = 10;
49 52
50 views::Separator* separator = 53 views::Separator* separator =
51 new views::Separator(views::Separator::HORIZONTAL); 54 new views::Separator(views::Separator::HORIZONTAL);
52 separator->SetColor(ash::kBorderDarkColor); 55 separator->SetColor(ash::kBorderDarkColor);
53 separator->SetBorder( 56 separator->SetBorder(
54 views::Border::CreateEmptyBorder(kSeparatorInset, 0, kSeparatorInset, 0)); 57 views::Border::CreateEmptyBorder(kSeparatorInset, 0, kSeparatorInset, 0));
55 return separator; 58 return separator;
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 kHorizontalShelfVerticalPadding, kHorizontalShelfHorizontalPadding))); 301 kHorizontalShelfVerticalPadding, kHorizontalShelfHorizontalPadding)));
299 } else { 302 } else {
300 icon_->SetBorder(views::Border::CreateEmptyBorder(gfx::Insets( 303 icon_->SetBorder(views::Border::CreateEmptyBorder(gfx::Insets(
301 kVerticalShelfVerticalPadding, kVerticalShelfHorizontalPadding))); 304 kVerticalShelfVerticalPadding, kVerticalShelfHorizontalPadding)));
302 } 305 }
303 } 306 }
304 307
305 void PaletteTray::UpdateTrayIcon() { 308 void PaletteTray::UpdateTrayIcon() {
306 gfx::VectorIconId icon = palette_tool_manager_->GetActiveTrayIcon( 309 gfx::VectorIconId icon = palette_tool_manager_->GetActiveTrayIcon(
307 palette_tool_manager_->GetActiveTool(ash::PaletteGroup::MODE)); 310 palette_tool_manager_->GetActiveTool(ash::PaletteGroup::MODE));
308 icon_->SetImage(CreateVectorIcon(icon, kShelfIconColor)); 311 icon_->SetImage(CreateVectorIcon(icon, kShelfIconSize, kShelfIconColor));
309 } 312 }
310 313
311 void PaletteTray::UpdateIconVisibility() { 314 void PaletteTray::UpdateIconVisibility() {
312 if (!IsPaletteEnabled()) 315 if (!IsPaletteEnabled())
313 return; 316 return;
314 317
315 SessionStateDelegate* session_state_delegate = 318 SessionStateDelegate* session_state_delegate =
316 WmShell::Get()->GetSessionStateDelegate(); 319 WmShell::Get()->GetSessionStateDelegate();
317 320
318 SetVisible(!session_state_delegate->IsScreenLocked() && 321 SetVisible(!session_state_delegate->IsScreenLocked() &&
319 session_state_delegate->GetSessionState() == 322 session_state_delegate->GetSessionState() ==
320 SessionStateDelegate::SESSION_STATE_ACTIVE && 323 SessionStateDelegate::SESSION_STATE_ACTIVE &&
321 WmShell::Get()->system_tray_delegate()->GetUserLoginStatus() != 324 WmShell::Get()->system_tray_delegate()->GetUserLoginStatus() !=
322 LoginStatus::KIOSK_APP); 325 LoginStatus::KIOSK_APP);
323 } 326 }
324 327
325 } // namespace ash 328 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698