Fix button creation on gnome-shell 3.35.

The (private) function _createActionButton does not exist anymore.
master
Jens Lody 5 years ago
parent 6fb7d1ee61
commit 23e8a6e4f7
  1. 19
      data/stylesheet.css
  2. 27
      src/extension.js

@ -126,3 +126,22 @@ padding-right: 5px;
padding-left: 15px; padding-left: 15px;
padding-right: 5px; padding-right: 5px;
} }
.openweather-button-action {
-st-icon-style: symbolic;
border-radius: 32px;
margin: 0px;
min-height: 22px;
min-width: 22px;
padding: 10px;
font-size: 100%;
}
.openweather-button-action:hover,
.openweather-button-action:focus {
border: none;
padding: 11px;
}
.openweather-button-action > StIcon {
icon-size: 16px;
}

@ -698,24 +698,25 @@ class OpenweatherMenuButton extends PanelMenu.Button {
this._buttonMenu.remove_style_pseudo_class('active'); this._buttonMenu.remove_style_pseudo_class('active');
} }
createButton(iconName, accessibleName) { createButton(iconName, accessibleName) {
let button; let button;
button = new St.Button({
reactive: true,
can_focus: true,
track_hover: true,
accessible_name: accessibleName,
style_class: 'message-list-clear-button button openweather-button-action'
});
button.child = new St.Icon({
icon_name: iconName
});
if (ExtensionUtils.versionCheck(['3.8'], Config.PACKAGE_VERSION)) { if (ExtensionUtils.versionCheck(['3.8'], Config.PACKAGE_VERSION)) {
button = new St.Button({ button.style_class ='popup-menu-item openweather-button';
reactive: true,
can_focus: true,
track_hover: true,
accessible_name: accessibleName,
style_class: 'popup-menu-item openweather-button'
});
button.child = new St.Icon({
icon_name: iconName
});
button.connect('notify::hover', Lang.bind(this, this._onButtonHoverChanged)); button.connect('notify::hover', Lang.bind(this, this._onButtonHoverChanged));
} else }
button = Main.panel.statusArea.aggregateMenu._system._createActionButton(iconName, accessibleName);
return button; return button;
} }

Loading…
Cancel
Save