Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(330)

Side by Side Diff: chrome/browser/resources/md_extensions/keyboard_shortcuts.html

Issue 2938933002: WebUI: swap paper-dropdown-menu out for md-select. (Closed)
Patch Set: fix test Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 <link rel="import" href="chrome://resources/html/cr.html"> 1 <link rel="import" href="chrome://resources/html/cr.html">
2 <link rel="import" href="chrome://resources/html/md_select_css.html">
2 <link rel="import" href="chrome://resources/html/polymer.html"> 3 <link rel="import" href="chrome://resources/html/polymer.html">
3 <link rel="import" href="chrome://resources/polymer/v1_0/neon-animation/neon-ani matable-behavior.html"> 4 <link rel="import" href="chrome://resources/polymer/v1_0/neon-animation/neon-ani matable-behavior.html">
4 <link rel="import" href="chrome://resources/polymer/v1_0/paper-dropdown-menu/pap er-dropdown-menu.html">
5 <link rel="import" href="chrome://resources/polymer/v1_0/paper-item/paper-item.h tml">
6 <link rel="import" href="chrome://resources/polymer/v1_0/paper-listbox/paper-lis tbox.html">
7 <link rel="import" href="chrome://resources/polymer/v1_0/paper-styles/color.html "> 5 <link rel="import" href="chrome://resources/polymer/v1_0/paper-styles/color.html ">
8 <link rel="import" href="chrome://resources/polymer/v1_0/paper-styles/shadow.htm l"> 6 <link rel="import" href="chrome://resources/polymer/v1_0/paper-styles/shadow.htm l">
9 <link rel="import" href="chrome://extensions/animation_helper.html"> 7 <link rel="import" href="chrome://extensions/animation_helper.html">
10 <link rel="import" href="chrome://extensions/shortcut_input.html"> 8 <link rel="import" href="chrome://extensions/shortcut_input.html">
11 9
12 <dom-module id="extensions-keyboard-shortcuts"> 10 <dom-module id="extensions-keyboard-shortcuts">
13 <template> 11 <template>
14 <style> 12 <style include="md-select">
15 [hidden] { 13 [hidden] {
16 display: none !important; 14 display: none !important;
17 } 15 }
18 16
19 .shortcut-card { 17 .shortcut-card {
20 @apply(--shadow-elevation-2dp); 18 @apply(--shadow-elevation-2dp);
21 background-color: white; 19 background-color: white;
22 color: var(--paper-grey-600); 20 color: var(--paper-grey-600);
23 margin: 0 auto 16px auto; 21 margin: 0 auto 16px auto;
24 max-width: 928px; 22 max-width: 928px;
25 min-width: 600px; 23 min-width: 600px;
26 padding-bottom: 8px; 24 padding-bottom: 8px;
27 width: 90%; 25 width: 90%;
28 } 26 }
29 27
30 .command-entry { 28 .command-entry {
31 align-items: center; 29 align-items: center;
32 display: flex; 30 display: flex;
33 font-size: 13px; 31 font-size: 13px;
34 height: 48px; 32 height: 48px;
35 } 33 }
36 34
37 .command-name { 35 .command-name {
38 color: var(--paper-grey-900); 36 color: var(--paper-grey-900);
39 flex: 1; 37 flex: 1;
40 } 38 }
41 39
42 .command-entry paper-dropdown-menu { 40 .command-entry .md-select-wrapper {
43 -webkit-margin-start: 40px; 41 -webkit-margin-start: 40px;
44 } 42 }
45 43
46 .card-title { 44 .card-title {
47 align-items: center; 45 align-items: center;
48 border-bottom: 1px solid var(--paper-grey-400); 46 border-bottom: 1px solid var(--paper-grey-400);
49 display: flex; 47 display: flex;
50 font-size: 14px; 48 font-size: 14px;
51 font-weight: 500; 49 font-weight: 500;
52 margin-bottom: 9px; 50 margin-bottom: 9px;
53 padding: 16px 20px; 51 padding: 16px 20px;
54 } 52 }
55 53
56 .icon { 54 .icon {
57 -webkit-margin-end: 20px; 55 -webkit-margin-end: 20px;
58 height: 16px; 56 height: 16px;
59 width: 16px; 57 width: 16px;
60 } 58 }
61 59
62 .card-controls { 60 .card-controls {
63 /* We line up the controls with the name, which is after the 61 /* We line up the controls with the name, which is after the
64 20px left padding + 16px icon + 20px margin on the icon. */ 62 20px left padding + 16px icon + 20px margin on the icon. */
65 -webkit-margin-end: 20px; 63 -webkit-margin-end: 20px;
66 -webkit-margin-start: 56px; 64 -webkit-margin-start: 56px;
67 } 65 }
68 66
69 #main { 67 #main {
70 margin-top: 24px; 68 margin-top: 24px;
71 } 69 }
72
73 #main paper-dropdown-menu {
74 --paper-input-container: {
75 margin-bottom: 14px;
76 padding: 0;
77 };
78 --paper-input-container-color: var(--paper-grey-400);
79 --paper-input-container-focus-color: var(--google-blue-500);
80 --paper-input-container-input: {
81 font-size: 13px;
82 };
83 --paper-input-container-underline-disabled: {
84 border-bottom: 1px solid;
85 };
86 }
87
88 </style> 70 </style>
89 <div id="main"> 71 <div id="main">
90 <template is="dom-repeat" items="[[calculateShownItems_(items.*)]]"> 72 <template is="dom-repeat" items="[[calculateShownItems_(items.*)]]">
91 <div class="shortcut-card"> 73 <div class="shortcut-card">
92 <div class="card-title"> 74 <div class="card-title">
93 <img class="icon" src="[[item.iconUrl]]"> 75 <img class="icon" src="[[item.iconUrl]]">
94 <span>[[item.name]]</span> 76 <span>[[item.name]]</span>
95 </div> 77 </div>
96 <div class="card-controls"> 78 <div class="card-controls">
97 <template is="dom-repeat" items="[[item.commands]]" as="command"> 79 <template is="dom-repeat" items="[[item.commands]]" as="command">
98 <div class="command-entry" command="[[command]]"> 80 <div class="command-entry" command="[[command]]">
99 <span class="command-name">[[command.description]]</span> 81 <span class="command-name">[[command.description]]</span>
100 <extensions-shortcut-input item="[[item.id]]" 82 <extensions-shortcut-input item="[[item.id]]"
101 shortcut="[[command.keybinding]]" 83 shortcut="[[command.keybinding]]"
102 command-name="[[command.name]]"> 84 command-name="[[command.name]]">
103 </extensions-shortcut-input> 85 </extensions-shortcut-input>
104 <paper-dropdown-menu 86 <div class="md-select-wrapper">
105 disabled$="[[computeScopeDisabled_(command)]]"> 87 <!-- Binding "value" to triggerScopeChange_ to trigger update
106 <paper-listbox class="dropdown-content" 88 only after CommandScope_ becomes available. -->
107 selected="[[computeSelectedScope_(command)]]"> 89 <select class="md-select" on-change="onScopeChanged_"
108 <paper-item>$i18n{shortcutScopeInChrome}</paper-item> 90 disabled$="[[computeScopeDisabled_(command)]]"
109 <paper-item>$i18n{shortcutScopeGlobal}</paper-item> 91 value="[[
110 </paper-listbox> 92 triggerScopeChange_(command.scope, CommandScope_)]]">
111 </paper-dropdown> 93 <option value$="[[CommandScope_.CHROME]]">
94 $i18n{shortcutScopeInChrome}
95 </option>
96 <option value$="[[CommandScope_.GLOBAL]]">
97 $i18n{shortcutScopeGlobal}
98 </option>
99 </select>
100 <span class="md-select-underline"></span>
101 </div>
112 </div> 102 </div>
113 </template> 103 </template>
114 </div> 104 </div>
115 </div> 105 </div>
116 </template> 106 </template>
117 </div> 107 </div>
118 </template> 108 </template>
119 <script src="chrome://extensions/keyboard_shortcuts.js"></script> 109 <script src="chrome://extensions/keyboard_shortcuts.js"></script>
120 </dom-module> 110 </dom-module>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698