Skip to content

Commit

Permalink
Further fixes for GNOME 3.38
Browse files Browse the repository at this point in the history
  • Loading branch information
pulb committed Oct 16, 2020
1 parent d0deb40 commit 90b2d1f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
18 changes: 10 additions & 8 deletions indicator.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,9 @@ class IndicatorMailMenuItem extends PopupMenu.PopupBaseMenuItem {
hbox2.add(senderLabel);

if (showDates) {
this._dateLabel = new St.Label({ text: Util.formatTime(new Date(datetime * 1000)), style_class: 'mailnag-date-label' });
hbox2.add(this._dateLabel, { y_expand: true, x_expand: false, x_align: St.Align.END });
this._dateLabel = new St.Label({ text: Util.formatTime(new Date(datetime * 1000)), style_class: 'mailnag-date-label',
y_expand: true, x_expand: false, x_align: Clutter.ActorAlign.END });
hbox2.add(this._dateLabel);
}

this._closeButton = new St.Button({ reactive: true, can_focus: true, visible: false, track_hover: true });
Expand Down Expand Up @@ -184,11 +185,11 @@ class MailnagIndicator extends PanelMenu.Button {
this.setMails([]);
}

vfunc_allocate(box, flags) {
super.vfunc_allocate(box, flags);
vfunc_allocate(box) {
super.vfunc_allocate(box);

// the iconBin should fill our entire box
this._iconBin.allocate(box, flags);
this._iconBin.allocate(box);

// get the allocation box of the indicator icon
let iconBox = this._iconBin.child.first_child.get_allocation_box();
Expand All @@ -211,7 +212,7 @@ class MailnagIndicator extends PanelMenu.Button {
childBox.y1 = iconBox.y2 - (naturalHeight / 2) - 1;
childBox.y2 = childBox.y1 + naturalHeight;

this._counterBin.allocate(childBox, flags);
this._counterBin.allocate(childBox);
}

_updateMenu(mails) {
Expand Down Expand Up @@ -363,10 +364,11 @@ class MailnagIndicator extends PanelMenu.Button {
if (remainingMails.length > 0) {
let hbox = new St.BoxLayout({ vertical: false, x_expand: true, style_class: 'generic-box' });
let str = "%d/%d".format(mails.length, mails.length + remainingMails.length);
let bin = new St.Bin({ style_class: 'overflow-badge', child: new St.Label( { text: str } ) });
let bin = new St.Bin({ style_class: 'overflow-badge', child: new St.Label( { text: str } ),
y_expand: true, x_expand: false, x_align: Clutter.ActorAlign.END });

hbox.add(label);
hbox.add(bin, { y_expand: true, x_expand: false, x_align: St.Align.END });
hbox.add(bin);
item.actor.add_child(hbox);
} else {
item.actor.add_child(label);
Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"shell-version": ["3.36", "3.38"],
"shell-version": ["3.38"],
"uuid": "[email protected]",
"settings-schema": "org.gnome.shell.extensions.mailnag",
"gettext-domain": "mailnag-gnome-shell",
Expand Down

0 comments on commit 90b2d1f

Please sign in to comment.