From 248b15c25f924c56da457ed144050e65013335b0 Mon Sep 17 00:00:00 2001 From: Pete Beardmore Date: Sun, 4 Mar 2018 10:17:31 +0000 Subject: fbrun, add horizontal padding option --- util/fbrun/FbRun.cc | 6 ++++++ util/fbrun/FbRun.hh | 2 ++ util/fbrun/main.cc | 6 ++++++ 3 files changed, 14 insertions(+) diff --git a/util/fbrun/FbRun.cc b/util/fbrun/FbRun.cc index b5effd6..5404e69 100644 --- a/util/fbrun/FbRun.cc +++ b/util/fbrun/FbRun.cc @@ -62,6 +62,7 @@ FbRun::FbRun(int x, int y, size_t width): m_font("fixed"), m_display(FbTk::App::instance()->display()), m_bevel(4), + m_padding(0), m_gc(*this), m_end(false), m_current_history_item(0), @@ -251,6 +252,11 @@ void FbRun::resize(unsigned int width, unsigned int height) { FbTk::TextBox::resize(width, height); } +void FbRun::setPadding(int padding) { + m_padding = padding; + FbTk::TextBox::setPadding(padding); +} + void FbRun::redrawLabel() { clear(); } diff --git a/util/fbrun/FbRun.hh b/util/fbrun/FbRun.hh index e351d28..dbba415 100644 --- a/util/fbrun/FbRun.hh +++ b/util/fbrun/FbRun.hh @@ -43,6 +43,7 @@ public: void resize(unsigned int width, unsigned int height); void setPrint(bool print) { m_print = print; } void setAutocomplete(bool complete) { m_autocomplete = complete; } + void setPadding(int padding); /// load and reconfigure for new font bool loadFont(const std::string &fontname); @@ -89,6 +90,7 @@ private: FbTk::Font m_font; ///< font used to draw command text Display *m_display; ///< display connection int m_bevel; + int m_padding; FbTk::GContext m_gc; ///< graphic context bool m_end; ///< marks when this object is done diff --git a/util/fbrun/main.cc b/util/fbrun/main.cc index 0e52b19..65b8564 100644 --- a/util/fbrun/main.cc +++ b/util/fbrun/main.cc @@ -58,6 +58,7 @@ void showUsage(const char *progname) { " -print Print result to stdout"<