示例#1
0
void StatusBar::redraw(Buffer::iterator& cursor)
{
	update_terminal_size();

	// Drawing first line...
	std::stringstream ss1;
	ss1 << "  " << cursor.string_name();
	u64 size = cursor.get_chunk()->get_file().get_size();
	ss1 << "  " << cursor->get_offset() << "/" << cursor.get_chunk()->get_file().get_size();
	ss1 << "  " << (cursor->get_offset() + cursor->get_length()) * 100 / size << "%";

	Line line1(ss1.str());
	Line rest(' ', _width - line1.length());
	Log1("Rest: " << rest);
	Log1("Line1: " << line1);
	line1 += rest;
	Log1("Line1: " << line1);
	_brush.draw_line(_text_height, line1, Brush::status_bar_color);

	Line line2(' ', _width);
	_brush.draw_line(_text_height + 1, line2, Brush::status_bar_color);

	draw_marks(cursor);
}
示例#2
0
void get_terminal_settings(term_settings& terminal_settings) {
	update_terminal_size();
	terminal_settings.colors = has_colors();
}
示例#3
0
StatusBar::StatusBar(Marks& marks)
	: _marks(marks)
{
	update_terminal_size();
}