Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sway: support workspace rename events #799

Merged
merged 1 commit into from
Dec 5, 2024

Conversation

quietvoid
Copy link
Contributor

Simple enough to propagate the event of the rename.
However I'm not sure how to fix the order on rename, it doesn't seem to work if I just add

if self.sort == SortOrder::Alphanumeric {
    reorder_workspaces(&container);
}

@quietvoid
Copy link
Contributor Author

quietvoid commented Dec 2, 2024

It seems the ordering relies on widget_name while we're only changing the label.
Not sure which should be done of:

  • Also changing widget_name and reorder
  • Reorder based on label

My workspaces are all numbers so both would work, but maybe there's an edge case with named workspaces.

@JakeStanger
Copy link
Owner

Hm, I can't think why it would need to be tied to the widget name. Sorting by label instead should be fine.

And reorder based on label with fallback to widget name
@quietvoid quietvoid marked this pull request as ready for review December 5, 2024 11:06
@quietvoid
Copy link
Contributor Author

Here we go. The reorder prioritizes the label if the widget is indeed a button, otherwise still uses the widget name.
I'm not too sure what other widgets are present in the container and if this could have a negative effect.
I think the workspace box is all buttons but I may be wrong.

Copy link
Owner

@JakeStanger JakeStanger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, LGTM. Everything in the container should always be a button, and should always have a label, but having the fallback is definitely good.

@JakeStanger JakeStanger merged commit 9f7c391 into JakeStanger:master Dec 5, 2024
5 checks passed
@quietvoid quietvoid deleted the sway_ws_rename branch December 5, 2024 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants