Skip to content

Commit

Permalink
refactor: clean up TODO comments and improve tooltip positioning for …
Browse files Browse the repository at this point in the history
…workspace items
  • Loading branch information
ZanzyTHEbar committed Feb 19, 2025
1 parent f4c1e74 commit 4484386
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 36 deletions.
10 changes: 4 additions & 6 deletions gnome-extension/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@ import * as Main from 'resource:///org/gnome/shell/ui/main.js';
import * as PanelMenu from 'resource:///org/gnome/shell/ui/panelMenu.js';
import * as PopupMenu from 'resource:///org/gnome/shell/ui/popupMenu.js';

// TODO: Add notifications for errors
// TODO: Implement support for snap, and flatpak installations

// TODO: Show project tags
// TODO: View as tags
// TODO: Filter by tags
// TODO: Sort by Path, Recent, Saved
// TODO: Ability to mark as favorite
// TODO: Show favourites at the top separated by a separator
// TODO: Implement support for snap, and flatpak installations
// TODO: Add notifications for errors

interface Workspace {
uri: string;
Expand Down Expand Up @@ -383,7 +382,6 @@ export default class VSCodeWorkspacesExtension extends Extension {
}

private _createTrashButton(workspace: RecentWorkspace): St.Button {

const trashIcon = new St.Icon({
icon_name: 'user-trash-symbolic',
style_class: 'trash-icon',
Expand Down Expand Up @@ -434,7 +432,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.25), y);
tooltip.set_position(x - Math.floor(natWidth / 1) + 2, y);
Main.layoutManager.addChrome(tooltip);
});
item.actor.connect('leave-event', () => {
Expand Down
52 changes: 22 additions & 30 deletions gnome-extension/stylesheet.css
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,6 @@
.trash-icon {
color: inherit;
cursor: pointer;
margin-left: 5px;
margin-right: 5px;
font-size: 1.2em;

transition: color 0.2s;

-webkit-user-select: none;
-moz-user-select: none;
Expand All @@ -50,42 +45,40 @@
-webkit-touch-callout: none;
-webkit-tap-highlight-color: transparent;

display: inline-block;
vertical-align: middle;

-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;

font-family: 'Material Icons';
font-weight: normal;
font-style: normal;

font-size: 16px;
line-height: 1;
letter-spacing: normal;
text-rendering: optimizeLegibility;
text-transform: none;
white-space: nowrap;

word-wrap: normal;
direction: ltr;
text-align: left;
text-indent: 0;
text-shadow: none;
text-decoration: none;

height: 16px;
width: 16px;
height: 16px;
font-size: 1.2em;
color: #999;
transition: color 0.2s ease;
}

.icon-button:hover,
.icon-button:focus .trash-icon {
.icon-button:hover .trash-icon {
color: red;
transition: color 0.2s;
}

/* The star icon itself */
.favorite-icon {
color: inherit;
cursor: pointer;

-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;

-webkit-touch-callout: none;
-webkit-tap-highlight-color: transparent;
vertical-align: middle;

-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;

width: 16px;
height: 16px;
font-size: 1.2em;
Expand All @@ -98,9 +91,8 @@
color: #ffd700;
}

.icon-button:hover,
.icon-button:focus .favorite-icon {
color: #f0c020;
.icon-button:hover .favorite-icon {
color: #ffd700;
}

/* A horizontal container for label + favorite/trash icons */
Expand Down

0 comments on commit 4484386

Please sign in to comment.