@@ -13,6 +13,7 @@ const {
1313 hasConflict,
1414 getConflictLabels,
1515 updateShortcut,
16+ clearShortcut,
1617 resetShortcut,
1718 resetAll,
1819 CATEGORY_LABELS,
@@ -157,6 +158,12 @@ function toggleCategory(cat: ShortcutCategory) {
157158 recordingKey = '';
158159 return;
159160 }
161+ if (e.key === 'Backspace' || e.key === 'Delete') {
162+ clearShortcut(s.id);
163+ recordingId = null;
164+ recordingKey = '';
165+ return;
166+ }
160167 const k = keyEventToProseMirrorKey(e);
161168 if (k) {
162169 updateShortcut(s.id, k);
@@ -172,14 +179,25 @@ function toggleCategory(cat: ShortcutCategory) {
172179 >
173180 {{ recordingId === s.id ? "请按下新快捷键..." : formatKeyForDisplay(s.key) }}
174181 </div >
175- <button
176- v-if =" s.key !== s.defaultKey"
177- class =" reset-btn"
178- title =" 重置为默认值"
179- @click =" resetShortcut(s.id)"
180- >
181- ↺
182- </button >
182+ <div class =" shortcut-actions" >
183+ <button
184+ v-if =" s.key"
185+ class =" action-btn icon-btn"
186+ title =" 清除绑定"
187+ @click =" clearShortcut(s.id)"
188+ >
189+ <AppIcon name =" trash" />
190+ </button >
191+ <span v-else class =" action-placeholder" aria-hidden =" true" ></span >
192+ <button
193+ v-if =" s.key !== s.defaultKey"
194+ class =" action-btn reset-btn"
195+ title =" 重置为默认值"
196+ @click =" resetShortcut(s.id)"
197+ >
198+ ↺
199+ </button >
200+ </div >
183201 </div >
184202 </div >
185203 </div >
@@ -198,15 +216,18 @@ function toggleCategory(cat: ShortcutCategory) {
198216.shortcut-page {
199217 display : flex ;
200218 flex-direction : column ;
201- gap : 16 px ;
219+ gap : 20 px ;
202220 height : 100% ;
203- overflow-y : auto ;
221+ padding : 8px 20px 24px 8px ;
222+ box-sizing : border-box ;
223+ overflow : hidden ;
204224}
205225
206226.search-area {
207227 display : flex ;
208- gap : 8 px ;
228+ gap : 12 px ;
209229 flex-shrink : 0 ;
230+ padding : 4px 0 2px ;
210231
211232 .search-box {
212233 flex : 1 ;
@@ -238,9 +259,10 @@ function toggleCategory(cat: ShortcutCategory) {
238259
239260 .search-input {
240261 width : 100% ;
241- padding : 8px 12px ;
262+ min-height : 40px ;
263+ padding : 10px 14px ;
242264 border : 1px solid var (--border-color-1 );
243- border-radius : 6 px ;
265+ border-radius : 10 px ;
244266 background : var (--background-color );
245267 color : var (--text-color );
246268 font-size : 13px ;
@@ -254,9 +276,10 @@ function toggleCategory(cat: ShortcutCategory) {
254276
255277 .key-search-input {
256278 width : 100% ;
257- padding : 8px 12px ;
279+ min-height : 40px ;
280+ padding : 10px 14px ;
258281 border : 1px solid var (--border-color-1 );
259- border-radius : 6 px ;
282+ border-radius : 10 px ;
260283 background : var (--background-color );
261284 color : var (--text-color-2 );
262285 font-size : 13px ;
@@ -279,21 +302,25 @@ function toggleCategory(cat: ShortcutCategory) {
279302.shortcut-list {
280303 display : flex ;
281304 flex-direction : column ;
282- gap : 8px ;
283- flex-shrink : 0 ;
305+ gap : 12px ;
306+ flex : 1 ;
307+ min-height : 0 ;
308+ overflow-y : auto ;
309+ padding-right : 4px ;
284310}
285311
286312.category-section {
287313 border : 1px solid var (--border-color-1 );
288- border-radius : 8px ;
289- overflow : hidden ;
314+ border-radius : 12px ;
315+ overflow : visible ;
316+ background : var (--background-color );
290317}
291318
292319.category-header {
293320 display : flex ;
294321 align-items : center ;
295322 gap : 8px ;
296- padding : 10 px 16 px ;
323+ padding : 14 px 18 px ;
297324 cursor : pointer ;
298325 background : var (--background-color );
299326 user-select : none ;
@@ -339,7 +366,9 @@ function toggleCategory(cat: ShortcutCategory) {
339366 display : flex ;
340367 align-items : center ;
341368 justify-content : space-between ;
342- padding : 8px 16px 8px 36px ;
369+ flex-wrap : wrap ;
370+ gap : 20px ;
371+ padding : 14px 18px 14px 42px ;
343372 border-top : 1px solid var (--border-color-1 );
344373
345374 & :hover {
@@ -349,12 +378,18 @@ function toggleCategory(cat: ShortcutCategory) {
349378 .shortcut-label {
350379 font-size : 13px ;
351380 color : var (--text-color );
381+ flex : 1 ;
382+ min-width : 0 ;
352383 }
353384
354385 .shortcut-key-area {
355386 display : flex ;
356387 align-items : center ;
357- gap : 6px ;
388+ justify-content : flex-end ;
389+ flex-wrap : wrap ;
390+ gap : 8px ;
391+ flex-shrink : 0 ;
392+ margin-left : auto ;
358393 }
359394
360395 .conflict-icon {
@@ -364,15 +399,15 @@ function toggleCategory(cat: ShortcutCategory) {
364399 }
365400
366401 .key-badge {
367- padding : 4 px 10 px ;
402+ padding : 7 px 12 px ;
368403 border : 1px solid var (--border-color-1 );
369- border-radius : 4 px ;
404+ border-radius : 8 px ;
370405 background : var (--background-color );
371406 color : var (--text-color );
372407 font-size : 12px ;
373408 font-family : monospace ;
374409 cursor : pointer ;
375- min-width : 80 px ;
410+ min-width : 104 px ;
376411 text-align : center ;
377412 outline : none ;
378413 user-select : none ;
@@ -404,35 +439,69 @@ function toggleCategory(cat: ShortcutCategory) {
404439 }
405440 }
406441
407- .reset-btn {
408- padding : 2px 6px ;
442+ .shortcut-actions {
443+ display : flex ;
444+ align-items : center ;
445+ gap : 6px ;
446+ min-width : 70px ;
447+ justify-content : flex-end ;
448+ }
449+
450+ .action-btn {
451+ width : 32px ;
452+ min-width : 32px ;
453+ height : 32px ;
454+ padding : 0 ;
409455 border : 1px solid var (--border-color-1 );
410- border-radius : 4 px ;
456+ border-radius : 8 px ;
411457 background : transparent ;
412458 color : var (--text-color-2 );
413- font-size : 14 px ;
459+ font-size : 12 px ;
414460 cursor : pointer ;
415461 line-height : 1 ;
462+ display : inline-flex ;
463+ align-items : center ;
464+ justify-content : center ;
416465
417466 & :hover {
418467 background : var (--hover-color );
419468 color : var (--text-color );
420469 }
470+
471+ & :disabled {
472+ opacity : 0.45 ;
473+ cursor : not-allowed ;
474+ }
475+ }
476+
477+ .icon-btn {
478+ font-size : 14px ;
479+ }
480+
481+ .reset-btn {
482+ font-size : 14px ;
483+ }
484+
485+ .action-placeholder {
486+ width : 32px ;
487+ min-width : 32px ;
488+ height : 32px ;
489+ flex-shrink : 0 ;
421490 }
422491}
423492
424493.footer-actions {
425494 display : flex ;
426495 justify-content : flex-end ;
427- padding -top : 8 px ;
428- padding-bottom : 16 px ;
496+ margin -top : auto ;
497+ padding : 4 px 0 8 px ;
429498 border-top : 1px solid var (--border-color-1 );
430499 flex-shrink : 0 ;
431500
432501 .reset-all-btn {
433- padding : 6 px 16px ;
502+ padding : 8 px 16px ;
434503 border : 1px solid var (--border-color-1 );
435- border-radius : 6 px ;
504+ border-radius : 8 px ;
436505 background : transparent ;
437506 color : var (--text-color );
438507 font-size : 13px ;
0 commit comments