Skip to content

Commit

Permalink
Use correct Clutter classes
Browse files Browse the repository at this point in the history
  • Loading branch information
mackdk committed Oct 8, 2024
1 parent 46a8cbc commit 3dc7523
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/main/typescript/widget/GitHubWidget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export class GitHubWidget extends Button {
private readonly label: St.Label;

public constructor(defaultIcon: Gio.Icon, initialText: string = '') {
super(0, 'GithubManagerButton', true);
super(0.5, 'GithubManagerButton', true);

this.styleClass = 'github-widget-button';

Expand Down
11 changes: 7 additions & 4 deletions src/main/typescript/widget/WidgetController.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import Clutter from '@girs/clutter-15';
import Gdk from '@girs/gdk-4.0';
import Gio from '@girs/gio-2.0';
import { Extension } from '@girs/gnome-shell/dist/extensions/extension';
Expand All @@ -22,7 +23,7 @@ export class WidgetController implements Disposable {
public constructor(settings: SettingsWrapper, eventDispatcher: EventDispatcher, githubIcon: Gio.Icon) {
this.settings = settings;
this.widget = new GitHubWidget(githubIcon, '0');
this.buttonPressId = this.widget.connect('button-press-event', (_: this, event: Gdk.ButtonEvent) =>
this.buttonPressId = this.widget.connect('button-press-event', (_: this, event: Clutter.Event): boolean =>
this.handleButtonPress(event)
);

Expand Down Expand Up @@ -51,9 +52,9 @@ export class WidgetController implements Disposable {
this.widget.text = text;
}

private handleButtonPress(event: Gdk.ButtonEvent): void {
private handleButtonPress(event: Clutter.Event): boolean {
switch (event.get_button()) {
case Gdk.BUTTON_PRIMARY:
case Clutter.BUTTON_PRIMARY:
try {
let url = `https://${this.settings.domain}/notifications`;
if (this.settings.showParticipatingOnly) {
Expand All @@ -65,10 +66,12 @@ export class WidgetController implements Disposable {
WidgetController.LOGGER.error('Cannot open uri', e);
}
break;
case Gdk.BUTTON_SECONDARY:
case Clutter.BUTTON_SECONDARY:
this.openPreferences();
break;
}

return true;
}

private updateNotificationCount(notificationCount?: number): void {
Expand Down

0 comments on commit 3dc7523

Please sign in to comment.