Use markup for bold instead of customer lables that don't always style nicely, closes #1 (& bump version)
This commit is contained in:
parent
519b783ae1
commit
64c0392af7
3 changed files with 15 additions and 19 deletions
|
@ -100,12 +100,9 @@ class PiHole extends panelMenu.Button
|
|||
// Add status popup
|
||||
|
||||
// .. status
|
||||
let box = new St.BoxLayout({style_class:'pihole-heading-row'});
|
||||
let label = new St.Label({style_class:'stage pihole-label', text:_("Pi-Hole Status") + ": "});
|
||||
box.add_actor(label);
|
||||
this.StatusField = new St.Label({style_class:'stage pihole-status', text:this.Status});
|
||||
box.add_actor(this.StatusField);
|
||||
this.addMenuItem(box);
|
||||
this.StatusField = new popupMenu.PopupMenuItem("", {style_class:"pihole-status-line"});
|
||||
this.setStatusText();
|
||||
this.menu.addMenuItem(this.StatusField);
|
||||
|
||||
// .. sep
|
||||
this.menu.addMenuItem(new popupMenu.PopupSeparatorMenuItem());
|
||||
|
@ -350,12 +347,20 @@ class PiHole extends panelMenu.Button
|
|||
|
||||
// Update statuses
|
||||
this.dprint("got status " + this.Status);
|
||||
this.StatusField.set_text( this.Status );
|
||||
this.setStatusText();
|
||||
this.setIcon();
|
||||
if (this.Status == "enabled")
|
||||
this.EnableDisableButton.label.set_text("Disable");
|
||||
this.EnableDisableButton.label.set_text(_("Disable"));
|
||||
else
|
||||
this.EnableDisableButton.label.set_text("Enable");
|
||||
this.EnableDisableButton.label.set_text(_("Enable"));
|
||||
}
|
||||
|
||||
|
||||
// Status text
|
||||
setStatusText()
|
||||
{
|
||||
let clutter_text = this.StatusField.label.get_clutter_text();
|
||||
clutter_text.set_markup( _("Pi-Hole Status") + ": <b>" + this.Status + "</b>" );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -6,5 +6,5 @@
|
|||
"description": "Status and basic controls of local Pi-Hole",
|
||||
"settings-schema": "org.gnome.shell.extensions.fnxweb-pi-hole",
|
||||
"gettext-domain": "gnome-shell-extension-fnxweb-pi-hole",
|
||||
"version": 4
|
||||
"version": 5
|
||||
}
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
.pihole-status
|
||||
{
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.pihole-indent
|
||||
{
|
||||
padding-left: 2ex;
|
||||
}
|
Loading…
Reference in a new issue