Hide indicator when not connected to Wi-Fi
This commit is contained in:
parent
b5099781eb
commit
8b1f1b3973
1 changed files with 4 additions and 6 deletions
|
|
@ -21,7 +21,6 @@ import {
|
||||||
type ConnectedInfo,
|
type ConnectedInfo,
|
||||||
} from './wifiInfo.js';
|
} from './wifiInfo.js';
|
||||||
import {
|
import {
|
||||||
WIFI_GENERATIONS,
|
|
||||||
GENERATION_CSS_CLASSES,
|
GENERATION_CSS_CLASSES,
|
||||||
getGenerationLabel,
|
getGenerationLabel,
|
||||||
getGenerationDescription,
|
getGenerationDescription,
|
||||||
|
|
@ -325,18 +324,17 @@ export default class WifiSignalPlusExtension extends Extension {
|
||||||
}
|
}
|
||||||
|
|
||||||
private updateIndicatorLabel(info: WifiConnectionInfo): void {
|
private updateIndicatorLabel(info: WifiConnectionInfo): void {
|
||||||
if (!this.icon || !this.label) return;
|
if (!this.indicator || !this.icon || !this.label) return;
|
||||||
|
|
||||||
this.clearGenerationStyles();
|
this.clearGenerationStyles();
|
||||||
|
|
||||||
if (!isConnected(info)) {
|
if (!isConnected(info)) {
|
||||||
this.icon.visible = false;
|
this.indicator.visible = false;
|
||||||
this.label.visible = true;
|
|
||||||
this.label.set_text('WiFi --');
|
|
||||||
this.label.add_style_class_name(GENERATION_CSS_CLASSES[WIFI_GENERATIONS.UNKNOWN]);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.indicator.visible = true;
|
||||||
|
|
||||||
const iconFilename = getGenerationIconFilename(info.generation);
|
const iconFilename = getGenerationIconFilename(info.generation);
|
||||||
if (iconFilename) {
|
if (iconFilename) {
|
||||||
const iconPath = GLib.build_filenamev([this.path, 'icons', iconFilename]);
|
const iconPath = GLib.build_filenamev([this.path, 'icons', iconFilename]);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue