Skip to content

Fix opacity not applying to text fragment backgrounds#48

Open
Brayozin wants to merge 2 commits intoSwordfish90:masterfrom
Brayozin:fix/opacity-rendering
Open

Fix opacity not applying to text fragment backgrounds#48
Brayozin wants to merge 2 commits intoSwordfish90:masterfrom
Brayozin:fix/opacity-rendering

Conversation

@Brayozin
Copy link
Copy Markdown

@Brayozin Brayozin commented Apr 3, 2026

Summary

  • Move setOpacity from public: to public slots: so it can be
    called from QML and connected to signals
  • Add update() to setOpacity so changing opacity triggers a repaint
  • Pass useOpacitySetting=true in drawTextFragment so text cells with
    non-default background colors (e.g. highlighted text, colored output)
    also respect the configured opacity level — previously only the default
    background was affected

Before and after on my custom terminal widget on quickshell:

BEFORE:

image

AFTER:

image

Test plan

  • Set a sub-1.0 opacity value via setOpacity() and confirm the
    terminal background renders semi-transparent
  • Run a command that produces colored output (e.g. ls --color) and
    confirm the colored cell backgrounds are also semi-transparent, not
    opaque
  • Confirm that full-opacity (1.0) rendering is unchanged — no
    visual difference from before
  • Connect setOpacity to a QML signal and confirm it fires correctly
    without needing a manual update() call

Brayozin added 2 commits April 3, 2026 00:29
Move setOpacity to public slots so it is callable from QML and
connectable to signals, add update() so opacity changes repaint
immediately, and pass useOpacitySetting=true when drawing text
fragment backgrounds so colored backgrounds respect the opacity level
Changed the background drawing logic in drawTextFragment to not use transparency, ensuring consistent rendering of text backgrounds on different applications
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.

1 participant