AutoScroll: Add HighDPI pixmaps

remotes/origin/falkon
David Rosca 9 years ago
parent 97aeb45a76
commit 33989263c0
  1. 3
      src/plugins/AutoScroll/autoscroll.qrc
  2. 13
      src/plugins/AutoScroll/autoscroller.cpp
  3. 4
      src/plugins/AutoScroll/autoscrollplugin.cpp
  4. 3
      src/plugins/AutoScroll/autoscrollsettings.cpp
  5. 10
      src/plugins/AutoScroll/autoscrollsettings.ui
  6. BIN
      src/plugins/AutoScroll/data/scroll_all.png
  7. BIN
      src/plugins/AutoScroll/data/scroll_all@2x.png
  8. BIN
      src/plugins/AutoScroll/data/scroll_horizontal.png
  9. BIN
      src/plugins/AutoScroll/data/scroll_horizontal@2x.png
  10. BIN
      src/plugins/AutoScroll/data/scroll_vertical.png
  11. BIN
      src/plugins/AutoScroll/data/scroll_vertical@2x.png

@ -1,8 +1,11 @@
<RCC>
<qresource prefix="/autoscroll">
<file>data/scroll_all.png</file>
<file>data/scroll_all@2x.png</file>
<file>data/scroll_horizontal.png</file>
<file>data/scroll_horizontal@2x.png</file>
<file>data/scroll_vertical.png</file>
<file>data/scroll_vertical@2x.png</file>
<file>locale/ar_SA.qm</file>
<file>locale/bg_BG.qm</file>
<file>locale/ca_ES.qm</file>

@ -1,6 +1,6 @@
/* ============================================================
* AutoScroll - Autoscroll for QupZilla
* Copyright (C) 2014-2016 David Rosca <nowrep@gmail.com>
* Copyright (C) 2014-2017 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
@ -25,6 +25,7 @@
#include <QMouseEvent>
#include <QSettings>
#include <QLabel>
#include <QIcon>
AutoScroller::AutoScroller(const QString &settingsFile, QObject* parent)
: QObject(parent)
@ -189,20 +190,20 @@ bool AutoScroller::showIndicator(WebView* view, const QPoint &pos)
}
if (vertical && horizontal) {
m_indicator->setPixmap(QPixmap(":/autoscroll/data/scroll_all.png"));
m_indicator->setPixmap(QIcon(":/autoscroll/data/scroll_all.png").pixmap(32));
}
else if (vertical) {
m_indicator->setPixmap(QPixmap(":/autoscroll/data/scroll_vertical.png"));
m_indicator->setPixmap(QIcon(":/autoscroll/data/scroll_vertical.png").pixmap(32));
}
else {
m_indicator->setPixmap(QPixmap(":/autoscroll/data/scroll_horizontal.png"));
m_indicator->setPixmap(QIcon(":/autoscroll/data/scroll_horizontal.png").pixmap(32));
}
m_view = view;
QPoint p;
p.setX(pos.x() - m_indicator->pixmap()->width() / 2);
p.setY(pos.y() - m_indicator->pixmap()->height() / 2);
p.setX(pos.x() - m_indicator->width() / 2);
p.setY(pos.y() - m_indicator->height() / 2);
m_indicator->setParent(m_view->overlayWidget());
m_indicator->move(m_view->mapTo(m_view->overlayWidget(), p));

@ -1,6 +1,6 @@
/* ============================================================
* AutoScroll - Autoscroll for QupZilla
* Copyright (C) 2014 David Rosca <nowrep@gmail.com>
* Copyright (C) 2014-2017 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
@ -38,7 +38,7 @@ PluginSpec AutoScrollPlugin::pluginSpec()
spec.description = "Provides support for autoscroll with middle mouse button";
spec.version = "0.2.0";
spec.author = "David Rosca <nowrep@gmail.com>";
spec.icon = QPixmap(":/autoscroll/data/scroll_all.png");
spec.icon = QIcon(QSL(":/autoscroll/data/scroll_all.png")).pixmap(32);
spec.hasSettings = true;
return spec;

@ -1,6 +1,6 @@
/* ============================================================
* AutoScroll - Autoscroll for QupZilla
* Copyright (C) 2014 David Rosca <nowrep@gmail.com>
* Copyright (C) 2014-2017 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
@ -27,6 +27,7 @@ AutoScrollSettings::AutoScrollSettings(AutoScroller* scroller, QWidget* parent)
setAttribute(Qt::WA_DeleteOnClose);
ui->setupUi(this);
ui->divider->setValue(m_scroller->scrollDivider());
ui->iconLabel->setPixmap(QIcon(QStringLiteral(":/autoscroll/data/scroll_all.png")).pixmap(32));
connect(ui->buttonBox, SIGNAL(accepted()), this, SLOT(accepted()));
connect(ui->buttonBox, SIGNAL(rejected()), this, SLOT(close()));

@ -30,11 +30,7 @@
</spacer>
</item>
<item>
<widget class="QLabel" name="label">
<property name="pixmap">
<pixmap resource="autoscroll.qrc">:/autoscroll/data/scroll_all.png</pixmap>
</property>
</widget>
<widget class="QLabel" name="iconLabel"/>
</item>
<item>
<spacer name="horizontalSpacer_4">
@ -151,8 +147,6 @@
</item>
</layout>
</widget>
<resources>
<include location="autoscroll.qrc"/>
</resources>
<resources/>
<connections/>
</ui>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 955 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 997 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Loading…
Cancel
Save