Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 <link rel="import" href="chrome://resources/cr_elements/icons.html"> | 1 <link rel="import" href="chrome://resources/cr_elements/icons.html"> |
| 2 <link rel="import" href="chrome://resources/html/action_link.html"> | |
|
Dan Beam
2017/02/06 17:28:12
you haven't imported action_link_css.html
but we
hcarmona
2017/02/10 19:27:34
Done.
| |
| 2 <link rel="import" href="chrome://resources/html/assert.html"> | 3 <link rel="import" href="chrome://resources/html/assert.html"> |
| 3 <link rel="import" href="chrome://resources/html/polymer.html"> | 4 <link rel="import" href="chrome://resources/html/polymer.html"> |
| 4 <link rel="import" href="chrome://resources/polymer/v1_0/iron-icon/iron-icon.htm l"> | 5 <link rel="import" href="chrome://resources/polymer/v1_0/iron-icon/iron-icon.htm l"> |
| 5 <link rel="import" href="chrome://resources/polymer/v1_0/paper-menu/paper-menu.h tml"> | 6 <link rel="import" href="chrome://resources/polymer/v1_0/paper-menu/paper-menu.h tml"> |
| 6 <link rel="import" href="chrome://resources/polymer/v1_0/paper-menu/paper-submen u.html"> | 7 <link rel="import" href="chrome://resources/polymer/v1_0/paper-menu/paper-submen u.html"> |
| 7 <link rel="import" href="chrome://resources/polymer/v1_0/paper-ripple/paper-ripp le.html"> | 8 <link rel="import" href="chrome://resources/polymer/v1_0/paper-ripple/paper-ripp le.html"> |
| 8 <link rel="import" href="../icons.html"> | 9 <link rel="import" href="../icons.html"> |
| 9 <link rel="import" href="../route.html"> | 10 <link rel="import" href="../route.html"> |
| 10 <link rel="import" href="../settings_shared_css.html"> | 11 <link rel="import" href="../settings_shared_css.html"> |
| 11 | 12 |
| 12 <dom-module id="settings-menu"> | 13 <dom-module id="settings-menu"> |
| 13 <template> | 14 <template> |
| 14 <style include="settings-shared"> | 15 <style include="settings-shared"> |
| 15 #about-menu[about-selected] { | 16 #about-menu[about-selected] { |
| 16 color: var(--google-blue-700); | 17 color: var(--google-blue-700); |
| 17 } | 18 } |
| 18 | 19 |
| 19 iron-icon { | 20 iron-icon { |
| 20 --iron-icon-fill-color: var(--settings-nav-grey); | 21 --iron-icon-fill-color: var(--settings-nav-grey); |
| 21 -webkit-margin-end: 24px; | 22 -webkit-margin-end: 24px; |
| 23 padding-top: 10px; /* Center the 20px icon in a 40px space. */ | |
| 22 } | 24 } |
| 23 | 25 |
| 24 .iron-selected:not(.menu-trigger) > iron-icon { | 26 .iron-selected:not(.menu-trigger) > iron-icon { |
| 25 fill: var(--google-blue-700); | 27 fill: var(--google-blue-700); |
| 26 } | 28 } |
| 27 | 29 |
| 28 .menu-trigger span { | 30 .menu-trigger iron-icon { |
| 31 -webkit-margin-end: 22px; /* 24px - 2px from margin for outline. */ | |
| 32 } | |
| 33 | |
| 34 a[is='action-link'] span { | |
| 29 -webkit-margin-end: 16px; | 35 -webkit-margin-end: 16px; |
| 30 flex: 1; | 36 flex: 1; |
| 31 } | 37 } |
| 32 | 38 |
| 33 paper-menu { | 39 paper-menu { |
| 34 --paper-menu-selected-item: { | 40 padding: 0; |
| 35 font-weight: 500; | 41 } |
| 42 | |
| 43 a[is='action-link'].no-outline { | |
|
Dan Beam
2017/02/06 17:28:12
you shouldn't need this now that scottchen@ fixed
hcarmona
2017/02/10 19:27:34
Done.
| |
| 44 --paper-menu-focused-item: { | |
| 45 outline: none; | |
| 46 }; | |
| 47 } | |
| 48 | |
| 49 a[is='action-link'] { | |
| 50 @apply(--settings-actionable); | |
| 51 --paper-menu-focused-item: { | |
| 52 outline: auto 5px -webkit-focus-ring-color; | |
| 36 }; | 53 }; |
| 37 --paper-menu-focused-item-after: { | 54 --paper-menu-focused-item-after: { |
| 38 background: none; | 55 background: none; |
| 39 }; | 56 }; |
| 57 -webkit-margin-end: 2px; /* Margin so selected outline is visible. */ | |
| 58 -webkit-margin-start: 1px; | |
| 40 color: var(--settings-nav-grey); | 59 color: var(--settings-nav-grey); |
| 41 font-size: 100%; | 60 display: flex; |
| 42 padding: 0; | 61 padding: 0; |
| 43 } | 62 position: relative; /* Needed for paper-ripple. */ |
| 44 | |
| 45 div[data-path] { | |
| 46 @apply(--settings-actionable); | |
| 47 } | 63 } |
| 48 | 64 |
| 49 #basicPage { | 65 #basicPage { |
| 50 margin-top: 8px; | 66 margin-top: 8px; |
| 51 } | 67 } |
| 52 | 68 |
| 53 .page-menu > div { | 69 .page-menu > a[is='action-link'] { |
| 70 -webkit-padding-end: 0; | |
| 54 margin-top: 8px; | 71 margin-top: 8px; |
| 55 } | 72 } |
| 56 | 73 |
| 57 .page-menu { | |
| 58 --paper-menu-selected-item: { | |
| 59 font-weight: 500; | |
| 60 }; | |
| 61 } | |
| 62 | |
| 63 paper-menu div { | |
| 64 position: relative; /* Needed for paper-ripple. */ | |
| 65 } | |
| 66 | |
| 67 paper-ripple { | 74 paper-ripple { |
| 68 color: var(--google-blue-700); | 75 color: var(--google-blue-700); |
| 69 opacity: .5; | 76 opacity: .5; |
| 70 } | 77 } |
| 71 | 78 |
| 72 .page-menu paper-menu { | 79 .page-menu paper-menu { |
| 73 --paper-menu-selected-item: { | 80 --paper-menu-selected-item: { |
| 74 color: var(--google-blue-700); | 81 color: var(--google-blue-700); |
| 75 font-weight: 500; | 82 font-weight: 500; |
| 76 }; | 83 }; |
| 77 } | 84 } |
| 78 | 85 |
| 79 .page-menu div { | 86 .page-menu a[is='action-link'] { |
| 80 -webkit-padding-start: 24px; | 87 -webkit-padding-start: 23px; /* 24px - 1px from margin for outline. */ |
| 81 align-items: center; | |
| 82 display: flex; | |
| 83 font-size: 100%; | 88 font-size: 100%; |
| 84 font-weight: 500; | 89 font-weight: 500; |
| 85 min-height: 40px; | 90 line-height: 40px; |
|
dschuyler
2017/02/02 20:46:53
Will this scale well with super large fonts?
hcarmona
2017/02/10 19:27:34
Updated, no more line-height.
| |
| 91 text-transform: none; | |
| 86 word-break: break-word; | 92 word-break: break-word; |
| 87 } | 93 } |
| 88 | 94 |
| 89 .page-menu div iron-icon { | |
| 90 flex-shrink: 0; | |
| 91 } | |
| 92 | |
| 93 .separator { | 95 .separator { |
| 94 /* Per Alan@, this line is different from the other separator lines. */ | 96 /* Per Alan@, this line is different from the other separator lines. */ |
| 95 border-bottom: 1px solid rgba(0, 0, 0, 0.08); | 97 border-bottom: 1px solid rgba(0, 0, 0, 0.08); |
| 96 margin-top: 8px; | 98 margin-top: 8px; |
| 97 } | 99 } |
| 98 </style> | 100 </style> |
| 99 <paper-menu name="root-menu"> | 101 <div class="page-menu" id="basicPage"> |
| 100 <div class="page-menu" id="basicPage"> | 102 <paper-menu attr-for-selected="href" class="menu-content" |
| 101 <paper-menu attr-for-selected="data-path" class="menu-content" | 103 id="basicMenu" selected="[[currentRoute.path]]"> |
| 102 id="basicMenu" selected="[[currentRoute.path]]"> | |
| 103 <if expr="chromeos"> | 104 <if expr="chromeos"> |
| 104 <div data-path="/internet" on-tap="openPage_"> | 105 <a is="action-link" href="/internet" on-tap="openPage_"> |
|
Dan Beam
2017/02/06 17:28:12
wait why do we need both href AND is="action-link"
hcarmona
2017/02/10 19:27:34
We don't. Updated.
| |
| 105 <iron-icon icon="settings:network-wifi"></iron-icon> | 106 <iron-icon icon="settings:network-wifi"></iron-icon> |
| 106 $i18n{internetPageTitle} | 107 <span>$i18n{internetPageTitle}</span> |
|
dschuyler
2017/02/02 20:46:53
Can these spans be removed (here and below in this
Dan Beam
2017/02/06 17:28:12
the span is targeted by css above
hcarmona: why d
hcarmona
2017/02/10 19:27:34
Spans are not necessary, they were left overs from
| |
| 107 </div> | 108 </a> |
| 108 <div data-path="/bluetooth" on-tap="openPage_"> | 109 <a is="action-link" href="/bluetooth" on-tap="openPage_"> |
| 109 <iron-icon icon="settings:bluetooth"></iron-icon> | 110 <iron-icon icon="settings:bluetooth"></iron-icon> |
| 110 $i18n{bluetoothPageTitle} | 111 <span>$i18n{bluetoothPageTitle}</span> |
| 111 </div> | 112 </a> |
| 112 </if> | 113 </if> |
| 113 <div id="people" data-path="/people" on-tap="openPage_" | 114 <a is="action-link" id="people" href="/people" on-tap="openPage_" |
| 114 hidden="[[!pageVisibility.people]]"> | 115 hidden="[[!pageVisibility.people]]"> |
| 115 <iron-icon icon="settings:people"></iron-icon> | 116 <iron-icon icon="settings:people"></iron-icon> |
| 116 $i18n{peoplePageTitle} | 117 <span>$i18n{peoplePageTitle}</span> |
| 117 </div> | 118 </a> |
| 118 <div data-path="/appearance" on-tap="openPage_" | 119 <a is="action-link" href="/appearance" on-tap="openPage_" |
| 119 hidden="[[!pageVisibility.appearance]]"> | 120 hidden="[[!pageVisibility.appearance]]"> |
| 120 <iron-icon icon="settings:palette"></iron-icon> | 121 <iron-icon icon="settings:palette"></iron-icon> |
| 121 $i18n{appearancePageTitle} | 122 <span>$i18n{appearancePageTitle}</span> |
| 122 </div> | 123 </a> |
| 123 <if expr="chromeos"> | 124 <if expr="chromeos"> |
| 124 <div data-path="/device" on-tap="openPage_"> | 125 <a is="action-link" href="/device" on-tap="openPage_"> |
| 125 <iron-icon icon="settings:laptop-chromebook"></iron-icon> | 126 <iron-icon icon="settings:laptop-chromebook"></iron-icon> |
| 126 $i18n{devicePageTitle} | 127 <span>$i18n{devicePageTitle}</span> |
| 127 </div> | 128 </a> |
| 128 </if> | 129 </if> |
| 129 <div data-path="/search" on-tap="openPage_"> | 130 <a is="action-link" href="/search" on-tap="openPage_"> |
| 130 <iron-icon icon="cr:search"></iron-icon> | 131 <iron-icon icon="cr:search"></iron-icon> |
| 131 $i18n{searchPageTitle} | 132 <span>$i18n{searchPageTitle}</span> |
| 132 </div> | 133 </a> |
| 133 <if expr="chromeos"> | 134 <if expr="chromeos"> |
| 134 <div data-path="/androidApps" on-tap="openPage_" | 135 <a is="action-link" href="/androidApps" on-tap="openPage_" |
| 135 hidden="[[!showAndroidApps]]"> | 136 hidden="[[!showAndroidApps]]"> |
| 136 <iron-icon icon="settings:android"></iron-icon> | 137 <iron-icon icon="settings:android"></iron-icon> |
| 137 $i18n{androidAppsPageTitle} | 138 <span>$i18n{androidAppsPageTitle}</span> |
| 138 </div> | 139 </a> |
| 139 </if> | 140 </if> |
| 140 <if expr="not chromeos"> | 141 <if expr="not chromeos"> |
| 141 <div data-path="/defaultBrowser" on-tap="openPage_" | 142 <a is="action-link" href="/defaultBrowser" on-tap="openPage_" |
| 142 hidden="[[!pageVisibility.defaultBrowser]]"> | 143 hidden="[[!pageVisibility.defaultBrowser]]"> |
| 143 <iron-icon icon="settings:web"></iron-icon> | 144 <iron-icon icon="settings:web"></iron-icon> |
| 144 $i18n{defaultBrowser} | 145 <span>$i18n{defaultBrowser}</span> |
| 145 </div> | 146 </a> |
| 146 </if> | 147 </if> |
| 147 <div data-path="/onStartup" on-tap="openPage_" | 148 <a is="action-link" href="/onStartup" on-tap="openPage_" |
| 148 hidden="[[!pageVisibility.onStartup]]"> | 149 hidden="[[!pageVisibility.onStartup]]"> |
| 149 <iron-icon icon="settings:power-settings-new"></iron-icon> | 150 <iron-icon icon="settings:power-settings-new"></iron-icon> |
| 150 $i18n{onStartup} | 151 <span>$i18n{onStartup}</span> |
| 151 </div> | 152 </a> |
| 152 </paper-menu> | 153 </paper-menu> |
| 153 </div> | |
| 154 <paper-submenu class="page-menu" id="advancedSubmenu" actionable | 154 <paper-submenu class="page-menu" id="advancedSubmenu" actionable |
| 155 opened="{{advancedOpened}}" | 155 opened="{{advancedOpened}}" |
| 156 hidden="[[!pageVisibility.advancedSettings]]"> | 156 hidden="[[!pageVisibility.advancedSettings]]"> |
| 157 <div class="menu-trigger"> | 157 <a is="action-link" class="menu-trigger" tabindex="0"> |
| 158 <span>$i18n{advancedPageTitle}</span> | 158 <span>$i18n{advancedPageTitle}</span> |
| 159 <iron-icon icon="[[arrowState_(advancedOpened)]]"></iron-icon> | 159 <iron-icon icon="[[arrowState_(advancedOpened)]]"></iron-icon> |
| 160 <paper-ripple></paper-ripple> | 160 <paper-ripple></paper-ripple> |
| 161 </div> | 161 </a> |
| 162 <paper-menu attr-for-selected="data-path" class="menu-content" | 162 <paper-menu attr-for-selected="href" class="menu-content" |
| 163 id="advancedMenu" selected="[[currentRoute.path]]"> | 163 id="advancedMenu" selected="[[currentRoute.path]]"> |
| 164 <if expr="chromeos"> | 164 <if expr="chromeos"> |
| 165 <div data-path="/dateTime" on-tap="openPage_"> | 165 <a is="action-link" href="/dateTime" on-tap="openPage_"> |
| 166 <iron-icon icon="settings:access-time"></iron-icon> | 166 <iron-icon icon="settings:access-time"></iron-icon> |
| 167 $i18n{dateTimePageTitle} | 167 <span>$i18n{dateTimePageTitle}</span> |
| 168 </div> | 168 </a> |
| 169 </if> | 169 </if> |
| 170 <div data-path="/privacy" on-tap="openPage_"> | 170 <a is="action-link" href="/privacy" on-tap="openPage_"> |
| 171 <iron-icon icon="settings:security"></iron-icon> | 171 <iron-icon icon="settings:security"></iron-icon> |
| 172 $i18n{privacyPageTitle} | 172 <span>$i18n{privacyPageTitle}</span> |
| 173 </div> | 173 </a> |
| 174 <div data-path="/passwordsAndForms" on-tap="openPage_" | 174 <a is="action-link" href="/passwordsAndForms" on-tap="openPage_" |
| 175 hidden="[[!pageVisibility.passwordsAndForms]]"> | 175 hidden="[[!pageVisibility.passwordsAndForms]]"> |
| 176 <iron-icon icon="settings:assignment"></iron-icon> | 176 <iron-icon icon="settings:assignment"></iron-icon> |
| 177 $i18n{passwordsAndAutofillPageTitle} | 177 <span>$i18n{passwordsAndAutofillPageTitle}</span> |
| 178 </div> | 178 </a> |
| 179 <div data-path="/languages" on-tap="openPage_"> | 179 <a is="action-link" href="/languages" on-tap="openPage_"> |
| 180 <iron-icon icon="settings:language"></iron-icon> | 180 <iron-icon icon="settings:language"></iron-icon> |
| 181 $i18n{languagesPageTitle} | 181 <span>$i18n{languagesPageTitle}</span> |
| 182 </div> | 182 </a> |
| 183 <div data-path="/downloads" on-tap="openPage_"> | 183 <a is="action-link" href="/downloads" on-tap="openPage_"> |
| 184 <iron-icon icon="cr:file-download"></iron-icon> | 184 <iron-icon icon="cr:file-download"></iron-icon> |
| 185 $i18n{downloadsPageTitle} | 185 <span>$i18n{downloadsPageTitle}</span> |
| 186 </div> | 186 </a> |
| 187 <div data-path="/printing" on-tap="openPage_"> | 187 <a is="action-link" href="/printing" on-tap="openPage_"> |
| 188 <iron-icon icon="cr:print"></iron-icon> | 188 <iron-icon icon="cr:print"></iron-icon> |
| 189 $i18n{printingPageTitle} | 189 <span>$i18n{printingPageTitle}</span> |
| 190 </div> | 190 </a> |
| 191 <div data-path="/accessibility" on-tap="openPage_"> | 191 <a is="action-link" href="/accessibility" on-tap="openPage_"> |
| 192 <iron-icon icon="settings:accessibility"></iron-icon> | 192 <iron-icon icon="settings:accessibility"></iron-icon> |
| 193 $i18n{a11yPageTitle} | 193 <span>$i18n{a11yPageTitle}</span> |
| 194 </div> | 194 </a> |
| 195 <if expr="not chromeos"> | 195 <if expr="not chromeos"> |
| 196 <div data-path="/system" on-tap="openPage_"> | 196 <a is="action-link" href="/system" on-tap="openPage_"> |
| 197 <iron-icon icon="settings:build"></iron-icon> | 197 <iron-icon icon="settings:build"></iron-icon> |
| 198 $i18n{systemPageTitle} | 198 <span>$i18n{systemPageTitle}</span> |
| 199 </div> | 199 </a> |
| 200 </if> | 200 </if> |
| 201 <div data-path="/reset" on-tap="openPage_" | 201 <a is="action-link" href="/reset" on-tap="openPage_" |
| 202 hidden="[[!pageVisibility.reset]]"> | 202 hidden="[[!pageVisibility.reset]]"> |
| 203 <iron-icon icon="settings:restore"></iron-icon> | 203 <iron-icon icon="settings:restore"></iron-icon> |
| 204 $i18n{resetPageTitle} | 204 <span>$i18n{resetPageTitle}</span> |
| 205 </div> | 205 </a> |
| 206 </paper-menu> | 206 </paper-menu> |
| 207 </paper-submenu> | 207 </paper-submenu> |
| 208 <div class="separator"></div> | 208 </div> |
| 209 <paper-submenu class="page-menu"> | 209 <div class="separator"></div> |
| 210 <div about-selected$="[[aboutSelected_]]" class="menu-trigger" | 210 <paper-menu class="page-menu"> |
| 211 id="about-menu" on-tap="openPage_" data-path="/help"> | 211 <a is="action-link" about-selected$="[[aboutSelected_]]" |
| 212 $i18n{aboutPageTitle} | 212 id="about-menu" on-tap="openPage_" href="/help"> |
| 213 </div> | 213 <span>$i18n{aboutPageTitle}</span> |
| 214 </paper-submenu> | 214 </a> |
| 215 </paper-menu> | 215 </paper-menu> |
| 216 </template> | 216 </template> |
| 217 <script src="settings_menu.js"></script> | 217 <script src="settings_menu.js"></script> |
| 218 </dom-module> | 218 </dom-module> |
| OLD | NEW |