refactored the settings dialog

This commit is contained in:
fourtf
2018-01-12 23:09:05 +01:00
parent 4cbc3b8b61
commit e0bb061c81
39 changed files with 953 additions and 894 deletions
+6 -11
View File
@@ -7,11 +7,12 @@
namespace chatterino {
namespace widgets {
SettingsDialogTab::SettingsDialogTab(SettingsDialog *_dialog, QString _labelText,
SettingsDialogTab::SettingsDialogTab(SettingsDialog *_dialog, settingspages::SettingsPage *_page,
QString imageFileName)
: dialog(_dialog)
, page(_page)
{
this->ui.labelText = _labelText;
this->ui.labelText = page->getName();
this->ui.icon.addFile(imageFileName);
this->setCursor(QCursor(Qt::PointingHandCursor));
@@ -31,14 +32,9 @@ void SettingsDialogTab::setSelected(bool _selected)
emit selectedChanged(selected);
}
QWidget *SettingsDialogTab::getWidget()
settingspages::SettingsPage *SettingsDialogTab::getSettingsPage()
{
return this->ui.widget;
}
void SettingsDialogTab::setWidget(QWidget *widget)
{
this->ui.widget = widget;
return this->page;
}
void SettingsDialogTab::paintEvent(QPaintEvent *)
@@ -51,8 +47,7 @@ void SettingsDialogTab::paintEvent(QPaintEvent *)
this->style()->drawPrimitive(QStyle::PE_Widget, &opt, &painter, this);
int a = (this->height() - 20) / 2;
QPixmap pixmap = this->ui.icon.pixmap(QSize(20,20));
QPixmap pixmap = this->ui.icon.pixmap(QSize(20, 20));
painter.drawPixmap(0, a, pixmap);