Skip to content

Commit

Permalink
refactor: remove unnecessary comments and adjust tooltip positioning …
Browse files Browse the repository at this point in the history
…for improved clarity
  • Loading branch information
ZanzyTHEbar committed Feb 19, 2025
1 parent 4484386 commit 3533a34
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions gnome-extension/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,6 @@ export default class VSCodeWorkspacesExtension extends Extension {
style_class: 'favorite-icon',
});

// If the workspace is already favorited, apply the .is-favorited class
if (this._favorites.has(workspace.path)) {
starIcon.add_style_class_name('is-favorited');
}
Expand All @@ -370,10 +369,8 @@ export default class VSCodeWorkspacesExtension extends Extension {
this._toggleFavorite(workspace);

if (this._favorites.has(workspace.path)) {
// Mark as favorited
starIcon.add_style_class_name('is-favorited');
} else {
// Un-favorited
starIcon.remove_style_class_name('is-favorited');
}
});
Expand Down Expand Up @@ -432,7 +429,7 @@ export default class VSCodeWorkspacesExtension extends Extension {
tooltip = new St.Label({ text: this._get_full_path(workspace), style_class: 'workspace-tooltip' });
const [x, y] = item.actor.get_transformed_position();
const [minWidth, natWidth] = tooltip.get_preferred_width(-1);
tooltip.set_position(x - Math.floor(natWidth / 1) + 2, y);
tooltip.set_position(x - Math.floor(natWidth / 1.15), y);
Main.layoutManager.addChrome(tooltip);
});
item.actor.connect('leave-event', () => {
Expand Down

0 comments on commit 3533a34

Please sign in to comment.