Пример #1
0
void URLFormWidget::setData(const QVariant &data)
{
    m_lineEdit->setText(data.toString());

    //update style sheet according to display properties
    updateStyleSheet();
}
Пример #2
0
SendWidget::SendWidget(QWidget *parent)
    : QWidget(parent)
{
    m_self = this;

    m_layout = SCHAT_OPTION(LS("ToolBarActions")).toStringList();

    m_toolBar = new QToolBar(this);
    m_toolBar->setIconSize(QSize(16, 16));

    m_input = new InputWidget(this);

    QVBoxLayout *mainLay = new QVBoxLayout(this);
    mainLay->addWidget(m_toolBar);
    mainLay->addWidget(m_input);
    mainLay->setMargin(0);
    mainLay->setSpacing(0);

    add(new TextEditAction(InputWidget::Bold), false);
    add(new TextEditAction(InputWidget::Italic), false);
    add(new TextEditAction(InputWidget::Underline), false);
    add(new TextEditAction(InputWidget::Strike), false);
    add(new ColorAction(), false);
    add(new StretchAction(), false);
    add(new SendAction(), false);

    updateStyleSheet();
    refill();

    connect(m_input, SIGNAL(send(QString)), SIGNAL(send(QString)));
    connect(ChatNotify::i(), SIGNAL(notify(Notify)), SLOT(notify(Notify)));
    connect(ChatCore::settings(), SIGNAL(changed(QString,QVariant)), SLOT(settingsChanged(QString,QVariant)));
    connect(TabWidget::i(), SIGNAL(pageChanged(AbstractTab*)), SLOT(pageChanged(AbstractTab*)));
}
Пример #3
0
void FancyLineEdit::hideHintText()
{
    if (m_d->m_showingHintText && !m_d->m_hintText.isEmpty()) {
        m_d->m_showingHintText = false;
        setText(QString());
        updateStyleSheet(side());
    }
}
Пример #4
0
void FancyLineEdit::showHintText()
{
    if (!m_d->m_showingHintText && text().isEmpty() && !m_d->m_hintText.isEmpty()) {
        m_d->m_showingHintText = true;
        setText(m_d->m_hintText);
        updateStyleSheet(side());
    }
}
Пример #5
0
bool SendWidget::event(QEvent *event)
{
# if defined(Q_OS_WIN32)
    if (event->type() == QEvent::ApplicationPaletteChange) {
        updateStyleSheet();
    }
# endif

    return QWidget::event(event);
}
Пример #6
0
EmoticonLabel::EmoticonLabel(Emoticon emoticon, QWidget *parent)
  : QLabel(parent)
  , m_ready(false)
{
  QMovie *movie = new QMovie(emoticon->file(), QByteArray(), this);
  setMovie(movie);
  setAlignment(Qt::AlignCenter);

  m_text = emoticon->texts().first();
  setToolTip(LS("<span>") + m_text + LS("</span>"));

  movie->start();

  updateStyleSheet();
}
Пример #7
0
void ComboboxFormWidget::setData(const QVariant &data)
{
    int value;
    bool validData;

    value = data.toInt(&validData);
    if (validData) {
        m_comboBox->setCurrentIndex(value);
    } else {
        m_comboBox->setCurrentIndex(m_default);
    }

    //update style sheet according to display properties
    updateStyleSheet();
}
Пример #8
0
void FancyLineEdit::updateMenuLabel()
{
    m_d->m_menuLabel->setPixmap(m_d->m_pixmap);
    const Side s = side();
    switch (s) {
    case Left:
        m_d->m_menuLabel->setAlignment(Qt::AlignVCenter | Qt::AlignLeft);
        m_d->m_menuLabel->setStyleSheet(m_d->m_leftLabelStyleSheet);
        break;
    case Right:
        m_d->m_menuLabel->setAlignment(Qt::AlignVCenter | Qt::AlignRight);
        m_d->m_menuLabel->setStyleSheet(m_d->m_rightLabelStyleSheet);
        break;
    }
    updateStyleSheet(s);
    positionMenuLabel();
}
Пример #9
0
void RazorPanelPluginPrivate::setMovable(bool movable)
{
    if (mMovable == movable)
        return;

    Q_Q(RazorPanelPlugin);
    mMovable = movable;

    QMargins m = q->contentsMargins();

    if (movable)
        m.setLeft(m.left() + handleRect().width());
    else
        m.setLeft(m.left() - handleRect().width());

    q->setContentsMargins(m);

    updateStyleSheet();
}
Пример #10
0
StatusBar::StatusBar(QWidget *parent)
  : QStatusBar(parent)
{
  m_self = this;

  m_spinner = new Spinner(this);
  m_icon = new QLabel(this);
  m_login = new LoginIcon(this);
  m_secure = new QLabel(this);
  m_label = new QLabel(this);

# if !defined(SCHAT_NO_SSL)
  m_secure->setPixmap(QPixmap(LS(":/images/secure.png")));
# endif

  m_url = new NetworkWidget(this, NetworkWidget::BasicLayout);
  m_url->setMinimumWidth(m_url->width() * 2 + 50);
  m_urlAction = new QWidgetAction(this);
  m_urlAction->setDefaultWidget(m_url);

  m_bg = new BgOperationWidget(this);
  m_status = new StatusWidget(this);

  addWidget(m_spinner);
  addWidget(m_icon);
  addWidget(m_login);
  addWidget(m_secure);
  addWidget(m_label, 1);
  addWidget(m_bg);
  addPermanentWidget(m_status);

  connect(ChatClient::io(), SIGNAL(clientStateChanged(int,int)), SLOT(clientStateChanged(int)));
  connect(ChatNotify::i(), SIGNAL(notify(Notify)), SLOT(notify(Notify)));

  updateStyleSheet();
  clientStateChanged(SimpleClient::ClientOffline);
}
Пример #11
0
void RazorPanelPluginPrivate::setAlignment(RazorPanelPlugin::Alignment alignment)
{
    mAlignment = alignment;
    updateStyleSheet();
}
Пример #12
0
void EmoticonLabel::leaveEvent(QEvent *event)
{
  QLabel::leaveEvent(event);
  updateStyleSheet();
}
Пример #13
0
void EmoticonLabel::enterEvent(QEvent *event)
{
  QLabel::enterEvent(event);
  updateStyleSheet(true);
}
Пример #14
0
void VoxOxToolTipLineEdit::repaintSecondaryColor(){
	updateStyleSheet(_secondaryStyleSheet);
}
Пример #15
0
void VoxOxToolTipLineEdit::repaintPrimaryColor(){
	updateStyleSheet(_primaryStyleSheet);
}