mirror of
https://github.com/Swordfish90/cool-retro-term.git
synced 2025-02-23 13:28:44 +00:00
37 lines
847 B
C++
37 lines
847 B
C++
|
#include "text_style.h"
|
||
|
|
||
|
#include "screen.h"
|
||
|
#include "text.h"
|
||
|
|
||
|
#include <QtCore/QDebug>
|
||
|
|
||
|
TextStyle::TextStyle()
|
||
|
: style(Normal)
|
||
|
, forground(ColorPalette::DefaultForground)
|
||
|
, background(ColorPalette::DefaultBackground)
|
||
|
{
|
||
|
|
||
|
}
|
||
|
|
||
|
bool TextStyle::isCompatible(const TextStyle &other) const
|
||
|
{
|
||
|
return forground == other.forground
|
||
|
&& background == other.background
|
||
|
&& style == other.style;
|
||
|
}
|
||
|
|
||
|
QDebug operator<<(QDebug debug, TextStyleLine line)
|
||
|
{
|
||
|
debug << "[" << line.start_index << "(" << line.style << ":" << line.forground << ":" << line.background << ")" << line.end_index << "]";
|
||
|
return debug;
|
||
|
}
|
||
|
|
||
|
void TextStyleLine::releaseTextSegment(Screen *screen)
|
||
|
{
|
||
|
if (text_segment) {
|
||
|
text_segment->setVisible(false);
|
||
|
screen->releaseTextSegment(text_segment);
|
||
|
text_segment = 0;
|
||
|
}
|
||
|
}
|