const St       = imports.gi.St;
const Main     = imports.ui.main;
const Lang     = imports.lang;
const Clutter  = imports.gi.Clutter;
const PanelMenu = imports.ui.panelMenu;
Â
const TestIndicator = new Lang.Class({
   Name: 'TestIndicator',
   Extends: PanelMenu.Button,
Â
   _init: function () {
       this.parent(0.0, "Test Indicator", false);
       this.buttonText = new St.Label({
           text: _("Test..."),
           y_align: Clutter.ActorAlign.CENTER
       });
   this.actor.connect('button-press-event', this._showData);
   //this.actor.connect('enter-event', this._showData);
   this.actor.connect('leave-event', this._hideData);
   this.actor.add_actor(this.buttonText);
   },
Â
   _showData: function () {
       this.label = new St.Label({ style_class: 'test-label', text: "TEST" });
       let monitor = Main.layoutManager.primaryMonitor;
Â
       this.label.set_position(Math.floor(monitor.width / 2 - this.label.width / 2),
                               Math.floor(monitor.height / 2 - this.label.height / 2));
       Main.uiGroup.add_actor(this.label);
  Â
   },
Â
   _hideData: function () {
       if (Main.uiGroup.contains(this.label)) {
           Main.uiGroup.remove_actor(this.label);
       }
   },
Â
   stop: function() {
       this.menu.removeAll();
   }
});
Â
function init() {
}
Â
function enable() {
   testIndicator = new TestIndicator;
   Main.panel.addToStatusArea('test-indicator', testIndicator);
}
Â
function disable() {
   testIndicator.stop();
   testIndicator.destroy();
}
Â
=============
metadata.json
==============
Â
{"shell-version": ["3.10", "3.14", "3.18"], "uuid": "test", "name": "test", "description": "shows test label"}
Â
==============
stylesheet.css
==============
Â
.test-label {
   font-size: 36px;
   font-weight: bold;
   color: #DC143C;
   background-color: rgba(10,10,10,0.7);
   border-radius: 5px;
   padding: .5em;
}
Â