72d604c6 refactored terminal color handling. This breaks changing
scrollbar colors at runtime for non-Breeze widget styles, since the
relevant `QEvents` will only be handled by `QWidget`-based classes, but
not by the `QObject`-based class the code was moved to.
Moving the event handling back will fix the issue.
Test Plan:
- start Konsole with Fusion widget style
- change application color scheme from dark to light: scrollbar color
should match widget colors, without having to restart Konsole
2a71f063 changed the scrollbar background to match the terminal color
scheme. This looks fine for the Breeze widget style, but fails for
non-Breeze styles such as Fusion or Plastique. Sometimes scrollbars
would be only barely visible, in other cases the scrollbar would look
really out of place (e.g. very dark scrollbar on white terminal
background with light widget colors).
92e19c63 then unconditionally removed the color matching functionality,
so scrollbars would always use the (as of dc8ad830 application-specific)
widget color scheme. This solves the accessibily issues, but might be
considered a step backwards for Breeze trying to blend into the app's content.
In !402 adding a configuration toggle to let users disable color
matching was turned down. Instead, automatically switching behavior
depending on the current widget style was suggested. Obviously this is
less than ideal from a maintenance perspective and might look like magic
for users, but seems like the best option left at this point.
After this patch, Breeze users will get scrollbar colors matched to the
terminal color scheme as intended in 2a71f063. Scrollbars of non-Breeze
users will be colored according to the widget color scheme as
implemented in 92e19c63, which is also how it looked before 2a71f063
landed. Changing widget styles at runtime is fully supported.
Implementation-wise, note that `MenuStyle` is a `QProxyStyle` applied to
the whole application, which slightly affects how to determine the
current widget style in use.
In the future, styles shall only be added to the allowlist if they look
good with both light and dark terminal background colors (e.g Fusion
currently does not qualify, because while the scrollbar might look
acceptable with a dark background, the coloring algorithm in Konsole
does not provide adequate scrollbar coloring with light backgrounds).
Test Plan:
- start Konsole with Breeze widget style
- change background color in terminal profile from black to white:
scrollbar color should match terminal background
- change application color scheme from light to dark: scrollbar color
should be unaffected
- change widget style to Fusion in "kcmshell5 kcm_style"
- change background color in terminal profile from white to black:
scrollbar color should be unaffected
- change application color scheme from dark to light: scrollbar color
should match widget colors
(The last step will only work without restarting Konsole once the third
patch in this series has been applied.)
This reverts commit 92e19c6305.
The code to adapt the scrollbar color to the terminal color scheme will
still be needed in a subsequent patch. There it will be restricted to
the Breeze widget style and thus retain the behavior of the reverted
patch for non-Breeze styles.
Cursor Position Report should return coordinates relative to the top
margin if DEC Origin Mode is set.
From esctest:
CUPTests.test_CUP_RespectsOriginMode
From esctest:
ANSIRCTests.test_SaveRestoreCursor_ResetsOriginMode
DECRCTests.test_SaveRestoreCursor_ResetsOriginMode
DECSETTiteInhibitTests.test_SaveRestoreCursor_ResetsOriginMode
RIS (ESC c) - Hard Reset should move the cursor to (1,1) and clear tab
stops.
From esctest:
RISTests.test_RIS_CursorToOrigin
RISTests.test_RIS_ResetTabs
- bison warnings include an ID part in the URLs,
- this comes from libtextstyle
The effect was that Konsole would look at d=<hex>;https://..<url>
as the whole URL, and discard it. Instead, do not assume that
the id-part is empty but discard up to the ; instead.
Other terminals (VTE, Terminology) send the DECRPTUI hex response to DA3
in uppercase, Christian Persch's esctest fork
(https://gitlab.gnome.org/chpe/esctest/) expects uppercase.
Using an escape sequence, e.g. printf '\e]50;CursorShape=1\a', to change
the cursor shape property like we handle DECSCUSR, i.e. as a transient
change without creating a new profile (see
SessionManager::sessionProfileCommandReceived()).
To test:
- printf '\e]50;CursorShape=1\a' to change the cursor shape, check that the
current profile hasn't been switched to a new profile (that has no name
as it's a temp profile)
BUG: 445590
FIXED-IN: 21.12
Current code was neither updating the search result rect (so the dirty
calculation missed it), nor did it correctly stick to the content rect
and left random blue rects at the edges.
This is a function that's completely related to character
and has nothing to do with painting, so the correct place
for it is on the Character class.
This will make testing easier, too.