File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -147,6 +147,7 @@ void QLightTerminal::paintEvent(QPaintEvent *event) {
147147 return ;
148148 }
149149
150+ QFont font;
150151 QString line;
151152 uint32_t fgColor = 0 ;
152153 uint32_t bgColor = 0 ;
@@ -219,6 +220,20 @@ void QLightTerminal::paintEvent(QPaintEvent *event) {
219220
220221 if (g.mode & ATTR_INVISIBLE)
221222 fgColor = bgColor;
223+
224+ font = painter.font ();
225+
226+ if ((g.mode & ATTR_BOLD) && !font.bold ()) {
227+ font.setBold (true );
228+ } else if (!(g.mode & ATTR_BOLD) && font.bold ()) {
229+ font.setBold (false );
230+ }
231+
232+ if ((g.mode & ATTR_ITALIC) && !font.italic ()) {
233+ font.setItalic (true );
234+ } else if (!(g.mode & ATTR_ITALIC) && font.italic ()) {
235+ font.setItalic (false );
236+ }
222237 }
223238
224239 // draw current line state and change color
@@ -240,6 +255,7 @@ void QLightTerminal::paintEvent(QPaintEvent *event) {
240255
241256 line = QString ();
242257 changed = false ;
258+ painter.setFont (font);
243259 }
244260
245261 line += QChar (g.u );
You can’t perform that action at this time.
0 commit comments