mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[code] Navigation in the console history.
The user can copy previous commands or results, into the clipboard or in the console prompt. Change-Id: I280fff2d4937f4d17ab6c8907d6e5c359a322372
This commit is contained in:
@@ -13,13 +13,14 @@ ConsoleLineCell::ConsoleLineCell() :
|
||||
}
|
||||
|
||||
void ConsoleLineCell::drawRect(KDContext * ctx, KDRect rect) const {
|
||||
KDColor textBackgroundColor = isHighlighted() ? Palette::Select : KDColorWhite;
|
||||
ctx->fillRect(bounds(), KDColorWhite);
|
||||
if (m_line.type() == ConsoleLine::Type::Command) {
|
||||
ctx->drawString(I18n::translate(I18n::Message::ConsolePrompt), KDPointZero, ConsoleController::k_fontSize);
|
||||
KDCoordinate chevronsWidth = KDText::stringSize(I18n::translate(I18n::Message::ConsolePrompt), ConsoleController::k_fontSize).width();
|
||||
ctx->drawString(m_line.text(), KDPoint(chevronsWidth, KDCoordinate(0)), ConsoleController::k_fontSize);
|
||||
ctx->drawString(m_line.text(), KDPoint(chevronsWidth, KDCoordinate(0)), ConsoleController::k_fontSize, KDColorBlack, textBackgroundColor);
|
||||
} else {
|
||||
ctx->drawString(m_line.text(), KDPointZero, ConsoleController::k_fontSize);
|
||||
ctx->drawString(m_line.text(), KDPointZero, ConsoleController::k_fontSize, KDColorBlack, textBackgroundColor);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user