@@ -3,6 +3,7 @@ import { ref, computed } from 'vue';
33import { DocumentCopy } from ' @element-plus/icons-vue' ;
44import { ElMessage } from ' element-plus' ;
55import CodeLines from ' ./CodeLines.vue' ;
6+ import { useTheme } from ' @/utils/theme' ;
67import {
78 distros ,
89 methods ,
@@ -26,6 +27,35 @@ const selectedDe = ref<string>(deWms[0] || '');
2627const selectedEnv = ref <string >(environments [0 ] || ' ' );
2728const selectedInit = ref <string >(initSystems [0 ] || ' systemd' );
2829
30+ const { currentTheme } = useTheme ();
31+
32+ const deIcons: Record <string , string > = {
33+ GNOME: ' simple-icons:gnome' ,
34+ ' KDE Plasma' : ' simple-icons:kde' ,
35+ Xfce: ' simple-icons:xfce' ,
36+ Cinnamon: ' simple-icons:cinnamon' ,
37+ MATE: ' simple-icons:ubuntumate' ,
38+ Pantheon: ' simple-icons:pantheon' ,
39+ COSMIC: ' simple-icons:system76' ,
40+ i3: ' simple-icons:i3' ,
41+ Sway: ' simple-icons:sway' ,
42+ Hyprland: ' simple-icons:hyprland' ,
43+ Niri: ' simple-icons:niri' ,
44+ };
45+
46+ const envBaseIcons: Record <string , string > = {
47+ Wayland: ' simple-icons:wayland' ,
48+ };
49+
50+ const deIcon = (de : string ): string | undefined => deIcons [de ];
51+
52+ const envIcon = (env : string ): string | undefined =>
53+ env === ' X11'
54+ ? currentTheme .value === ' latte'
55+ ? ' vscode-icons:file-type-light-xorg'
56+ : ' vscode-icons:file-type-xorg'
57+ : envBaseIcons [env ];
58+
2959const needsUserCreation = computed (() => {
3060 return (
3161 selectedDistro .value !== ' NixOS' && selectedDistro .value !== ' Arch Linux' &&
@@ -238,6 +268,7 @@ const chromiumWaylandFlags = computed(() =>
238268 <div class =" de-grid" >
239269 <div v-for =" de in deWms" :key =" de" class =" de-card" :class =" { active: selectedDe === de }" role =" button"
240270 tabindex =" 0" :aria-pressed =" selectedDe === de" @click =" selectedDe = de" @keydown.enter =" selectedDe = de" >
271+ <v-icon v-if =" deIcon(de)" :icon =" deIcon(de)" width =" 1.25em" height =" 1.25em" />
241272 <span >{{ de }}</span >
242273 </div >
243274 </div >
@@ -249,6 +280,7 @@ const chromiumWaylandFlags = computed(() =>
249280 <div v-for =" e in environments" :key =" e" class =" option-card" :class =" { active: selectedEnv === e }"
250281 role =" button" tabindex =" 0" :aria-pressed =" selectedEnv === e" @click =" selectedEnv = e"
251282 @keydown.enter =" selectedEnv = e" >
283+ <v-icon v-if =" envIcon(e)" :icon =" envIcon(e)" width =" 1.1em" height =" 1.1em" />
252284 <span >{{ e }}</span >
253285 </div >
254286 </div >
@@ -601,7 +633,7 @@ const chromiumWaylandFlags = computed(() =>
601633}
602634
603635.de-grid {
604- grid-template-columns : repeat (3 , 1fr );
636+ grid-template-columns : repeat (2 , 1fr );
605637}
606638
607639.option-grid {
@@ -651,7 +683,6 @@ const chromiumWaylandFlags = computed(() =>
651683 outline-offset : 2px ;
652684}
653685
654- /* Trạng thái Active - Chỉ đổi viền và chữ để không bị lóa mảng màu lớn */
655686.distro-card.active ,
656687.de-card.active ,
657688.option-card.active {
@@ -665,6 +696,12 @@ const chromiumWaylandFlags = computed(() =>
665696 flex-shrink : 0 ;
666697}
667698
699+ .de-card svg ,
700+ .option-card svg {
701+ flex-shrink : 0 ;
702+ margin-right : 6px ;
703+ }
704+
668705.distro-card span ,
669706.option-card span {
670707 font-size : 0.85rem ;
0 commit comments