jasonsikes / QLogo

QLogo is a rewrite of the UCBLogo language and user interface written in C++ using Qt.

Home Page:https://qlogo.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

need "set console background color"

jasonsikes opened this issue · comments

The canvas has SETBACKGROUND.

UCBLogo has SETTEXTCOLOR where the foreground and background are applied to the entire text console.

Qt allows multiple colors in one text window (along with multiple fonts and sizes). However, changing the text background color looks weird because it doesn't apply to the characters already printed.

An attempt was made to mitigate that by applying the text background color to the empty space in the text-area (by use of QBrush and QPalette), but it's still incomplete.

QLogo needs a SETTEXTBACKGROUND so that the user has more flexibility to apply colors.

The initial font background color is transparent, but I had set it to the canvas background color on initialization. If we remove that, then the text background color will be transparent. That way, changing the background color will also change the background of the text already printed.

The complication is STANDOUT which simply switches the font foreground and background colors (and switches them back). Setting the text foreground to transparent causes the text to be invisible.