From 3ba9593d971d7715d450d601797b041305d44b1f Mon Sep 17 00:00:00 2001 From: fofolee Date: Mon, 24 Mar 2025 17:56:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=BC=96=E6=8E=92=E5=91=BD?= =?UTF-8?q?=E4=BB=A4=E5=88=86=E7=B1=BB=E7=9A=84=E5=B1=95=E5=BC=80=E5=8A=A8?= =?UTF-8?q?=E7=94=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/composer/ComposerList.vue | 192 +++++++++++++---------- 1 file changed, 106 insertions(+), 86 deletions(-) diff --git a/src/components/composer/ComposerList.vue b/src/components/composer/ComposerList.vue index 0d48115..0fb511b 100644 --- a/src/components/composer/ComposerList.vue +++ b/src/components/composer/ComposerList.vue @@ -18,21 +18,16 @@
- +
- +
@@ -219,52 +231,41 @@ export default defineComponent({ height: 100%; } -.composer-list :deep(.q-expansion-item) { - margin: 0; - border: none; -} - -.composer-list :deep(.q-expansion-item .q-item) { - justify-content: space-between; -} - .body--dark .composer-list { background-color: #232323; } +.category-list { + padding: 4px 0; +} + .category-item { - margin: 4px 0; border-radius: 4px; overflow: hidden; } -:deep(.q-item.category-header) { +.category-header { min-height: 30px; margin: 0 8px; padding: 0 4px; border-radius: 4px; transition: background-color 0.3s ease; - position: relative; - display: flex; - align-items: center; + cursor: pointer; } -:deep(.q-item.category-header .q-item__section--side) { - position: absolute; - right: 4px; - padding: 0; - height: 100%; - display: flex; - align-items: center; +.category-header:hover { + background-color: rgba(0, 0, 0, 0.03); +} + +.body--dark .category-header:hover { + background-color: rgba(255, 255, 255, 0.03); } .category-header-content { - position: absolute; - left: 0; - right: 0; - height: 100%; + height: 30px; display: flex; align-items: center; + position: relative; } .category-icon { @@ -282,12 +283,32 @@ export default defineComponent({ line-height: 1; } -:deep(.q-expansion-item__toggle-icon) { - font-size: 1.2em; - line-height: 1; +.expand-icon { + position: absolute; + right: 4px; + height: 100%; + display: flex; + align-items: center; + transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); + opacity: 0.8; } -.command-item.q-item-type { +.category-content-wrapper { + display: grid; + grid-template-rows: 0fr; + transition: grid-template-rows 0.2s cubic-bezier(0.4, 0, 0.2, 1); +} + +.category-content-wrapper.expanded { + grid-template-rows: 1fr; +} + +.category-content { + min-height: 0; + overflow: hidden; +} + +.command-item { border: 1px solid rgba(0, 0, 0, 0.05); border-radius: 4px; margin: 4px 8px; @@ -302,18 +323,7 @@ export default defineComponent({ position: relative; } -.command-item.q-item-type :deep(.q-item__section) { - padding: 0; - min-height: unset; - flex: 1; -} - -.command-item.q-item-type :deep(.q-item__label) { - line-height: 1; - text-align: center; -} - -.command-item.q-item-type:hover { +.command-item:hover { transform: translateX(3px); box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05); } @@ -323,17 +333,6 @@ export default defineComponent({ transform: scale(0.95); } -.body--dark .section-header { - border-bottom-color: rgba(255, 255, 255, 0.05); -} - -.command-item :deep(.highlight) { - color: var(--q-primary); - font-weight: bold; - padding: 0 1px; - border-radius: 2px; -} - .drag-icon-left { position: absolute; left: 8px; @@ -342,8 +341,29 @@ export default defineComponent({ align-items: center; } -.section-header .q-field--focused .q-field__prepend .q-icon { - animation: shake 0.8s ease; +.command-item :deep(.q-item__section) { + padding: 0; + min-height: unset; + flex: 1; +} + +.command-item :deep(.q-item__label) { + line-height: 1; + text-align: center; +} + +.command-item :deep(.highlight) { color: var(--q-primary); + font-weight: bold; + padding: 0 1px; + border-radius: 2px; +} + +.body--dark .command-item { + border-color: rgba(255, 255, 255, 0.05); +} + +.body--dark .command-item:hover { + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); }