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/polymer.html"> | 2 <link rel="import" href="chrome://resources/html/polymer.html"> |
| 3 <link rel="import" href="chrome://resources/polymer/v1_0/paper-drawer-panel/pape r-drawer-panel.html"> | 3 <link rel="import" href="chrome://resources/polymer/v1_0/app-layout/app-drawer/a pp-drawer.html"> |
| 4 <link rel="import" href="chrome://resources/polymer/v1_0/iron-flex-layout/classe s/iron-flex-layout.html"> | |
|
michaelpg
2016/06/20 23:30:06
this file is deprecated, is it unused here?
(the
dpapad
2016/06/20 23:44:48
Done, importing iron-flex-layout/iron-flex-layout.
| |
| 5 <link rel="import" href="chrome://resources/polymer/v1_0/iron-icon/iron-icon.htm l"> | |
| 4 <link rel="import" href="chrome://resources/polymer/v1_0/paper-header-panel/pape r-header-panel.html"> | 6 <link rel="import" href="chrome://resources/polymer/v1_0/paper-header-panel/pape r-header-panel.html"> |
| 5 <link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper -icon-button.html"> | 7 <link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper -icon-button.html"> |
| 6 <link rel="import" href="chrome://resources/polymer/v1_0/paper-input/paper-input .html"> | 8 <link rel="import" href="chrome://resources/polymer/v1_0/paper-input/paper-input .html"> |
| 7 <link rel="import" href="chrome://resources/polymer/v1_0/paper-toolbar/paper-too lbar.html"> | |
| 8 <link rel="import" href="chrome://resources/polymer/v1_0/iron-flex-layout/classe s/iron-flex-layout.html"> | |
| 9 <link rel="import" href="chrome://resources/polymer/v1_0/iron-icon/iron-icon.htm l"> | |
| 10 <link rel="import" href="/direction_delegate.html"> | 9 <link rel="import" href="/direction_delegate.html"> |
| 11 <link rel="import" href="/i18n_setup.html"> | 10 <link rel="import" href="/i18n_setup.html"> |
| 12 <link rel="import" href="/icons.html"> | 11 <link rel="import" href="/icons.html"> |
| 13 <link rel="import" href="/settings_main/settings_main.html"> | 12 <link rel="import" href="/settings_main/settings_main.html"> |
| 14 <link rel="import" href="/settings_menu/settings_menu.html"> | 13 <link rel="import" href="/settings_menu/settings_menu.html"> |
| 15 <link rel="import" href="/settings_page/settings_router.html"> | 14 <link rel="import" href="/settings_page/settings_router.html"> |
| 16 <link rel="import" href="/settings_shared_css.html"> | 15 <link rel="import" href="/settings_shared_css.html"> |
| 17 | 16 |
| 18 <dom-module id="settings-ui"> | 17 <dom-module id="settings-ui"> |
| 19 <template> | 18 <template> |
| 20 <style include="settings-shared"> | 19 <style include="settings-shared"> |
| 21 :host { | 20 :host { |
| 22 @apply(--layout-fit); | 21 @apply(--layout-fit); |
| 23 -webkit-user-select: none; | 22 -webkit-user-select: none; |
| 24 background-color: var(--settings-background-color); | 23 background-color: var(--settings-background-color); |
| 25 display: flex; | 24 display: flex; |
| 26 flex-direction: column; | 25 flex-direction: column; |
| 27 } | 26 } |
| 28 | 27 |
| 29 paper-drawer-panel { | |
| 30 --paper-drawer-panel-drawer-container: { | |
| 31 background: none; /* Remove default background styling. */ | |
| 32 }; | |
| 33 align-items: center; | |
| 34 position: relative; | |
| 35 } | |
| 36 | |
| 37 paper-header-panel[main] paper-icon-button { | |
| 38 --iron-icon-fill-color: var(--settings-title-bar-color); | |
| 39 } | |
| 40 | |
| 41 paper-icon-button[suffix] { | 28 paper-icon-button[suffix] { |
| 42 --iron-icon-fill-color: var(--settings-title-search-color); | 29 --iron-icon-fill-color: var(--settings-title-search-color); |
| 43 height: 32px; /* After padding, the icon size is 16px. */ | 30 height: 32px; /* After padding, the icon size is 16px. */ |
| 44 width: 32px; | 31 width: 32px; |
| 45 } | 32 } |
| 46 | 33 |
| 47 paper-input { | 34 paper-input { |
| 48 --paper-input-container: { | 35 --paper-input-container: { |
| 49 padding-top: 0; | 36 padding-top: 0; |
| 50 }; | 37 }; |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 70 --paper-input-container-input-color: var(--settings-title-bar-color); | 57 --paper-input-container-input-color: var(--settings-title-bar-color); |
| 71 --paper-input-container-label: { | 58 --paper-input-container-label: { |
| 72 font-size: 81.25%; /* go to 13px from 16px */ | 59 font-size: 81.25%; /* go to 13px from 16px */ |
| 73 top: 3px; /* Special positioning needed for UX design. */ | 60 top: 3px; /* Special positioning needed for UX design. */ |
| 74 }; | 61 }; |
| 75 --paper-input-max-width: 200px; | 62 --paper-input-max-width: 200px; |
| 76 | 63 |
| 77 align-items: center; | 64 align-items: center; |
| 78 } | 65 } |
| 79 | 66 |
| 80 /* These header elements must create stacking contexts when a section is | |
| 81 * expanding to show a sub-page. (It's simpler for them to always create | |
| 82 * these stacking contexts, so we do.) But for the overlay to work, the | |
| 83 * paper-header-panel's other descendents (rooted at settings-main) must | |
| 84 * never create stacking contexts while a dialog is showing. This means | |
| 85 * we cannot animate a section expanding/collapsing while a dialog is | |
| 86 * shown (which makes good UX sense anyway.) I have discovered a truly | |
| 87 * non-marvellous proof of this, which this comment cannot contain: | |
| 88 * https://goo.gl/CCzijE */ | |
| 89 paper-header-panel[main] paper-toolbar { | |
| 90 z-index: 2; | |
| 91 } | |
| 92 | 67 |
| 93 paper-header-panel[main] { | 68 paper-header-panel { |
| 94 --paper-header-panel-shadow: { | 69 --paper-header-panel-shadow: { |
| 95 z-index: 2; | 70 z-index: 2; |
| 96 }; | 71 }; |
| 97 } | 72 } |
| 98 | 73 |
| 99 /* The paper-drawer-panel implementation gives the drawer a stacking | |
| 100 * context, so its z-index should at least equal the main panel's. */ | |
| 101 paper-drawer-panel[narrow] { | |
| 102 --paper-drawer-panel-drawer-container: { | |
| 103 z-index: 2; | |
| 104 }; | |
| 105 } | |
| 106 | |
| 107 paper-toolbar { | |
| 108 --paper-toolbar-height: 56px; | |
| 109 --paper-toolbar-sm-height: 56px; | |
| 110 --paper-toolbar-content: { | |
| 111 font-size: 123.08%; /* go to 16px from 13px */ | |
| 112 }; | |
| 113 --paper-toolbar: { | |
| 114 background-color: var(--settings-title-bar-background-color); | |
| 115 }; | |
| 116 } | |
| 117 | |
| 118 paper-icon-button#menu-button { | |
| 119 /* Prevent the menu icon from changing size with the window size. */ | |
| 120 flex-shrink: 0; | |
| 121 /* Prevent paper-toolbar from setting the margin-right to 24px. | |
| 122 * TODO(dschuyler): this margin is on the right regardless of language | |
| 123 * direction (e.g. rtl). Make a patch for paper-toolbar in Polymer. */ | |
| 124 margin-right: 0; | |
| 125 } | |
| 126 | |
| 127 .heading { | 74 .heading { |
| 128 -webkit-margin-start: 8px; | 75 -webkit-margin-start: 8px; |
| 129 } | 76 } |
| 130 | 77 |
| 131 paper-drawer-panel:not([narrow]) #main-title { | |
| 132 display: none; | |
| 133 } | |
| 134 | |
| 135 paper-icon-button[toggles]:not([active]) + #search-input { | 78 paper-icon-button[toggles]:not([active]) + #search-input { |
| 136 display: none; | 79 display: none; |
| 137 } | 80 } |
| 138 | 81 |
| 139 .paper-header { | 82 .paper-header { |
| 140 -webkit-padding-start: 24px; | 83 -webkit-padding-start: 24px; |
| 141 align-items: center; | 84 align-items: center; |
| 142 border-bottom: var(--settings-separator-line); | 85 border-bottom: var(--settings-separator-line); |
| 143 display: flex; | 86 display: flex; |
| 144 font-size: 123.08%; /* go to 16px from 13px */ | 87 font-size: 123.08%; /* go to 16px from 13px */ |
| 145 min-height: 56px; | 88 min-height: 56px; |
| 146 } | 89 } |
| 147 | 90 |
| 148 .last { | 91 .last { |
| 149 display: flex; | 92 display: flex; |
| 150 justify-content: flex-end; | 93 justify-content: flex-end; |
| 151 width: 100%; | 94 width: 100%; |
| 152 } | 95 } |
| 96 | |
| 97 app-drawer { | |
| 98 z-index: 1; | |
| 99 } | |
| 100 | |
| 101 .toolbar, | |
| 102 app-drawer .drawer-header { | |
| 103 align-items: center; | |
| 104 display: flex; | |
| 105 font-size: 123.08%; /* go to 16px from 13px */ | |
| 106 min-height: 56px; | |
| 107 } | |
| 108 | |
| 109 .toolbar { | |
| 110 background-color: var(--settings-title-bar-background-color); | |
| 111 color: white; | |
| 112 padding: 0 16px; | |
| 113 } | |
| 114 | |
| 115 .toolbar paper-icon-button { | |
| 116 --iron-icon-fill-color: white; | |
| 117 } | |
| 118 | |
| 119 app-drawer .drawer-header { | |
| 120 -webkit-padding-start: 24px; | |
| 121 border-bottom: var(--settings-separator-line); | |
| 122 } | |
| 123 | |
| 124 app-drawer .drawer-content { | |
| 125 height: calc(100% - 56px); | |
| 126 overflow: auto; | |
| 127 } | |
| 153 </style> | 128 </style> |
| 154 <settings-router current-route="{{currentRoute}}" | 129 <settings-router current-route="{{currentRoute}}" |
| 155 current-route-titles="{{currentRouteTitles}}"> | 130 current-route-titles="{{currentRouteTitles}}"> |
| 156 </settings-router> | 131 </settings-router> |
| 157 <paper-drawer-panel drawer-width="256px" id="panel" narrow="{{isNarrow_}}" | 132 <div class="toolbar"> |
|
dschuyler
2016/06/20 23:11:58
Please add a todo here that talks
about needing to
dpapad
2016/06/20 23:44:48
Done. Added the TODO within app-drawer a few lines
| |
| 158 responsive-width="900px" force-narrow> | 133 <paper-icon-button icon="settings:menu" on-tap="onMenuButtonTap_"> |
| 159 <paper-header-panel mode="waterfall" drawer> | 134 </paper-icon-button> |
| 160 <div class="paper-header">$i18n{settings}</div> | 135 <div class="heading flex">$i18n{settings}</div> |
| 136 <div class="last"> | |
| 137 <paper-icon-button icon="cr:search" toggles></paper-icon-button> | |
| 138 <paper-input id="search-input" label="$i18n{internalSearch}" | |
| 139 no-label-float> | |
| 140 <!-- TODO(dschuyler): implement internal search. --> | |
| 141 <paper-icon-button suffix icon="cr:cancel"> | |
| 142 </paper-icon-button> | |
| 143 </paper-input> | |
| 144 </div> | |
| 145 </div> | |
| 146 <app-drawer swipe-open> | |
| 147 <div class="drawer-header">$i18n{settings}</div> | |
| 148 <div class="drawer-content"> | |
| 161 <settings-menu current-route="{{currentRoute}}" id="sideNav"> | 149 <settings-menu current-route="{{currentRoute}}" id="sideNav"> |
| 162 </settings-menu> | 150 </settings-menu> |
| 163 </paper-header-panel> | 151 </div> |
| 164 <paper-header-panel mode="waterfall" main> | 152 </app-drawer> |
| 165 <paper-toolbar> | 153 <paper-header-panel mode="waterfall"> |
| 166 <paper-icon-button icon="settings:menu" id="menu-button" | 154 <settings-main prefs="{{prefs}}" current-route="{{currentRoute}}"> |
| 167 paper-drawer-toggle> | 155 </settings-main> |
| 168 </paper-icon-button> | 156 </paper-header-panel> |
| 169 <div class="heading" id="main-title"> | |
| 170 $i18n{settings} | |
| 171 </div> | |
| 172 <div class="last"> | |
| 173 <paper-icon-button icon="cr:search" toggles> | |
| 174 </paper-icon-button> | |
| 175 <paper-input id="search-input" label="$i18n{internalSearch}" | |
| 176 no-label-float> | |
| 177 <!-- TODO(dschuyler): implement internal search. --> | |
| 178 <paper-icon-button suffix icon="cr:cancel"> | |
| 179 </paper-icon-button> | |
| 180 </paper-input> | |
| 181 </div> | |
| 182 </paper-toolbar> | |
| 183 <settings-main prefs="{{prefs}}" current-route="{{currentRoute}}"> | |
| 184 </settings-main> | |
| 185 </paper-header-panel> | |
| 186 </paper-drawer-panel> | |
| 187 </template> | 157 </template> |
| 188 <script src="settings_ui.js"></script> | 158 <script src="settings_ui.js"></script> |
| 189 </dom-module> | 159 </dom-module> |
| OLD | NEW |