Show generation icon and frequency band per AP row
This commit is contained in:
parent
b186c99efb
commit
9db21cd228
2 changed files with 18 additions and 17 deletions
|
|
@ -34,7 +34,6 @@ import {
|
||||||
type GenerationCssClass,
|
type GenerationCssClass,
|
||||||
type ChannelWidthMHz,
|
type ChannelWidthMHz,
|
||||||
type SignalDbm,
|
type SignalDbm,
|
||||||
type FrequencyBand,
|
|
||||||
type SpeedQuality,
|
type SpeedQuality,
|
||||||
type WifiGeneration,
|
type WifiGeneration,
|
||||||
} from './types.js';
|
} from './types.js';
|
||||||
|
|
@ -824,14 +823,6 @@ export default class WifiSignalPlusExtension extends Extension {
|
||||||
y_align: Clutter.ActorAlign.CENTER,
|
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
|
// Security badge
|
||||||
const secBadge = new St.Label({
|
const secBadge = new St.Label({
|
||||||
text: ap.security,
|
text: ap.security,
|
||||||
|
|
@ -874,9 +865,20 @@ export default class WifiSignalPlusExtension extends Extension {
|
||||||
|
|
||||||
const outerBox = new St.BoxLayout({ vertical: true, x_expand: true });
|
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 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({
|
const bssidLabel = new St.Label({
|
||||||
text: ap.bssid.toUpperCase(),
|
text: ap.bssid.toUpperCase(),
|
||||||
style_class: 'wifi-nearby-ap-bssid',
|
style_class: 'wifi-nearby-ap-bssid',
|
||||||
|
|
@ -885,6 +887,7 @@ export default class WifiSignalPlusExtension extends Extension {
|
||||||
infoRow.add_child(bssidLabel);
|
infoRow.add_child(bssidLabel);
|
||||||
|
|
||||||
const detailParts: string[] = [];
|
const detailParts: string[] = [];
|
||||||
|
detailParts.push(ap.band);
|
||||||
detailParts.push(`Ch ${ap.channel}`);
|
detailParts.push(`Ch ${ap.channel}`);
|
||||||
if ((ap.bandwidth as number) > 20) {
|
if ((ap.bandwidth as number) > 20) {
|
||||||
detailParts.push(`${ap.bandwidth} MHz`);
|
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 {
|
private clearNearbyItems(): void {
|
||||||
for (const item of this.nearbyItems) {
|
for (const item of this.nearbyItems) {
|
||||||
item.destroy();
|
item.destroy();
|
||||||
|
|
|
||||||
|
|
@ -156,6 +156,11 @@
|
||||||
icon-size: 16px;
|
icon-size: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.wifi-ap-gen-icon {
|
||||||
|
icon-size: 14px;
|
||||||
|
margin-right: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
.wifi-nearby-card-ssid {
|
.wifi-nearby-card-ssid {
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue