OLD | NEW |
1 <link rel="import" href="chrome://resources/html/polymer.html"> | 1 <link rel="import" href="chrome://resources/html/polymer.html"> |
2 <link rel="import" href="chrome://resources/polymer/v1_0/iron-media-query/iron-m
edia-query.html"> | 2 <link rel="import" href="chrome://resources/polymer/v1_0/iron-media-query/iron-m
edia-query.html"> |
3 <link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper
-icon-button.html"> | 3 <link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper
-icon-button.html"> |
4 <link rel="import" href="chrome://resources/cr_elements/cr_toolbar/cr_toolbar_se
arch_field.html"> | 4 <link rel="import" href="chrome://resources/cr_elements/cr_toolbar/cr_toolbar_se
arch_field.html"> |
5 | 5 |
6 <dom-module id="cr-toolbar"> | 6 <dom-module id="cr-toolbar"> |
7 <template> | 7 <template> |
8 <style> | 8 <style> |
9 :host { | 9 :host { |
10 --cr-toolbar-field-width: 580px; | 10 --cr-toolbar-field-width: 580px; |
| 11 --cr-toolbar-height: 56px; |
11 color: #fff; | 12 color: #fff; |
12 display: flex; | 13 display: flex; |
13 height: 56px; | 14 height: var(--cr-toolbar-height); |
14 } | 15 } |
15 | 16 |
16 h1 { | 17 h1 { |
17 -webkit-margin-start: 6px; | 18 -webkit-margin-start: 6px; |
18 flex: 1; | 19 flex: 1; |
19 font-size: 123%; | 20 font-size: 123%; |
20 font-weight: 400; | 21 font-weight: 400; |
21 text-overflow: ellipsis; | 22 text-overflow: ellipsis; |
22 overflow: hidden; | 23 overflow: hidden; |
23 white-space: nowrap; | 24 white-space: nowrap; |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 @apply(--cr-toolbar-right-content-wide); | 65 @apply(--cr-toolbar-right-content-wide); |
65 } | 66 } |
66 | 67 |
67 :host([narrow_]) #centeredContent { | 68 :host([narrow_]) #centeredContent { |
68 justify-content: flex-end; | 69 justify-content: flex-end; |
69 } | 70 } |
70 | 71 |
71 :host([narrow_][showing-search_]) #leftContent { | 72 :host([narrow_][showing-search_]) #leftContent { |
72 opacity: 0; | 73 opacity: 0; |
73 } | 74 } |
| 75 |
| 76 #menuPromo { |
| 77 -webkit-padding-end: 12px; |
| 78 -webkit-padding-start: 8px; |
| 79 align-items: center; |
| 80 background: #616161; |
| 81 border-radius: 2px; |
| 82 color: white; |
| 83 display: flex; |
| 84 font-size: 92.3%; |
| 85 font-weight: 500; |
| 86 opacity: 0; |
| 87 padding-bottom: 6px; |
| 88 padding-top: 6px; |
| 89 position: absolute; |
| 90 top: var(--cr-toolbar-height); |
| 91 white-space: nowrap; |
| 92 z-index: 2; |
| 93 } |
| 94 |
| 95 #menuPromo::before { |
| 96 background: inherit; |
| 97 /* Up arrow. 105% in Y coordinates fixes glitch at 110/125% zoom. */ |
| 98 clip-path: polygon(0 105%, 100% 105%, 50% 0); |
| 99 content: ''; |
| 100 display: block; |
| 101 left: 10px; |
| 102 height: 6px; |
| 103 position: absolute; |
| 104 top: -6px; |
| 105 width: 12px; |
| 106 } |
| 107 |
| 108 :host-context([dir=rtl]) #menuPromo::before { |
| 109 left: auto; |
| 110 right: 10px; |
| 111 } |
| 112 |
| 113 #closePromo { |
| 114 -webkit-appearance: none; |
| 115 -webkit-margin-start: 12px; |
| 116 background: none; |
| 117 border: none; |
| 118 color: inherit; |
| 119 font-size: 20px; /* Shouldn't change if default font-size changes. */ |
| 120 line-height: 20px; |
| 121 padding: 0; |
| 122 width: 20px; |
| 123 } |
74 </style> | 124 </style> |
75 <div id="leftContent"> | 125 <div id="leftContent"> |
76 <template is="dom-if" if="[[showMenu]]"> | 126 <!-- Note: showing #menuPromo relies on this dom-if being [restamp]. --> |
| 127 <template is="dom-if" if="[[showMenu]]" restamp> |
77 <paper-icon-button id="menuButton" icon="cr:menu" on-tap="onMenuTap_" | 128 <paper-icon-button id="menuButton" icon="cr:menu" on-tap="onMenuTap_" |
78 title="[[menuLabel]]"> | 129 title="[[titleIfNotShowMenuPromo_(menuLabel, showMenuPromo)]]" |
| 130 aria-label$="[[menuLabel]]"> |
79 </paper-icon-button> | 131 </paper-icon-button> |
| 132 <template is="dom-if" if="[[showMenuPromo]]"> |
| 133 <div id="menuPromo" role="tooltip"> |
| 134 [[menuPromo]] |
| 135 <button id="closePromo" on-tap="onClosePromoTap_" |
| 136 aria-label$="[[closeMenuPromo]]">✕</button> |
| 137 </paper-tooltip> |
| 138 </template> |
80 </template> | 139 </template> |
81 <h1>[[pageName]]</h1> | 140 <h1>[[pageName]]</h1> |
82 </div> | 141 </div> |
83 | 142 |
84 <div id="centeredContent"> | 143 <div id="centeredContent"> |
85 <cr-toolbar-search-field id="search" narrow="[[narrow_]]" | 144 <cr-toolbar-search-field id="search" narrow="[[narrow_]]" |
86 label="[[searchPrompt]]" clear-label="[[clearLabel]]" | 145 label="[[searchPrompt]]" clear-label="[[clearLabel]]" |
87 spinner-active="[[spinnerActive]]" | 146 spinner-active="[[spinnerActive]]" |
88 showing-search="{{showingSearch_}}"> | 147 showing-search="{{showingSearch_}}"> |
89 </cr-toolbar-search-field> | 148 </cr-toolbar-search-field> |
90 <iron-media-query query="(max-width: 900px)" query-matches="{{narrow_}}"> | 149 <iron-media-query query="(max-width: 900px)" query-matches="{{narrow_}}"> |
91 </iron-media-query> | 150 </iron-media-query> |
92 </div> | 151 </div> |
93 | 152 |
94 <div id="rightContent"> | 153 <div id="rightContent"> |
95 <content select=".more-actions"></content> | 154 <content select=".more-actions"></content> |
96 </div> | 155 </div> |
97 </template> | 156 </template> |
98 <script src="cr_toolbar.js"></script> | 157 <script src="cr_toolbar.js"></script> |
99 </dom-module> | 158 </dom-module> |
OLD | NEW |