mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
Merge branch 'pr1763'
This commit is contained in:
commit
a086e6d7b1
|
@ -154,3 +154,33 @@ void EmoticonsWidget::mouseReleaseEvent(QMouseEvent *ev)
|
|||
void EmoticonsWidget::mousePressEvent(QMouseEvent*)
|
||||
{
|
||||
}
|
||||
|
||||
void EmoticonsWidget::wheelEvent (QWheelEvent *e)
|
||||
{
|
||||
if (e->orientation() == Qt::Vertical)
|
||||
{
|
||||
if (e->delta() < 0 )
|
||||
{
|
||||
stack.setCurrentIndex(stack.currentIndex()+1);
|
||||
}
|
||||
else
|
||||
{
|
||||
stack.setCurrentIndex(stack.currentIndex()-1);
|
||||
}
|
||||
emit PageButtonsUpdate();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void EmoticonsWidget::PageButtonsUpdate()
|
||||
{
|
||||
QList<QRadioButton*> pageButtons = this->findChildren<QRadioButton*>(QString());
|
||||
QRadioButton *t_pageButton;
|
||||
foreach (t_pageButton,pageButtons)
|
||||
{
|
||||
if ( t_pageButton->property("pageIndex").toInt()==stack.currentIndex())
|
||||
t_pageButton->setChecked(true);
|
||||
else
|
||||
t_pageButton->setChecked(false);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,10 +31,12 @@ signals:
|
|||
private slots:
|
||||
void onSmileyClicked();
|
||||
void onPageButtonClicked();
|
||||
void PageButtonsUpdate();
|
||||
|
||||
protected:
|
||||
virtual void mouseReleaseEvent(QMouseEvent *ev);
|
||||
virtual void mousePressEvent(QMouseEvent *ev);
|
||||
virtual void wheelEvent(QWheelEvent * event) override;
|
||||
|
||||
private:
|
||||
QStackedWidget stack;
|
||||
|
|
Loading…
Reference in New Issue
Block a user