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

TextBox widget ignores layout changes if text didn't change #4904

Open
2 tasks done
saviola777 opened this issue Jul 1, 2024 · 2 comments
Open
2 tasks done

TextBox widget ignores layout changes if text didn't change #4904

saviola777 opened this issue Jul 1, 2024 · 2 comments

Comments

@saviola777
Copy link
Contributor

saviola777 commented Jul 1, 2024

Issue description

Due to this code in the TextBox widget's update function

        if self.text == text:
            return

layout changes (like text color) are not applied unless the text changes.

See the discussion in #4905.

Version

0.26.1.dev0 ge4b4bb8b.d20240523

Backend

X11 (default)

Config

No response

Logs

No response

Required

  • I have searched past issues to see if this bug has already been reported, and it hasn't been.
  • I understand that people give their precious time for free, and thus I've done my very best to make this problem as easy as possible to investigate.
@elParaguayo
Copy link
Member

If it's meant to change colour depending on the playback status but doesn't then it's a bug. PR welcome.

saviola777 added a commit to saviola777/qtile that referenced this issue Jul 1, 2024
This fixes an issue in the Cmus widget where the text color would not
change to reflect the current playback status unless the song was
changed (qtile#4904).

The reason for the issue is that the TextBox widget only redraws the
widget if the text changes without checking if layout information like
text color have changed.

We work around this issue by forcing a redraw if the playback status
changed while the text stayed the same.
saviola777 added a commit to saviola777/qtile that referenced this issue Jul 2, 2024
This fixes an issue in the Cmus widget where the text color would not
change to reflect the current playback status unless the song was
changed (qtile#4904).

The reason for the issue is that the TextBox widget only redraws the widget if the text changes without checking if layout information like text color have changed.

We use the `_force_redraw` flag of the `TextWidget` to force a redraw
if the playback status changes to fix this.

Closes qtile#4904.
saviola777 added a commit to saviola777/qtile that referenced this issue Jul 2, 2024
This fixes an issue in the Cmus widget where the text color would not
change to reflect the current playback status unless the song was
changed (qtile#4904).

The reason for the issue is that the TextBox widget only redraws the
widget if the text changes without checking if layout information like
text color have changed.

We use the `_force_redraw` flag of the `TextWidget` to force a redraw
if the playback status changes to fix this.

Closes qtile#4904.
saviola777 added a commit to saviola777/qtile that referenced this issue Jul 8, 2024
This improves and extends the Cmus widget by

- replacing "play_icon" with "playing_text", "paused_text", and
  "stopped_text" which can be included depending on the current playback
  status using the "status_text" format variable,
- making "position", "duration", and "remaining" track information
  available in "[h:]mm:ss" format in the format string,
- adding information about all available format variables to the
  docstring,
- adding two additional format strings for streams and when no artist is
  available,
- replacing "play_color" and "noplay_color" with "playing_color",
  "paused_color", "stopped_color", and
- streamlining tests by replacing FakeBar approach with cmus_manager.

It provides a workaround for qtile#4904 because the text can now change
depending on the playback status.

It intends to keep full backwards compatibility with the exception of
showing the artist for non-local songs if available.
saviola777 added a commit to saviola777/qtile that referenced this issue Jul 8, 2024
This improves and extends the Cmus widget by

- replacing "play_icon" with "playing_text", "paused_text", and
  "stopped_text" which can be included depending on the current playback
  status using the "status_text" format variable,
- making "position", "duration", and "remaining" track information
  available in "[h:]mm:ss" format in the format string,
- adding information about all available format variables to the
  docstring,
- adding two additional format strings for streams and when no artist is
  available,
- replacing "play_color" and "noplay_color" with "playing_color",
  "paused_color", "stopped_color", and
- streamlining tests by replacing FakeBar approach with cmus_manager.

It provides a workaround for qtile#4904 because the text can now change
depending on the playback status.

It intends to keep full backwards compatibility with the exception of
showing the artist for non-local songs if available.
saviola777 added a commit to saviola777/qtile that referenced this issue Jul 10, 2024
This improves and extends the Cmus widget by

- replacing "play_icon" with "playing_text", "paused_text", and
  "stopped_text" which can be included depending on the current playback
  status using the "status_text" format variable,
- making "position", "duration", and "remaining" track information
  available in "[h:]mm:ss" format in the format string,
- adding information about all available format variables to the
  docstring,
- adding two additional format strings for streams and when no artist is
  available,
- replacing "play_color" and "noplay_color" with "playing_color",
  "paused_color", "stopped_color", and
- streamlining tests by replacing FakeBar approach with cmus_manager.

It provides a workaround for qtile#4904 because the text can now change
depending on the playback status.

It intends to keep full backwards compatibility with the exception of
showing the artist for non-local songs if available.
saviola777 added a commit to saviola777/qtile that referenced this issue Jul 10, 2024
This improves and extends the Cmus widget by

- replacing "play_icon" with "playing_text", "paused_text", and
  "stopped_text" which can be included depending on the current playback
  status using the "status_text" format variable,
- making "position", "duration", and "remaining" track information
  available in "[h:]mm:ss" format in the format string,
- adding information about all available format variables to the
  docstring,
- adding two additional format strings for streams and when no artist is
  available,
- replacing "play_color" and "noplay_color" with "playing_color",
  "paused_color", "stopped_color", and
- streamlining tests by replacing FakeBar approach with cmus_manager.

It provides a workaround for qtile#4904 because the text can now change
depending on the playback status.

It intends to keep full backwards compatibility with the exception of
showing the artist for non-local songs if available.
saviola777 added a commit to saviola777/qtile that referenced this issue Jul 16, 2024
This improves and extends the Cmus widget by

- replacing "play_icon" with "playing_text", "paused_text", and
  "stopped_text" which can be included depending on the current playback
  status using the "status_text" format variable,
- making "position", "duration", and "remaining" track information
  available in "[h:]mm:ss" format in the format string,
- adding information about all available format variables to the
  docstring,
- adding two additional format strings for streams and when no artist is
  available,
- replacing "play_color" and "noplay_color" with "playing_color",
  "paused_color", "stopped_color", and
- streamlining tests by replacing FakeBar approach with cmus_manager.

It provides a workaround for qtile#4904 because the text can now change
depending on the playback status.

It intends to keep full backwards compatibility with the exception of
showing the artist for non-local songs if available.
tych0 pushed a commit that referenced this issue Jul 16, 2024
This improves and extends the Cmus widget by

- replacing "play_icon" with "playing_text", "paused_text", and
  "stopped_text" which can be included depending on the current playback
  status using the "status_text" format variable,
- making "position", "duration", and "remaining" track information
  available in "[h:]mm:ss" format in the format string,
- adding information about all available format variables to the
  docstring,
- adding two additional format strings for streams and when no artist is
  available,
- replacing "play_color" and "noplay_color" with "playing_color",
  "paused_color", "stopped_color", and
- streamlining tests by replacing FakeBar approach with cmus_manager.

It provides a workaround for #4904 because the text can now change
depending on the playback status.

It intends to keep full backwards compatibility with the exception of
showing the artist for non-local songs if available.
@saviola777 saviola777 changed the title Cmus widget does not update text color to reflect playback status TextBox widget ignores layout changes if text didn't change Aug 10, 2024
@saviola777
Copy link
Contributor Author

I have updated the title and description to match the root issue, which was not fixed by my workaround for the cmus problem in #4916. Possible solutions have been discussed in #4905 but no consensus has been reached yet on how to best solve this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants