|
14 | 14 | const setCanvasRef = (name, el) => { |
15 | 15 | if (el) { |
16 | 16 | canvasRefs.value[name] = el |
| 17 | + drawPresetCanvas(name, el) |
17 | 18 | } |
18 | 19 | } |
19 | 20 |
|
|
106 | 107 | <div class="color-map-list"> |
107 | 108 | <v-text-field |
108 | 109 | v-model="filterText" |
109 | | - placeholder="Filter color maps..." |
| 110 | + placeholder="Search presets..." |
110 | 111 | density="compact" |
111 | | - clearable |
112 | 112 | hide-details |
113 | 113 | prepend-inner-icon="mdi-magnify" |
114 | | - class="mb-2" |
| 114 | + variant="outlined" |
| 115 | + class="mb-3 search-input" |
115 | 116 | /> |
116 | | - <v-list density="compact" max-height="400" class="overflow-y-auto"> |
| 117 | + <v-list |
| 118 | + density="compact" |
| 119 | + max-height="350" |
| 120 | + class="overflow-y-auto preset-list" |
| 121 | + > |
117 | 122 | <template v-for="(item, index) in filteredPresets" :key="index"> |
| 123 | + <!-- Group --> |
118 | 124 | <v-list-group v-if="item.Children" :value="item.Name"> |
119 | 125 | <template #activator="{ props }"> |
120 | | - <v-list-item v-bind="props" :title="item.Name" /> |
| 126 | + <v-list-item |
| 127 | + v-bind="props" |
| 128 | + :title="item.Name" |
| 129 | + class="group-header" |
| 130 | + /> |
121 | 131 | </template> |
| 132 | + |
122 | 133 | <v-list-item |
123 | 134 | v-for="(child, childIndex) in item.Children" |
124 | 135 | :key="childIndex" |
125 | 136 | @click="$emit('select', child)" |
126 | | - class="preset-item" |
| 137 | + class="preset-item pl-4" |
127 | 138 | > |
128 | | - <v-list-item-title>{{ child.Name }}</v-list-item-title> |
129 | | - <template #append> |
| 139 | + <div class="d-flex flex-column w-100 py-1"> |
| 140 | + <span class="preset-item-name mb-1">{{ child.Name }}</span> |
130 | 141 | <canvas |
131 | 142 | :ref="(el) => setCanvasRef(child.Name, el)" |
132 | | - width="100" |
| 143 | + width="200" |
133 | 144 | height="20" |
134 | 145 | class="preset-canvas" |
135 | 146 | /> |
136 | | - </template> |
| 147 | + </div> |
137 | 148 | </v-list-item> |
138 | 149 | </v-list-group> |
| 150 | + |
| 151 | + <!-- Single Item --> |
139 | 152 | <v-list-item |
140 | 153 | v-else |
141 | 154 | :key="index" |
142 | 155 | @click="$emit('select', item)" |
143 | 156 | class="preset-item" |
144 | 157 | > |
145 | | - <v-list-item-title>{{ item.Name }}</v-list-item-title> |
146 | | - <template #append> |
| 158 | + <div class="d-flex flex-column w-100 py-1"> |
| 159 | + <span class="preset-item-name mb-1">{{ item.Name }}</span> |
147 | 160 | <canvas |
148 | 161 | :ref="(el) => setCanvasRef(item.Name, el)" |
149 | | - width="100" |
| 162 | + width="200" |
150 | 163 | height="20" |
151 | 164 | class="preset-canvas" |
152 | 165 | /> |
153 | | - </template> |
| 166 | + </div> |
154 | 167 | </v-list-item> |
155 | 168 | </template> |
156 | 169 | </v-list> |
|
159 | 172 |
|
160 | 173 | <style scoped> |
161 | 174 | .color-map-list { |
162 | | - width: 350px; |
163 | | - padding: 8px; |
| 175 | + width: 320px; |
| 176 | + padding: 12px; |
| 177 | + background-color: rgba(30, 30, 30, 0.85) !important; |
| 178 | + backdrop-filter: blur(20px); |
| 179 | + -webkit-backdrop-filter: blur(20px); |
| 180 | + border: 1px solid rgba(255, 255, 255, 0.15) !important; |
| 181 | + border-radius: 12px; |
| 182 | + } |
| 183 | +
|
| 184 | + .search-input :deep(.v-field__input) { |
| 185 | + font-size: 14px; |
| 186 | + color: white !important; |
| 187 | + } |
| 188 | +
|
| 189 | + .search-input :deep(.v-field__outline__start), |
| 190 | + .search-input :deep(.v-field__outline__end), |
| 191 | + .search-input :deep(.v-field__outline__notch::before), |
| 192 | + .search-input :deep(.v-field__outline__notch::after) { |
| 193 | + border-color: rgba(255, 255, 255, 0.2) !important; |
| 194 | + } |
| 195 | +
|
| 196 | + .preset-list { |
| 197 | + background: transparent !important; |
| 198 | + } |
| 199 | +
|
| 200 | + .group-header { |
| 201 | + font-weight: 600; |
| 202 | + color: #e0e0e0 !important; |
164 | 203 | } |
165 | 204 |
|
166 | 205 | .preset-item { |
167 | 206 | cursor: pointer; |
| 207 | + border-radius: 6px; |
| 208 | + margin-bottom: 2px; |
| 209 | + transition: background-color 0.2s; |
168 | 210 | } |
169 | 211 |
|
170 | 212 | .preset-item:hover { |
171 | | - background-color: rgba(0, 0, 0, 0.05); |
| 213 | + background-color: rgba(255, 255, 255, 0.1) !important; |
| 214 | + } |
| 215 | +
|
| 216 | + .preset-item-name { |
| 217 | + font-size: 12px; |
| 218 | + color: #bdbdbd; |
172 | 219 | } |
173 | 220 |
|
174 | 221 | .preset-canvas { |
175 | | - border: 1px solid #ccc; |
176 | | - border-radius: 2px; |
| 222 | + width: 100%; |
| 223 | + height: 20px; |
| 224 | + border-radius: 4px; |
| 225 | + border: 1px solid rgba(255, 255, 255, 0.1); |
177 | 226 | } |
178 | 227 | </style> |
0 commit comments