parent
65a47fd450
commit
1f7628ff05
10 changed files with 320 additions and 17 deletions
@ -0,0 +1,44 @@ |
||||
/* ============================================================
|
||||
* AutoScroll - Autoscroll for QupZilla |
||||
* Copyright (C) 2014 David Rosca <nowrep@gmail.com> |
||||
* |
||||
* This program is free software: you can redistribute it and/or modify |
||||
* it under the terms of the GNU General Public License as published by |
||||
* the Free Software Foundation, either version 3 of the License, or |
||||
* (at your option) any later version. |
||||
* |
||||
* This program is distributed in the hope that it will be useful, |
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
* GNU General Public License for more details. |
||||
* |
||||
* You should have received a copy of the GNU General Public License |
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* ============================================================ */ |
||||
#include "autoscrollsettings.h" |
||||
#include "ui_autoscrollsettings.h" |
||||
#include "autoscroller.h" |
||||
|
||||
AutoScrollSettings::AutoScrollSettings(AutoScroller* scroller, QWidget* parent) |
||||
: QDialog(parent) |
||||
, ui(new Ui::AutoScrollSettings) |
||||
, m_scroller(scroller) |
||||
{ |
||||
setAttribute(Qt::WA_DeleteOnClose); |
||||
ui->setupUi(this); |
||||
ui->divider->setValue(m_scroller->scrollDivider()); |
||||
|
||||
connect(ui->buttonBox, SIGNAL(accepted()), this, SLOT(accepted())); |
||||
connect(ui->buttonBox, SIGNAL(rejected()), this, SLOT(close())); |
||||
} |
||||
|
||||
AutoScrollSettings::~AutoScrollSettings() |
||||
{ |
||||
delete ui; |
||||
} |
||||
|
||||
void AutoScrollSettings::accepted() |
||||
{ |
||||
m_scroller->setScrollDivider(ui->divider->value()); |
||||
close(); |
||||
} |
||||
@ -0,0 +1,46 @@ |
||||
/* ============================================================
|
||||
* AutoScroll - Autoscroll for QupZilla |
||||
* Copyright (C) 2014 David Rosca <nowrep@gmail.com> |
||||
* |
||||
* This program is free software: you can redistribute it and/or modify |
||||
* it under the terms of the GNU General Public License as published by |
||||
* the Free Software Foundation, either version 3 of the License, or |
||||
* (at your option) any later version. |
||||
* |
||||
* This program is distributed in the hope that it will be useful, |
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
* GNU General Public License for more details. |
||||
* |
||||
* You should have received a copy of the GNU General Public License |
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* ============================================================ */ |
||||
#ifndef AUTOSCROLLSETTINGS_H |
||||
#define AUTOSCROLLSETTINGS_H |
||||
|
||||
#include <QDialog> |
||||
|
||||
namespace Ui |
||||
{ |
||||
class AutoScrollSettings; |
||||
} |
||||
|
||||
class AutoScroller; |
||||
|
||||
class AutoScrollSettings : public QDialog |
||||
{ |
||||
Q_OBJECT |
||||
|
||||
public: |
||||
explicit AutoScrollSettings(AutoScroller* scroller, QWidget* parent = 0); |
||||
~AutoScrollSettings(); |
||||
|
||||
private slots: |
||||
void accepted(); |
||||
|
||||
private: |
||||
Ui::AutoScrollSettings* ui; |
||||
AutoScroller* m_scroller; |
||||
}; |
||||
|
||||
#endif // AUTOSCROLLSETTINGS_H
|
||||
@ -0,0 +1,154 @@ |
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<ui version="4.0"> |
||||
<class>AutoScrollSettings</class> |
||||
<widget class="QDialog" name="AutoScrollSettings"> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>0</x> |
||||
<y>0</y> |
||||
<width>411</width> |
||||
<height>179</height> |
||||
</rect> |
||||
</property> |
||||
<property name="windowTitle"> |
||||
<string>Dialog</string> |
||||
</property> |
||||
<layout class="QVBoxLayout" name="verticalLayout"> |
||||
<item> |
||||
<layout class="QHBoxLayout" name="horizontalLayout_3"> |
||||
<item> |
||||
<spacer name="horizontalSpacer_3"> |
||||
<property name="orientation"> |
||||
<enum>Qt::Horizontal</enum> |
||||
</property> |
||||
<property name="sizeHint" stdset="0"> |
||||
<size> |
||||
<width>40</width> |
||||
<height>20</height> |
||||
</size> |
||||
</property> |
||||
</spacer> |
||||
</item> |
||||
<item> |
||||
<widget class="QLabel" name="label"> |
||||
<property name="pixmap"> |
||||
<pixmap resource="autoscroll.qrc">:/autoscroll/data/scroll_all.png</pixmap> |
||||
</property> |
||||
</widget> |
||||
</item> |
||||
<item> |
||||
<spacer name="horizontalSpacer_4"> |
||||
<property name="orientation"> |
||||
<enum>Qt::Horizontal</enum> |
||||
</property> |
||||
<property name="sizeHint" stdset="0"> |
||||
<size> |
||||
<width>40</width> |
||||
<height>20</height> |
||||
</size> |
||||
</property> |
||||
</spacer> |
||||
</item> |
||||
</layout> |
||||
</item> |
||||
<item> |
||||
<layout class="QHBoxLayout" name="horizontalLayout_2"> |
||||
<item> |
||||
<spacer name="horizontalSpacer_2"> |
||||
<property name="orientation"> |
||||
<enum>Qt::Horizontal</enum> |
||||
</property> |
||||
<property name="sizeHint" stdset="0"> |
||||
<size> |
||||
<width>40</width> |
||||
<height>20</height> |
||||
</size> |
||||
</property> |
||||
</spacer> |
||||
</item> |
||||
<item> |
||||
<widget class="QLabel" name="label_2"> |
||||
<property name="text"> |
||||
<string><h1>AutoScroll</h1></string> |
||||
</property> |
||||
</widget> |
||||
</item> |
||||
<item> |
||||
<spacer name="horizontalSpacer"> |
||||
<property name="orientation"> |
||||
<enum>Qt::Horizontal</enum> |
||||
</property> |
||||
<property name="sizeHint" stdset="0"> |
||||
<size> |
||||
<width>40</width> |
||||
<height>20</height> |
||||
</size> |
||||
</property> |
||||
</spacer> |
||||
</item> |
||||
</layout> |
||||
</item> |
||||
<item> |
||||
<layout class="QHBoxLayout" name="horizontalLayout"> |
||||
<item> |
||||
<spacer name="horizontalSpacer_5"> |
||||
<property name="orientation"> |
||||
<enum>Qt::Horizontal</enum> |
||||
</property> |
||||
<property name="sizeHint" stdset="0"> |
||||
<size> |
||||
<width>40</width> |
||||
<height>20</height> |
||||
</size> |
||||
</property> |
||||
</spacer> |
||||
</item> |
||||
<item> |
||||
<widget class="QLabel" name="label_3"> |
||||
<property name="text"> |
||||
<string>Scroll Divider:</string> |
||||
</property> |
||||
</widget> |
||||
</item> |
||||
<item> |
||||
<widget class="QDoubleSpinBox" name="divider"/> |
||||
</item> |
||||
<item> |
||||
<spacer name="horizontalSpacer_6"> |
||||
<property name="orientation"> |
||||
<enum>Qt::Horizontal</enum> |
||||
</property> |
||||
<property name="sizeHint" stdset="0"> |
||||
<size> |
||||
<width>40</width> |
||||
<height>20</height> |
||||
</size> |
||||
</property> |
||||
</spacer> |
||||
</item> |
||||
</layout> |
||||
</item> |
||||
<item> |
||||
<widget class="QLabel" name="label_4"> |
||||
<property name="text"> |
||||
<string><b>Note:</b> Setting higher divider will slow down scrolling</string> |
||||
</property> |
||||
</widget> |
||||
</item> |
||||
<item> |
||||
<widget class="QDialogButtonBox" name="buttonBox"> |
||||
<property name="orientation"> |
||||
<enum>Qt::Horizontal</enum> |
||||
</property> |
||||
<property name="standardButtons"> |
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set> |
||||
</property> |
||||
</widget> |
||||
</item> |
||||
</layout> |
||||
</widget> |
||||
<resources> |
||||
<include location="autoscroll.qrc"/> |
||||
</resources> |
||||
<connections/> |
||||
</ui> |
||||
Loading…
Reference in new issue