Commit a861123b authored by tsergeant's avatar tsergeant Committed by Commit bot

MD History: Make icons in history-toolbar consistent.

This switches the icons to paper-icon-button-light, using the same
styling as elsewhere on the page. This doesn't actually improve page
load time, since all of these buttons are behind dom-ifs. It does,
however, simplify the CSS and make the Grouped mode buttons match the
mocks.

BUG=589357
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation

Review-Url: https://codereview.chromium.org/2346383004
Cr-Commit-Position: refs/heads/master@{#437972}
parent 0b08dd3f
<link rel="import" href="chrome://resources/html/polymer.html"> <link rel="import" href="chrome://resources/html/polymer.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-icon/iron-icon.html"> <link rel="import" href="chrome://resources/polymer/v1_0/iron-icon/iron-icon.html">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper-icon-button.html">
<link rel="import" href="chrome://resources/cr_elements/icons.html"> <link rel="import" href="chrome://resources/cr_elements/icons.html">
<link rel="import" href="chrome://resources/cr_elements/cr_lazy_render/cr_lazy_render.html"> <link rel="import" href="chrome://resources/cr_elements/cr_lazy_render/cr_lazy_render.html">
<link rel="import" href="chrome://resources/cr_elements/cr_toolbar/cr_toolbar.html"> <link rel="import" href="chrome://resources/cr_elements/cr_toolbar/cr_toolbar.html">
...@@ -21,6 +20,8 @@ ...@@ -21,6 +20,8 @@
width: 100%; width: 100%;
} }
/* General toolbar layout. */
cr-toolbar, cr-toolbar,
#overlay-buttons, #overlay-buttons,
#overlay-wrapper, #overlay-wrapper,
...@@ -62,6 +63,8 @@ ...@@ -62,6 +63,8 @@
-webkit-margin-end: 12px; -webkit-margin-end: 12px;
} }
/* Info button and dropdown. */
#info-button { #info-button {
/* Additional styles for unresolved <button>. */ /* Additional styles for unresolved <button>. */
background: none; background: none;
...@@ -92,6 +95,8 @@ ...@@ -92,6 +95,8 @@
padding: 12px 20px; padding: 12px 20px;
} }
/* Selection overlay. */
:host(:not([has-drawer])) #overlay-wrapper { :host(:not([has-drawer])) #overlay-wrapper {
-webkit-margin-start: var(--side-bar-width); -webkit-margin-start: var(--side-bar-width);
} }
...@@ -113,15 +118,16 @@ ...@@ -113,15 +118,16 @@
#cancel-icon-button { #cancel-icon-button {
-webkit-margin-end: 24px; -webkit-margin-end: 24px;
-webkit-margin-start: 2px; -webkit-margin-start: 2px;
height: 36px;
min-width: 36px;
width: 36px;
} }
#grouped-nav-container paper-icon-button { /* Grouped toolbar. */
--paper-icon-button-ink-color: rgba(255, 255, 255, 0.4);
-webkit-margin-start: 24px; paper-tabs {
flex: 0 0 auto; /* TODO(tsergeant): Align tabs with cards. */
--paper-tabs-selection-bar-color: #fff;
-webkit-margin-start: 32px;
height: calc(var(--toolbar-grouped-height) - var(--toolbar-height));
min-width: 300px;
} }
paper-tab { paper-tab {
...@@ -130,23 +136,13 @@ ...@@ -130,23 +136,13 @@
text-transform: uppercase; text-transform: uppercase;
} }
paper-tabs {
--paper-tabs-selection-bar-color: var(--google-blue-500);
height: calc(var(--toolbar-grouped-height) - var(--toolbar-height));
min-width: 300px;
}
#grouped-buttons-container { #grouped-buttons-container {
align-items: center; align-items: center;
display: flex; display: flex;
} }
#grouped-range-buttons {
-webkit-margin-start: 32px;
}
#grouped-nav-container { #grouped-nav-container {
-webkit-margin-end: 24px; -webkit-margin-end: 16px;
align-items: center; align-items: center;
display: flex; display: flex;
flex: 1; flex: 1;
...@@ -161,6 +157,7 @@ ...@@ -161,6 +157,7 @@
} }
#grouped-date { #grouped-date {
-webkit-margin-end: 8px;
flex: 0 1 auto; flex: 0 1 auto;
opacity: 0.7; opacity: 0.7;
overflow: hidden; overflow: hidden;
...@@ -169,6 +166,15 @@ ...@@ -169,6 +166,15 @@
white-space: nowrap; white-space: nowrap;
} }
#grouped-nav-container button {
-webkit-margin-start: 8px;
flex: 0 0 auto;
}
#grouped-nav-container button[disabled] {
color: rgba(255, 255, 255, 0.5);
}
:host-context([dir=rtl]) .rtl-reversible { :host-context([dir=rtl]) .rtl-reversible {
transform: rotate(180deg); transform: rotate(180deg);
} }
...@@ -208,9 +214,13 @@ ...@@ -208,9 +214,13 @@
<template is="dom-if" if="[[itemsSelected_]]"> <template is="dom-if" if="[[itemsSelected_]]">
<div id="overlay-wrapper" hidden$="[[!itemsSelected_]]"> <div id="overlay-wrapper" hidden$="[[!itemsSelected_]]">
<div id="overlay-buttons"> <div id="overlay-buttons">
<paper-icon-button icon="cr:clear" id="cancel-icon-button" <button is="paper-icon-button-light"
on-tap="onClearSelectionTap_" title="$i18n{cancel}"> id="cancel-icon-button"
</paper-icon-button> class="icon-button"
on-tap="onClearSelectionTap_"
title="$i18n{cancel}">
<iron-icon icon="cr:clear"></iron-icon>
</button>
<div id="number-selected">[[numberOfItemsSelected_(count)]]</div> <div id="number-selected">[[numberOfItemsSelected_(count)]]</div>
<paper-button id="cancel-button" on-tap="onClearSelectionTap_"> <paper-button id="cancel-button" on-tap="onClearSelectionTap_">
$i18n{cancel} $i18n{cancel}
...@@ -224,8 +234,7 @@ ...@@ -224,8 +234,7 @@
</div> </div>
<template is="dom-if" if="[[isGroupedMode]]"> <template is="dom-if" if="[[isGroupedMode]]">
<div id="grouped-buttons-container"> <div id="grouped-buttons-container">
<paper-tabs attr-for-selected="value" selected="{{groupedRange}}" <paper-tabs attr-for-selected="value" selected="{{groupedRange}}">
id="grouped-range-buttons">
<paper-tab value="0">$i18n{rangeAllTime}</paper-tab> <paper-tab value="0">$i18n{rangeAllTime}</paper-tab>
<paper-tab value="1">$i18n{rangeWeek}</paper-tab> <paper-tab value="1">$i18n{rangeWeek}</paper-tab>
<paper-tab value="2">$i18n{rangeMonth}</paper-tab> <paper-tab value="2">$i18n{rangeMonth}</paper-tab>
...@@ -234,23 +243,30 @@ ...@@ -234,23 +243,30 @@
<span id="grouped-date"> <span id="grouped-date">
{{getHistoryInterval_(queryStartTime, queryEndTime)}} {{getHistoryInterval_(queryStartTime, queryEndTime)}}
</span> </span>
<paper-icon-button id="today-button" icon="history:today" <button is="paper-icon-button-light"
alt="$i18n{rangeToday}" id="today-button"
class="icon-button"
title="$i18n{rangeToday}" title="$i18n{rangeToday}"
on-tap="onTodayTap_" on-tap="onTodayTap_"
disabled="[[isToday_(groupedOffset)]]"></paper-icon-button> disabled="[[isToday_(groupedOffset)]]">
<paper-icon-button id="prev-button" icon="history:chevron-left" <iron-icon icon="history:today"></iron-icon>
alt="$i18n{rangePrevious}" </button>
<button is="paper-icon-button-light"
id="prev-button"
title="$i18n{rangePrevious}" title="$i18n{rangePrevious}"
class="rtl-reversible" class="icon-button rtl-reversible"
on-tap="onPrevTap_" on-tap="onPrevTap_"
disabled="[[!hasMoreResults]]"></paper-icon-button> disabled="[[!hasMoreResults]]">
<paper-icon-button id="next-button" icon="cr:chevron-right" <iron-icon icon="history:chevron-left"></iron-icon>
alt="$i18n{rangeNext}" </button>
<button is="paper-icon-button-light"
id="next-button"
title="$i18n{rangeNext}" title="$i18n{rangeNext}"
class="rtl-reversible" class="icon-button rtl-reversible"
on-tap="onNextTap_" on-tap="onNextTap_"
disabled="[[isToday_(groupedOffset)]]"></paper-icon-button> disabled="[[isToday_(groupedOffset)]]">
<iron-icon icon="cr:chevron-right"></iron-icon>
</button>
</div> </div>
</div> </div>
</template> </template>
......
...@@ -107,8 +107,7 @@ button.icon-button { ...@@ -107,8 +107,7 @@ button.icon-button {
} }
button.icon-button iron-icon { button.icon-button iron-icon {
color: var(--secondary-text-color); height: 20px;
height: 20px;
width: 20px; width: 20px;
} }
...@@ -658,8 +657,7 @@ button.icon-button { ...@@ -658,8 +657,7 @@ button.icon-button {
} }
button.icon-button iron-icon { button.icon-button iron-icon {
color: var(--secondary-text-color); height: 20px;
height: 20px;
width: 20px; width: 20px;
} }
...@@ -711,6 +709,7 @@ button.more-vert-button div { ...@@ -711,6 +709,7 @@ button.more-vert-button div {
#right-buttons { #right-buttons {
-webkit-margin-end: 4px; -webkit-margin-end: 4px;
color: var(--secondary-text-color);
} }
#menu-button { #menu-button {
...@@ -845,8 +844,7 @@ button.icon-button { ...@@ -845,8 +844,7 @@ button.icon-button {
} }
button.icon-button iron-icon { button.icon-button iron-icon {
color: var(--secondary-text-color); height: 20px;
height: 20px;
width: 20px; width: 20px;
} }
......
...@@ -66,7 +66,6 @@ ...@@ -66,7 +66,6 @@
} }
button.icon-button iron-icon { button.icon-button iron-icon {
color: var(--secondary-text-color);
height: 20px; height: 20px;
width: 20px; width: 20px;
} }
......
...@@ -48,6 +48,7 @@ ...@@ -48,6 +48,7 @@
#right-buttons { #right-buttons {
-webkit-margin-end: 4px; -webkit-margin-end: 4px;
color: var(--secondary-text-color);
} }
#menu-button { #menu-button {
......
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