1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

tweaked page button

This commit is contained in:
krepa098 2014-08-10 15:11:59 +02:00
parent a3a0ee3923
commit 1a88b079e2

View File

@ -64,12 +64,16 @@ EmoticonsWidget::EmoticonsWidget(QWidget *parent) :
page->setLayout(pageLayout);
stack.addWidget(page);
QRadioButton* pageButton = new QRadioButton;
pageButton->setProperty("pageIndex", i);
pageButton->setChecked(i == 0);
buttonLayout->addWidget(pageButton);
// page buttons are only needed if there is more than 1 page
if (pageCount > 1)
{
QRadioButton* pageButton = new QRadioButton;
pageButton->setProperty("pageIndex", i);
pageButton->setChecked(i == 0);
buttonLayout->addWidget(pageButton);
connect(pageButton, &QRadioButton::clicked, this, &EmoticonsWidget::onPageButtonClicked);
connect(pageButton, &QRadioButton::clicked, this, &EmoticonsWidget::onPageButtonClicked);
}
}
buttonLayout->addStretch();