Ejemplo n.º 1
0
Cursor::Cursor(TerminalWidget *parent)
    : m_parent(parent),
      m_row(0),
      m_col(0),
      m_hidden(false),
      m_blinkVisible(true),
      m_blinkOn(500),
      m_blinkOff(500),
      m_blinkPause(1000)
{ 
    m_blinkTimer.setSingleShot(true);
    connect(&m_blinkTimer, SIGNAL(timeout()), SLOT(onBlinkTimer()));
    connect(&m_hideTimer, SIGNAL(timeout()), SLOT(onHideTimer()));

    beginOnBlink();
}
Ejemplo n.º 2
0
ScrollBar::ScrollBar(ScrollArea *parent, bool vert, const style::flatScroll *st) : QWidget(parent),
	_area(parent), _st(st), _vertical(vert),
	_over(false), _overbar(false), _moving(false), _topSh(false), _bottomSh(false),
	_connected(vert ? parent->verticalScrollBar() : parent->horizontalScrollBar()),
    _scrollMax(_connected->maximum()), _hideIn(-1),
    a_bg((_st->hiding ? st::transparent : _st->bgColor)->c),
    a_bar((_st->hiding ? st::transparent : _st->barColor)->c) {
	recountSize();

	_hideTimer.setSingleShot(true);
	connect(&_hideTimer, SIGNAL(timeout()), this, SLOT(onHideTimer()));

	connect(_connected, SIGNAL(valueChanged(int)), this, SLOT(updateBar()));
	connect(_connected, SIGNAL(rangeChanged(int, int)), this, SLOT(updateBar()));

	updateBar();
}