Commit 11072c16 authored by jdufault's avatar jdufault Committed by Commit bot

Reland cros: Small visual tweaks for material design palette.

Original patch got reverted due to compile error.

BUG=678034

Review-Url: https://codereview.chromium.org/2615263002
Cr-Commit-Position: refs/heads/master@{#442056}
parent ab578c9b
...@@ -89,8 +89,7 @@ views::View* CommonPaletteTool::CreateDefaultView(const base::string16& name) { ...@@ -89,8 +89,7 @@ views::View* CommonPaletteTool::CreateDefaultView(const base::string16& name) {
kMenuIconSize, gfx::kGoogleGreen700); kMenuIconSize, gfx::kGoogleGreen700);
highlight_view_ = new HoverHighlightView(this); highlight_view_ = new HoverHighlightView(this);
highlight_view_->SetBorder( highlight_view_->SetBorder(views::CreateEmptyBorder(0, 0, 0, 0));
views::CreateEmptyBorder(0, kMenuExtraMarginFromLeftEdge, 0, 0));
const int interior_button_padding = (kMenuButtonSize - kMenuIconSize) / 2; const int interior_button_padding = (kMenuButtonSize - kMenuIconSize) / 2;
highlight_view_->AddIconAndLabelCustomSize(icon, name, false, kMenuIconSize, highlight_view_->AddIconAndLabelCustomSize(icon, name, false, kMenuIconSize,
interior_button_padding, interior_button_padding,
......
...@@ -45,31 +45,21 @@ namespace { ...@@ -45,31 +45,21 @@ namespace {
// Predefined padding for the icon used in this tray. These are to be set to the // Predefined padding for the icon used in this tray. These are to be set to the
// border of the icon, depending on the current |shelf_alignment()|. // border of the icon, depending on the current |shelf_alignment()|.
const int kHorizontalShelfHorizontalPadding = 8; constexpr int kHorizontalShelfHorizontalPadding = 8;
const int kHorizontalShelfVerticalPadding = 4; constexpr int kHorizontalShelfVerticalPadding = 4;
const int kVerticalShelfHorizontalPadding = 2; constexpr int kVerticalShelfHorizontalPadding = 2;
const int kVerticalShelfVerticalPadding = 5; constexpr int kVerticalShelfVerticalPadding = 5;
// Width of the palette itself (dp). // Width of the palette itself (dp).
const int kPaletteWidth = 332; constexpr int kPaletteWidth = 332;
// Padding at the top/bottom of the palette (dp). // Padding at the top/bottom of the palette (dp).
const int kPalettePaddingOnTop = 4; constexpr int kPalettePaddingOnTop = 4;
const int kPalettePaddingOnBottom = 4; constexpr int kPalettePaddingOnBottom = 2;
// Size of icon in the shelf (dp).
const int kShelfIconSize = 18;
// Vertical margin around the title view elements so that the title view height
// matches kMenuButtonSize.
const int kVerticalMarginAroundTitleView = 1;
// Margins between the title view and the edges around it (dp). // Margins between the title view and the edges around it (dp).
const int kPaddingBetweenTitleAndLeftEdge = 12; constexpr int kPaddingBetweenTitleAndLeftEdge = 12;
const int kPaddingBetweenTitleAndSeparator = 3; constexpr int kPaddingBetweenTitleAndSeparator = 3;
// The distance between the title, help, and settings button in the title (dp).
const int kHorizontalPaddingBetweenTitleEntries = 2;
// Color of the separator. // Color of the separator.
const SkColor kPaletteSeparatorColor = SkColorSetARGB(0x1E, 0x00, 0x00, 0x00); const SkColor kPaletteSeparatorColor = SkColorSetARGB(0x1E, 0x00, 0x00, 0x00);
...@@ -90,9 +80,8 @@ class TitleView : public views::View, public views::ButtonListener { ...@@ -90,9 +80,8 @@ class TitleView : public views::View, public views::ButtonListener {
explicit TitleView(PaletteTray* palette_tray) : palette_tray_(palette_tray) { explicit TitleView(PaletteTray* palette_tray) : palette_tray_(palette_tray) {
// TODO(tdanderson|jdufault): Use TriView to handle the layout of the title. // TODO(tdanderson|jdufault): Use TriView to handle the layout of the title.
// See crbug.com/614453. // See crbug.com/614453.
auto* box_layout = new views::BoxLayout( auto* box_layout =
views::BoxLayout::kHorizontal, 0, kVerticalMarginAroundTitleView, new views::BoxLayout(views::BoxLayout::kHorizontal, 0, 0, 0);
kHorizontalPaddingBetweenTitleEntries);
SetLayoutManager(box_layout); SetLayoutManager(box_layout);
title_label_ = title_label_ =
...@@ -431,7 +420,7 @@ void PaletteTray::UpdateTrayIcon() { ...@@ -431,7 +420,7 @@ void PaletteTray::UpdateTrayIcon() {
icon_->SetImage(CreateVectorIcon( icon_->SetImage(CreateVectorIcon(
palette_tool_manager_->GetActiveTrayIcon( palette_tool_manager_->GetActiveTrayIcon(
palette_tool_manager_->GetActiveTool(ash::PaletteGroup::MODE)), palette_tool_manager_->GetActiveTool(ash::PaletteGroup::MODE)),
kShelfIconSize, kShelfIconColor)); kTrayIconSize, kShelfIconColor));
} }
void PaletteTray::OnStylusStateChanged(ui::StylusState stylus_state) { void PaletteTray::OnStylusStateChanged(ui::StylusState stylus_state) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment