diff --git a/src/extension.ts b/src/extension.ts index 057cdd1..68033c6 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -34,7 +34,6 @@ import { type GenerationCssClass, type ChannelWidthMHz, type SignalDbm, - type FrequencyBand, type SpeedQuality, type WifiGeneration, } from './types.js'; @@ -824,14 +823,6 @@ export default class WifiSignalPlusExtension extends Extension { y_align: Clutter.ActorAlign.CENTER, }); - // Band badge - const bandBadge = new St.Label({ - text: this.formatBandShort(ap.band), - style_class: 'wifi-nearby-badge', - y_align: Clutter.ActorAlign.CENTER, - }); - box.add_child(bandBadge); - // Security badge const secBadge = new St.Label({ text: ap.security, @@ -874,9 +865,20 @@ export default class WifiSignalPlusExtension extends Extension { const outerBox = new St.BoxLayout({ vertical: true, x_expand: true }); - // Info row: BSSID + details + signal% + // Info row: generation + BSSID + details + signal% const infoRow = new St.BoxLayout({ x_expand: true }); + const genIconFilename = getGenerationIconFilename(ap.generation); + if (genIconFilename) { + const iconPath = GLib.build_filenamev([this.path, 'icons', genIconFilename]); + const genIcon = new St.Icon({ + gicon: new Gio.FileIcon({ file: Gio.File.new_for_path(iconPath) }), + style_class: 'wifi-ap-gen-icon', + y_align: Clutter.ActorAlign.CENTER, + }); + infoRow.add_child(genIcon); + } + const bssidLabel = new St.Label({ text: ap.bssid.toUpperCase(), style_class: 'wifi-nearby-ap-bssid', @@ -885,6 +887,7 @@ export default class WifiSignalPlusExtension extends Extension { infoRow.add_child(bssidLabel); const detailParts: string[] = []; + detailParts.push(ap.band); detailParts.push(`Ch ${ap.channel}`); if ((ap.bandwidth as number) > 20) { detailParts.push(`${ap.bandwidth} MHz`); @@ -961,13 +964,6 @@ export default class WifiSignalPlusExtension extends Extension { }); } - private formatBandShort(band: FrequencyBand): string { - if (band === '2.4 GHz') return '2.4G'; - if (band === '5 GHz') return '5G'; - if (band === '6 GHz') return '6G'; - return band; - } - private clearNearbyItems(): void { for (const item of this.nearbyItems) { item.destroy(); diff --git a/stylesheet.css b/stylesheet.css index ba05250..2a5dc6a 100644 --- a/stylesheet.css +++ b/stylesheet.css @@ -156,6 +156,11 @@ icon-size: 16px; } +.wifi-ap-gen-icon { + icon-size: 14px; + margin-right: 6px; +} + .wifi-nearby-card-ssid { font-weight: 500; }