Falkon Develop
Cross-platform Qt-based web browser
autoscrollsettings.cpp
Go to the documentation of this file.
1/* ============================================================
2* AutoScroll - Autoscroll for Falkon
3* Copyright (C) 2014-2017 David Rosca <nowrep@gmail.com>
4*
5* This program is free software: you can redistribute it and/or modify
6* it under the terms of the GNU General Public License as published by
7* the Free Software Foundation, either version 3 of the License, or
8* (at your option) any later version.
9*
10* This program is distributed in the hope that it will be useful,
11* but WITHOUT ANY WARRANTY; without even the implied warranty of
12* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13* GNU General Public License for more details.
14*
15* You should have received a copy of the GNU General Public License
16* along with this program. If not, see <http://www.gnu.org/licenses/>.
17* ============================================================ */
18#include "autoscrollsettings.h"
19#include "ui_autoscrollsettings.h"
20#include "autoscroller.h"
21
22#include <QIcon>
23
25 : QDialog(parent)
26 , ui(new Ui::AutoScrollSettings)
27 , m_scroller(scroller)
28{
29 setAttribute(Qt::WA_DeleteOnClose);
30 ui->setupUi(this);
31 ui->divider->setValue(m_scroller->scrollDivider());
32 ui->iconLabel->setPixmap(QIcon(QStringLiteral(":/autoscroll/data/scroll_all.png")).pixmap(32));
33
34 connect(ui->buttonBox, SIGNAL(accepted()), this, SLOT(accepted()));
35 connect(ui->buttonBox, &QDialogButtonBox::rejected, this, &QWidget::close);
36}
37
39{
40 delete ui;
41}
42
43void AutoScrollSettings::accepted()
44{
45 m_scroller->setScrollDivider(ui->divider->value());
46 close();
47}
AutoScrollSettings(AutoScroller *scroller, QWidget *parent=nullptr)
void setScrollDivider(double divider)
double scrollDivider() const