From 5aee2cb9f2085884eef7c4ab0e87af71bce53f6e Mon Sep 17 00:00:00 2001 From: Benjamin Drieu Date: Fri, 22 Apr 2022 11:22:38 +0200 Subject: [PATCH] Be case insenstitive --- extension.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/extension.js b/extension.js index 4255397..0638038 100644 --- a/extension.js +++ b/extension.js @@ -164,6 +164,7 @@ class Indicator extends PanelMenu.Button { }); this._searchField.connect('secondary-icon-clicked', Lang.bind(this, this._onSearchFieldActivate ) ); this._searchField.clutter_text.connect('activate', Lang.bind(this, this._onSearchFieldActivate ) ); + this._searchField.clutter_text.connect('text-changed', Lang.bind(this, this._onSearchFieldActivate ) ); this._buttonMenu.actor.add_child (this._searchField); @@ -444,9 +445,9 @@ class Indicator extends PanelMenu.Button { for ( let entry of processedStatus ) { if ( this._searchString && - ! ( entry [ 'host_name' ].includes ( this._searchString ) || - entry [ 'service_display_name' ].includes ( this._searchString ) || - entry [ 'status_information' ].includes ( this._searchString ) ) ) + ! ( entry [ 'host_name' ].toLowerCase().includes ( this._searchString ) || + entry [ 'service_display_name' ].toLowerCase().includes ( this._searchString ) || + entry [ 'status_information' ].toLowerCase().includes ( this._searchString ) ) ) continue; if ( ( ! _status [ 'WARNING' ] && ! _status [ 'CRITICAL' ] && ! _status [ 'UNKNOWN' ] && entry.status == 'OK' ) || @@ -532,7 +533,7 @@ class Indicator extends PanelMenu.Button { _onSearchFieldActivate ( e ) { monitoLog ( 'Search: ' + e.text ); - this._searchString = e.text; + this._searchString = e.text.toLowerCase(); this.refreshUI ( ); return; }