mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-11 04:32:30 +00:00
Work on an input field.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@272 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
#include "config.h"
|
||||
|
||||
#include "canvas.h"
|
||||
#include "window_input.h"
|
||||
|
||||
#include "input/text_input.h"
|
||||
|
||||
namespace display {
|
||||
|
||||
WindowInput::WindowInput(input::TextInput* input) :
|
||||
Window(new Canvas, false, 1),
|
||||
m_input(input),
|
||||
m_focus(false) {
|
||||
}
|
||||
|
||||
void
|
||||
WindowInput::redraw() {
|
||||
if (!is_dirty())
|
||||
return;
|
||||
|
||||
m_lastDraw = Timer::cache();
|
||||
m_canvas->erase();
|
||||
|
||||
m_canvas->print(0, 0, "> %s", m_input->c_str());
|
||||
|
||||
if (m_focus)
|
||||
m_canvas->set_attr(m_input->get_pos() + 2, 0, 1, A_REVERSE, COLOR_PAIR(0));
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user