@ -747,45 +747,6 @@ const OpenweatherMenuButton = new Lang.Class({
this . _settings . set _string ( OPENWEATHER _FC _API _KEY , v ) ;
} ,
_onButtonHoverChanged : function ( actor , event ) {
if ( actor . hover ) {
actor . add _style _pseudo _class ( 'hover' ) ;
actor . set _style ( this . _button _background _style ) ;
} else {
actor . remove _style _pseudo _class ( 'hover' ) ;
actor . set _style ( 'background-color:;' ) ;
if ( actor != this . _urlButton )
actor . set _style ( this . _button _border _style ) ;
}
} ,
_updateButtonColors : function ( ) {
if ( ! this . _needsColorUpdate )
return ;
this . _needsColorUpdate = false ;
let color ;
if ( ExtensionUtils . versionCheck ( [ '3.6' ] , Config . PACKAGE _VERSION ) )
color = this . _separatorItem . _drawingArea . get _theme _node ( ) . get _color ( '-gradient-end' ) ;
else
color = this . _separatorItem . _separator . actor . get _theme _node ( ) . get _color ( '-gradient-end' ) ;
let alpha = ( Math . round ( color . alpha / 2.55 ) / 100 ) ;
if ( color . red > 0 && color . green > 0 && color . blue > 0 )
this . _button _border _style = 'border:1px solid rgb(' + Math . round ( alpha * color . red ) + ',' + Math . round ( alpha * color . green ) + ',' + Math . round ( alpha * color . blue ) + ');' ;
else
this . _button _border _style = 'border:1px solid rgba(' + color . red + ',' + color . green + ',' + color . blue + ',' + alpha + ');' ;
this . _locationButton . set _style ( this . _button _border _style ) ;
this . _reloadButton . set _style ( this . _button _border _style ) ;
this . _prefsButton . set _style ( this . _button _border _style ) ;
this . _buttonMenu . actor . add _style _pseudo _class ( 'active' ) ;
color = this . _buttonMenu . actor . get _theme _node ( ) . get _background _color ( ) ;
this . _button _background _style = 'background-color:rgba(' + color . red + ',' + color . green + ',' + color . blue + ',' + ( Math . round ( color . alpha / 2.55 ) / 100 ) + ');' ;
this . _buttonMenu . actor . remove _style _pseudo _class ( 'active' ) ;
} ,
rebuildButtonMenu : function ( ) {
if ( this . _buttonBox ) {
if ( this . _buttonBox1 ) {
@ -838,10 +799,9 @@ const OpenweatherMenuButton = new Lang.Class({
style _class : 'openweather-button-box'
} ) ;
this . _urlButton = new St . Button ( {
label : _ ( "Weather data provided by:" ) + ( this . _use _text _on _buttons ? "\n" : " " ) + this . weatherProvider ,
style _class : 'system-menu-action openweather-provider'
} ) ;
this . _urlButton = Main . panel . statusArea . aggregateMenu . _system . _createActionButton ( '' , ( "Weather data provided by:" ) + ( this . _use _text _on _buttons ? "\n" : " " ) + this . weatherProvider ) ;
this . _urlButton . set _label ( this . _urlButton . get _accessible _name ( ) ) ;
this . _urlButton . style _class += ' openweather-provider' ;
this . _urlButton . connect ( 'clicked' , Lang . bind ( this , function ( ) {
this . menu . actor . hide ( ) ;
@ -939,7 +899,6 @@ const OpenweatherMenuButton = new Lang.Class({
recalcLayout : function ( ) {
if ( ! this . menu . isOpen )
return ;
this . _updateButtonColors ( ) ;
if ( this . _buttonBox1MinWidth === undefined )
this . _buttonBox1MinWidth = this . _buttonBox1 . get _width ( ) ;
this . _buttonBox1 . set _width ( Math . max ( this . _buttonBox1MinWidth , this . _currentWeather . get _width ( ) - this . _buttonBox2 . get _width ( ) ) ) ;
@ -1085,12 +1044,7 @@ const OpenweatherMenuButton = new Lang.Class({
load _json _async : function ( url , params , fun ) {
if ( _httpSession === undefined ) {
if ( ExtensionUtils . versionCheck ( [ '3.6' ] , Config . PACKAGE _VERSION ) ) {
// Soup session (see https://bugzilla.gnome.org/show_bug.cgi?id=661323#c64) (Simon Legner)
_httpSession = new Soup . SessionAsync ( ) ;
Soup . Session . prototype . add _feature . call ( _httpSession , new Soup . ProxyResolverDefault ( ) ) ;
} else
_httpSession = new Soup . Session ( ) ;
_httpSession = new Soup . Session ( ) ;
}
let message = Soup . form _request _new _from _hash ( 'GET' , url , params ) ;