@ -30,6 +30,7 @@
*
* /
const Gtk = imports . gi . Gtk ;
const Gdk = imports . gi . Gdk ;
const GObject = imports . gi . GObject ;
const Gettext = imports . gettext . domain ( 'gnome-shell-extension-openweather' ) ;
const _ = Gettext . gettext ;
@ -185,7 +186,7 @@ const WeatherPrefsWidget = new GObject.Class({
this . searchMenu . append ( item ) ;
this . searchMenu . show _all ( ) ;
this . searchMenu . popup ( null , null , Lang . bind ( this , this . placeSearchMenu ) , 0 , this . searchName ) ;
this . searchMenu . popup _at _widget ( this . searchName , Gdk . Gravity . SOUTH _WEST , Gdk . Gravity . NORTH _WEST , null ) ;
if ( this . geolocation _provider == GeolocationProvider . OPENSTREETMAPS ) {
let params = {
@ -225,7 +226,7 @@ const WeatherPrefsWidget = new GObject.Class({
}
}
this . searchMenu . show _all ( ) ;
this . searchMenu . popup ( null , null , Lang . bind ( this , this . placeSearchMenu ) , 0 , this . searchName ) ;
this . searchMenu . popup _at _widget ( this . searchName , Gdk . Gravity . SOUTH _WEST , Gdk . Gravity . NORTH _WEST , null ) ;
return 0 ;
} ) ) ;
} else if ( this . geolocation _provider == GeolocationProvider . MAPQUEST ) {
@ -240,7 +241,7 @@ const WeatherPrefsWidget = new GObject.Class({
} ) ;
this . searchMenu . append ( item ) ;
this . searchMenu . show _all ( ) ;
this . searchMenu . popup ( null , null , Lang . bind ( this , this . placeSearchMenu ) , 0 , this . searchName ) ;
this . searchMenu . popup _at _widget ( this . searchName , Gdk . Gravity . SOUTH _WEST , Gdk . Gravity . NORTH _WEST , null ) ;
return 0 ;
}
let params = {
@ -289,7 +290,7 @@ const WeatherPrefsWidget = new GObject.Class({
}
}
this . searchMenu . show _all ( ) ;
this . searchMenu . popup ( null , null , Lang . bind ( this , this . placeSearchMenu ) , 0 , this . searchName ) ;
this . searchMenu . popup _at _widget ( this . searchName , Gdk . Gravity . SOUTH _WEST , Gdk . Gravity . NORTH _WEST , null ) ;
return 0 ;
} ) ) ;
} else if ( this . geolocation _provider == GeolocationProvider . GEOCODE ) {
@ -338,7 +339,7 @@ const WeatherPrefsWidget = new GObject.Class({
}
this . searchMenu . show _all ( ) ;
this . searchMenu . popup ( null , null , Lang . bind ( this , this . placeSearchMenu ) , 0 , this . searchName ) ;
this . searchMenu . popup _at _widget ( this . searchName , Gdk . Gravity . SOUTH _WEST , Gdk . Gravity . NORTH _WEST , null ) ;
return 0 ;
} ) ) ;
}
@ -423,12 +424,6 @@ const WeatherPrefsWidget = new GObject.Class({
this . searchName . set _text ( arguments [ 0 ] . get _label ( ) ) ;
} ,
placeSearchMenu : function ( ) {
let [ gx , gy , gw , gh ] = this . searchName . get _window ( ) . get _geometry ( ) ;
let [ px , py ] = this . searchName . get _window ( ) . get _position ( ) ;
return [ gx + px , gy + py + this . searchName . get _allocated _height ( ) ] ;
} ,
clearSearchMenu : function ( ) {
let children = this . searchMenu . get _children ( ) ;
for ( let i in children ) {