mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[code] The Python console compiles and executes commands entered.
It stores and displays the result in the console store. An empty line returned at the end of the execution is deleted. Change-Id: Ic90e02e2d91d0a0033413da0588032d9450aefd0
This commit is contained in:
@@ -1,4 +1,8 @@
|
||||
#include "console_line_cell.h"
|
||||
#include "console_controller.h"
|
||||
#include <kandinsky/point.h>
|
||||
#include <kandinsky/coordinate.h>
|
||||
#include <apps/i18n.h>
|
||||
|
||||
namespace Code {
|
||||
|
||||
@@ -9,8 +13,14 @@ ConsoleLineCell::ConsoleLineCell() :
|
||||
}
|
||||
|
||||
void ConsoleLineCell::drawRect(KDContext * ctx, KDRect rect) const {
|
||||
ctx->fillRect(bounds(), KDColorRed);
|
||||
ctx->drawString(m_line.text(), KDPointZero);
|
||||
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);
|
||||
} else {
|
||||
ctx->drawString(m_line.text(), KDPointZero, ConsoleController::k_fontSize);
|
||||
}
|
||||
}
|
||||
|
||||
void ConsoleLineCell::setLine(ConsoleLine line) {
|
||||
|
||||
Reference in New Issue
Block a user