Skip to content

Commit

Permalink
fix: remove unused combo box button and related event handling for re…
Browse files Browse the repository at this point in the history
…cent workspaces
  • Loading branch information
ZanzyTHEbar committed Feb 17, 2025
1 parent 34384fa commit 7a347df
Showing 1 changed file with 12 additions and 22 deletions.
34 changes: 12 additions & 22 deletions gnome-extension/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,16 +227,10 @@ export default class VSCodeWorkspacesExtension extends Extension {

(this._indicator.menu as PopupMenu.PopupMenu).removeAll();

const comboBoxMenuItem = new PopupMenu.PopupBaseMenuItem({
reactive: true,
});

this._createRecentWorkspacesMenu();

(this._indicator.menu as PopupMenu.PopupMenu).addMenuItem(new PopupMenu.PopupSeparatorMenuItem());

(this._indicator.menu as PopupMenu.PopupMenu).addMenuItem(comboBoxMenuItem);

// Add Settings and Quit items
const itemSettings = new PopupMenu.PopupSubMenuMenuItem('Settings');
const itemClearWorkspaces = new PopupMenu.PopupMenuItem('Clear Workspaces');
Expand Down Expand Up @@ -343,20 +337,20 @@ export default class VSCodeWorkspacesExtension extends Extension {
return;
}

const comboBoxButton: St.Button = new St.Button({
label: 'Workspaces',
style_class: 'workspace-combo-button',
reactive: true,
can_focus: true,
track_hover: true,
});
//const comboBoxButton: St.Button = new St.Button({
// label: 'Workspaces',
// style_class: 'workspace-combo-button',
// reactive: true,
// can_focus: true,
// track_hover: true,
//});

const comboBoxSubMenu = new PopupMenu.PopupSubMenuMenuItem('Recent Workspaces');
const comboBoxMenu = comboBoxSubMenu.menu;

comboBoxButton.connect('clicked', (_button: St.Button) => {
comboBoxMenu.toggle();
});
//comboBoxButton.connect('clicked', (_button: St.Button) => {
// comboBoxMenu.toggle();
//});

// Create the PopupMenu for the ComboBox items
Array.from(this._recentWorkspaces).forEach(workspace => {
Expand Down Expand Up @@ -407,7 +401,7 @@ export default class VSCodeWorkspacesExtension extends Extension {
item.add_child(trashButton);

item.connect('activate', () => {
comboBoxButton.label = workspace.name;
//comboBoxButton.label = workspace.name;
this._openWorkspace(workspace.path);
});

Expand All @@ -416,11 +410,7 @@ export default class VSCodeWorkspacesExtension extends Extension {

comboBoxSubMenu.menu.open(true);

const comboBoxMenuItem = new PopupMenu.PopupBaseMenuItem({
reactive: true,
});
comboBoxMenuItem.actor.add_child(comboBoxButton);
(this._indicator?.menu as PopupMenu.PopupMenu).addMenuItem(comboBoxMenuItem);
//comboBoxMenuItem.actor.add_child(comboBoxButton);

(this._indicator?.menu as PopupMenu.PopupMenu).addMenuItem(comboBoxSubMenu);
}
Expand Down

0 comments on commit 7a347df

Please sign in to comment.