Add ScreenOverlaySettings for later use
gotta leave for class now
This commit is contained in:
parent
2fe782704c
commit
edc462ab6f
|
@ -6,7 +6,7 @@
|
||||||
#include <QGraphicsPixmapItem>
|
#include <QGraphicsPixmapItem>
|
||||||
#include <QGraphicsTextItem>
|
#include <QGraphicsTextItem>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include <screenoverlayview.hpp>
|
#include <screenoverlay/screenoverlayview.hpp>
|
||||||
#include <settings.hpp>
|
#include <settings.hpp>
|
||||||
|
|
||||||
ColorPickerScene::ColorPickerScene(QPixmap pixmap, QWidget *parentWidget)
|
ColorPickerScene::ColorPickerScene(QPixmap pixmap, QWidget *parentWidget)
|
||||||
|
@ -17,23 +17,11 @@ ColorPickerScene::ColorPickerScene(QPixmap pixmap, QWidget *parentWidget)
|
||||||
|
|
||||||
activateWindow();
|
activateWindow();
|
||||||
setGeometry(pixmap.rect());
|
setGeometry(pixmap.rect());
|
||||||
QPoint p = utils::smallestScreenCoordinate()
|
ScreenOverlay::show();
|
||||||
+ QPoint(settings::settings().value("cropx", 0).toInt(), settings::settings().value("cropy", 0).toInt());
|
|
||||||
move(p.x(), p.y());
|
|
||||||
if (QApplication::screens().size() == 1)
|
|
||||||
showFullScreen();
|
|
||||||
else
|
|
||||||
show();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ColorPickerScene::mouseMoved(QGraphicsSceneMouseEvent *event, QPointF cursor, QPointF delta) {
|
void ColorPickerScene::mouseMoved(QGraphicsSceneMouseEvent *, QPointF cursorPos, QPointF) {
|
||||||
color = image.pixelColor(cursorPos().toPoint());
|
color = image.pixelColor(cursorPos.toPoint());
|
||||||
qreal bottom = rect().bottom(); // max y
|
|
||||||
qreal right = rect().right(); // max x
|
|
||||||
|
|
||||||
QPointF origPoint = cursorPos() + QPoint(25, 0);
|
|
||||||
QPointF scopePoint = cursorPos();
|
|
||||||
QPointF resPoint = origPoint;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ColorPickerScene::keyPressEvent(QKeyEvent *event) {
|
void ColorPickerScene::keyPressEvent(QKeyEvent *event) {
|
||||||
|
|
|
@ -7,15 +7,14 @@
|
||||||
#include <QGraphicsTextItem>
|
#include <QGraphicsTextItem>
|
||||||
#include <QKeyEvent>
|
#include <QKeyEvent>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include <screenoverlayview.hpp>
|
#include <screenoverlay/screenoverlay.hpp>
|
||||||
#include <screenoverlay.hpp>
|
#include <screenoverlay/screenoverlayview.hpp>
|
||||||
#include <utils.hpp>
|
#include <utils.hpp>
|
||||||
|
|
||||||
class ColorPickerScene : public ScreenOverlay, public ScreenOverlayView {
|
class ColorPickerScene : public ScreenOverlay, public ScreenOverlayView {
|
||||||
Q_DECLARE_TR_FUNCTIONS(ColorPickerScene)
|
Q_DECLARE_TR_FUNCTIONS(ColorPickerScene)
|
||||||
public:
|
public:
|
||||||
ColorPickerScene(QPixmap pixmap, QWidget *parent = nullptr);
|
ColorPickerScene(QPixmap pixmap, QWidget *parent = nullptr);
|
||||||
void mouseMoved(QGraphicsSceneMouseEvent *event, QPointF cursorPos, QPointF delta) override;
|
|
||||||
void keyPressEvent(QKeyEvent *event) override;
|
void keyPressEvent(QKeyEvent *event) override;
|
||||||
void mouseReleaseEvent(QGraphicsSceneMouseEvent *) override;
|
void mouseReleaseEvent(QGraphicsSceneMouseEvent *) override;
|
||||||
QString generateHint() override;
|
QString generateHint() override;
|
||||||
|
@ -23,6 +22,9 @@ public:
|
||||||
new ColorPickerScene(utils::fullscreen());
|
new ColorPickerScene(utils::fullscreen());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void mouseMoved(QGraphicsSceneMouseEvent *, QPointF cursorPos, QPointF) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QImage image;
|
QImage image;
|
||||||
QColor color;
|
QColor color;
|
||||||
|
|
|
@ -13,10 +13,6 @@
|
||||||
CropEditor::CropEditor(QPixmap image, QObject *parent) : QObject(parent) {
|
CropEditor::CropEditor(QPixmap image, QObject *parent) : QObject(parent) {
|
||||||
scene = new CropScene(parent, image);
|
scene = new CropScene(parent, image);
|
||||||
view = new CropView(scene);
|
view = new CropView(scene);
|
||||||
if (QApplication::screens().size() > 1)
|
|
||||||
view->show();
|
|
||||||
else
|
|
||||||
view->showFullScreen();
|
|
||||||
view->raise();
|
view->raise();
|
||||||
QGraphicsPixmapItem *pixmapItem = new QGraphicsPixmapItem(image);
|
QGraphicsPixmapItem *pixmapItem = new QGraphicsPixmapItem(image);
|
||||||
pixmapItem->setZValue(-1);
|
pixmapItem->setZValue(-1);
|
||||||
|
@ -29,7 +25,7 @@ CropEditor::CropEditor(QPixmap image, QObject *parent) : QObject(parent) {
|
||||||
view->move(p.x(), p.y());
|
view->move(p.x(), p.y());
|
||||||
view->setWindowTitle(tr("KShare Crop Editor"));
|
view->setWindowTitle(tr("KShare Crop Editor"));
|
||||||
view->activateWindow();
|
view->activateWindow();
|
||||||
|
scene->show();
|
||||||
connect(scene, &CropScene::closedWithRect, this, &CropEditor::crop);
|
connect(scene, &CropScene::closedWithRect, this, &CropEditor::crop);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -167,28 +167,6 @@ QGraphicsItem *CropScene::whichItem(QPointF scenePos) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CropScene::hide() {
|
|
||||||
setVisible(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
void CropScene::show() {
|
|
||||||
setVisible(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
void CropScene::setVisible(bool visible) {
|
|
||||||
for (auto view : views()) {
|
|
||||||
view->setVisible(visible);
|
|
||||||
if (visible) {
|
|
||||||
if (QApplication::screens().size() == 1) view->showFullScreen();
|
|
||||||
QPoint p = utils::smallestScreenCoordinate() + QPoint(settings::settings().value("cropx", 0).toInt(),
|
|
||||||
settings::settings().value("cropy", 0).toInt());
|
|
||||||
view->move(p.x(), p.y());
|
|
||||||
view->setWindowTitle(tr("KShare Crop Editor"));
|
|
||||||
view->activateWindow();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void CropScene::fontAsk() {
|
void CropScene::fontAsk() {
|
||||||
hide();
|
hide();
|
||||||
bool ok = false;
|
bool ok = false;
|
||||||
|
@ -348,7 +326,10 @@ QString CropScene::generateHint() {
|
||||||
QString rectStr("(-1, -1, 0, 0)");
|
QString rectStr("(-1, -1, 0, 0)");
|
||||||
if (rect) {
|
if (rect) {
|
||||||
rectStr = "(%0, %1, %2, %3)";
|
rectStr = "(%0, %1, %2, %3)";
|
||||||
rectStr = rectStr.arg(rect->rect().x()).arg(rect->rect().y()).arg(rect->rect().width()).arg(rect->rect().height());
|
rectStr = rectStr.arg(qRound(rect->rect().x()))
|
||||||
|
.arg(qRound(rect->rect().y()))
|
||||||
|
.arg(qRound(rect->rect().width()))
|
||||||
|
.arg(qRound(rect->rect().height()));
|
||||||
}
|
}
|
||||||
return QString("ptr: (%0, %1)\nsel: %2").arg(qRound(cursorPos().x())).arg(qRound(cursorPos().y())).arg(rectStr);
|
return QString("ptr: (%0, %1)\nsel: %2").arg(qRound(cursorPos().x())).arg(qRound(cursorPos().y())).arg(rectStr);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
#ifndef CROPSCENE_HPP
|
#ifndef CROPSCENE_HPP
|
||||||
#define CROPSCENE_HPP
|
#define CROPSCENE_HPP
|
||||||
|
|
||||||
#include "../screenoverlay.hpp"
|
|
||||||
#include <QFont>
|
#include <QFont>
|
||||||
#include <QGraphicsScene>
|
#include <QGraphicsScene>
|
||||||
#include <QGraphicsSceneContextMenuEvent>
|
#include <QGraphicsSceneContextMenuEvent>
|
||||||
|
@ -11,7 +10,8 @@
|
||||||
#include <QMenuBar>
|
#include <QMenuBar>
|
||||||
#include <cropeditor/selectionrectangle.hpp>
|
#include <cropeditor/selectionrectangle.hpp>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <screenoverlayview.hpp>
|
#include <screenoverlay/screenoverlay.hpp>
|
||||||
|
#include <screenoverlay/screenoverlayview.hpp>
|
||||||
#include <utils.hpp>
|
#include <utils.hpp>
|
||||||
class CropScene;
|
class CropScene;
|
||||||
|
|
||||||
|
@ -33,8 +33,6 @@ public:
|
||||||
return rect;
|
return rect;
|
||||||
}
|
}
|
||||||
QGraphicsItem *whichItem(QPointF scenePos);
|
QGraphicsItem *whichItem(QPointF scenePos);
|
||||||
void hide();
|
|
||||||
void show();
|
|
||||||
void setVisible(bool visible);
|
void setVisible(bool visible);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
|
|
|
@ -1,8 +1,20 @@
|
||||||
#include "cropview.hpp"
|
#include "cropview.hpp"
|
||||||
|
|
||||||
|
#include <settings.hpp>
|
||||||
|
#include <utils.hpp>
|
||||||
|
|
||||||
CropView::CropView(QGraphicsScene *scene) : ScreenOverlayView(scene) {
|
CropView::CropView(QGraphicsScene *scene) : ScreenOverlayView(scene) {
|
||||||
setCursor(Qt::BlankCursor);
|
setCursor(Qt::BlankCursor);
|
||||||
}
|
}
|
||||||
|
|
||||||
CropView::~CropView() {
|
CropView::~CropView() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CropView::showEvent(QShowEvent *) {
|
||||||
|
QPoint p = utils::smallestScreenCoordinate()
|
||||||
|
+ QPoint(settings::settings().value("cropx", 0).toInt(), settings::settings().value("cropy", 0).toInt());
|
||||||
|
if (QApplication::screens().size() == 1) showFullScreen();
|
||||||
|
move(p);
|
||||||
|
setWindowTitle(tr("KShare Crop Editor"));
|
||||||
|
activateWindow();
|
||||||
|
}
|
||||||
|
|
|
@ -2,12 +2,16 @@
|
||||||
#define CROPVIEW_HPP
|
#define CROPVIEW_HPP
|
||||||
|
|
||||||
#include <QKeyEvent>
|
#include <QKeyEvent>
|
||||||
#include <screenoverlayview.hpp>
|
#include <QCoreApplication>
|
||||||
|
#include <screenoverlay/screenoverlayview.hpp>
|
||||||
|
|
||||||
class CropView : public ScreenOverlayView {
|
class CropView : public ScreenOverlayView {
|
||||||
|
Q_DECLARE_TR_FUNCTIONS(CropScene)
|
||||||
public:
|
public:
|
||||||
CropView(QGraphicsScene *scene);
|
CropView(QGraphicsScene *scene);
|
||||||
~CropView();
|
~CropView();
|
||||||
|
protected:
|
||||||
|
void showEvent(QShowEvent *e) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // CROPVIEW_HPP
|
#endif // CROPVIEW_HPP
|
||||||
|
|
|
@ -21,8 +21,6 @@ BrushPenSelection::BrushPenSelection(CropScene *scene) : QDialog(), ui(new Ui::B
|
||||||
ui->radSlider->setValue(settings::settings().value("blur/radius", 5.).toDouble() * 100);
|
ui->radSlider->setValue(settings::settings().value("blur/radius", 5.).toDouble() * 100);
|
||||||
ui->radSpinner->setValue(settings::settings().value("blur/radius", 5.).toDouble());
|
ui->radSpinner->setValue(settings::settings().value("blur/radius", 5.).toDouble());
|
||||||
|
|
||||||
ui->gridBox->setChecked(scene->grid());
|
|
||||||
|
|
||||||
ui->cosmetic->setChecked(scene->pen().isCosmetic());
|
ui->cosmetic->setChecked(scene->pen().isCosmetic());
|
||||||
ui->widthSlider->setValue(scene->pen().width());
|
ui->widthSlider->setValue(scene->pen().width());
|
||||||
ui->widthSpinner->setValue(scene->pen().widthF());
|
ui->widthSpinner->setValue(scene->pen().widthF());
|
||||||
|
@ -39,7 +37,6 @@ BrushPenSelection::BrushPenSelection(CropScene *scene) : QDialog(), ui(new Ui::B
|
||||||
brush = scene->brush().color();
|
brush = scene->brush().color();
|
||||||
ui->alphaSlider->setValue(brush.alpha());
|
ui->alphaSlider->setValue(brush.alpha());
|
||||||
ui->alphaSpin->setValue(brush.alpha());
|
ui->alphaSpin->setValue(brush.alpha());
|
||||||
highlight = scene->highlight();
|
|
||||||
|
|
||||||
setWindowTitle(tr("Crop editor settings"));
|
setWindowTitle(tr("Crop editor settings"));
|
||||||
this->scene = scene;
|
this->scene = scene;
|
||||||
|
@ -64,15 +61,12 @@ void BrushPenSelection::on_buttonBox_accepted() {
|
||||||
scene->pen().setCosmetic(ui->cosmetic->isChecked());
|
scene->pen().setCosmetic(ui->cosmetic->isChecked());
|
||||||
scene->pen().setWidthF(ui->widthSpinner->value());
|
scene->pen().setWidthF(ui->widthSpinner->value());
|
||||||
scene->brush().setColor(brush);
|
scene->brush().setColor(brush);
|
||||||
scene->setHighlight(highlight);
|
|
||||||
scene->setGrid(ui->gridBox->isChecked());
|
|
||||||
scene->brush().setStyle((Qt::BrushStyle)ui->brushStyle->currentIndex());
|
scene->brush().setStyle((Qt::BrushStyle)ui->brushStyle->currentIndex());
|
||||||
|
|
||||||
settings::settings().setValue("penColor", scene->pen().color());
|
settings::settings().setValue("penColor", scene->pen().color());
|
||||||
settings::settings().setValue("penCosmetic", scene->pen().isCosmetic());
|
settings::settings().setValue("penCosmetic", scene->pen().isCosmetic());
|
||||||
settings::settings().setValue("penWidth", scene->pen().widthF());
|
settings::settings().setValue("penWidth", scene->pen().widthF());
|
||||||
settings::settings().setValue("brushColor", scene->brush().color());
|
settings::settings().setValue("brushColor", scene->brush().color());
|
||||||
settings::settings().setValue("highlightColor", scene->highlight());
|
|
||||||
settings::settings().setValue("gridEnabled", scene->grid());
|
settings::settings().setValue("gridEnabled", scene->grid());
|
||||||
settings::settings().setValue("brushStyle", (int)scene->brush().style());
|
settings::settings().setValue("brushStyle", (int)scene->brush().style());
|
||||||
settings::settings().setValue("brushPath", ui->pathItemHasBrush->isChecked());
|
settings::settings().setValue("brushPath", ui->pathItemHasBrush->isChecked());
|
||||||
|
@ -112,7 +106,3 @@ void BrushPenSelection::on_alphaSpin_valueChanged(int arg1) {
|
||||||
void BrushPenSelection::on_penAlphaSpin_valueChanged(int arg1) {
|
void BrushPenSelection::on_penAlphaSpin_valueChanged(int arg1) {
|
||||||
pen.setAlpha(arg1);
|
pen.setAlpha(arg1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BrushPenSelection::on_highlightColor_clicked() {
|
|
||||||
highlight = QColorDialog::getColor(highlight, this, tr("Highlight color"));
|
|
||||||
}
|
|
||||||
|
|
|
@ -27,12 +27,10 @@ private slots:
|
||||||
void on_widthSpinner_valueChanged(double arg1);
|
void on_widthSpinner_valueChanged(double arg1);
|
||||||
void on_penAlphaSpin_valueChanged(int arg1);
|
void on_penAlphaSpin_valueChanged(int arg1);
|
||||||
|
|
||||||
void on_highlightColor_clicked();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::BrushPenSelection *ui;
|
Ui::BrushPenSelection *ui;
|
||||||
CropScene *scene;
|
CropScene *scene;
|
||||||
QColor brush, pen, highlight;
|
QColor brush, pen;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // BRUSHPENSELECTION_HPP
|
#endif // BRUSHPENSELECTION_HPP
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>442</width>
|
<width>442</width>
|
||||||
<height>550</height>
|
<height>493</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="focusPolicy">
|
<property name="focusPolicy">
|
||||||
|
@ -17,157 +17,7 @@
|
||||||
<string notr="true">Dialog</string>
|
<string notr="true">Dialog</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout_4">
|
<layout class="QGridLayout" name="gridLayout_4">
|
||||||
<item row="0" column="0">
|
<item row="1" column="0" rowspan="4">
|
||||||
<widget class="QGroupBox" name="groupBox">
|
|
||||||
<property name="title">
|
|
||||||
<string>Pen settings</string>
|
|
||||||
</property>
|
|
||||||
<layout class="QGridLayout" name="gridLayout_2">
|
|
||||||
<item row="1" column="0">
|
|
||||||
<widget class="QSlider" name="widthSlider">
|
|
||||||
<property name="maximum">
|
|
||||||
<number>2500</number>
|
|
||||||
</property>
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="4" column="0" colspan="2">
|
|
||||||
<widget class="QPushButton" name="penColor">
|
|
||||||
<property name="text">
|
|
||||||
<string>Choose pen color</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="3" column="0">
|
|
||||||
<widget class="QCheckBox" name="cosmetic">
|
|
||||||
<property name="text">
|
|
||||||
<string>Cosmetic</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="0">
|
|
||||||
<widget class="QLabel" name="label_3">
|
|
||||||
<property name="text">
|
|
||||||
<string>Width</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="5" column="0">
|
|
||||||
<widget class="QLabel" name="label_5">
|
|
||||||
<property name="text">
|
|
||||||
<string>Pen alpha</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="1">
|
|
||||||
<widget class="QDoubleSpinBox" name="widthSpinner"/>
|
|
||||||
</item>
|
|
||||||
<item row="6" column="0">
|
|
||||||
<widget class="QSlider" name="penAlphaSlider">
|
|
||||||
<property name="maximum">
|
|
||||||
<number>255</number>
|
|
||||||
</property>
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="6" column="1">
|
|
||||||
<widget class="QSpinBox" name="penAlphaSpin">
|
|
||||||
<property name="maximum">
|
|
||||||
<number>255</number>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="6" column="0" colspan="2">
|
|
||||||
<widget class="QDialogButtonBox" name="buttonBox">
|
|
||||||
<property name="standardButtons">
|
|
||||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
|
||||||
</property>
|
|
||||||
<property name="centerButtons">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="1" rowspan="3">
|
|
||||||
<widget class="QGroupBox" name="groupBox_3">
|
|
||||||
<property name="title">
|
|
||||||
<string>Blur settings</string>
|
|
||||||
</property>
|
|
||||||
<layout class="QGridLayout" name="gridLayout_3">
|
|
||||||
<item row="1" column="0" colspan="2">
|
|
||||||
<widget class="QSlider" name="radSlider">
|
|
||||||
<property name="maximum">
|
|
||||||
<number>3000</number>
|
|
||||||
</property>
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="3" column="0" colspan="3">
|
|
||||||
<widget class="QCheckBox" name="performance">
|
|
||||||
<property name="text">
|
|
||||||
<string>Performance Hint</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="4" column="0" colspan="3">
|
|
||||||
<widget class="QCheckBox" name="animated">
|
|
||||||
<property name="text">
|
|
||||||
<string>Animated Hint</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="5" column="0">
|
|
||||||
<widget class="QCheckBox" name="quality">
|
|
||||||
<property name="text">
|
|
||||||
<string>Quality Hint</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="0" colspan="2">
|
|
||||||
<widget class="QLabel" name="label_2">
|
|
||||||
<property name="whatsThis">
|
|
||||||
<string notr="true">http://doc.qt.io/qt-5/qgraphicsblureffect.html#BlurHint-enum</string>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string><a href="http://doc.qt.io/qt-5/qgraphicsblureffect.html#BlurHint-enum">Blur Hints</string>
|
|
||||||
</property>
|
|
||||||
<property name="openExternalLinks">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<property name="textInteractionFlags">
|
|
||||||
<set>Qt::TextBrowserInteraction</set>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="0" colspan="3">
|
|
||||||
<widget class="QLabel" name="label">
|
|
||||||
<property name="text">
|
|
||||||
<string>Blur Radius</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="2">
|
|
||||||
<widget class="QDoubleSpinBox" name="radSpinner">
|
|
||||||
<property name="suffix">
|
|
||||||
<string notr="true">px</string>
|
|
||||||
</property>
|
|
||||||
<property name="maximum">
|
|
||||||
<double>30.000000000000000</double>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="0" rowspan="5">
|
|
||||||
<widget class="QGroupBox" name="groupBox_2">
|
<widget class="QGroupBox" name="groupBox_2">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>Brush settings</string>
|
<string>Brush settings</string>
|
||||||
|
@ -293,7 +143,84 @@
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="4" column="1" rowspan="2">
|
<item row="5" column="0" colspan="2">
|
||||||
|
<widget class="QDialogButtonBox" name="buttonBox">
|
||||||
|
<property name="standardButtons">
|
||||||
|
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||||
|
</property>
|
||||||
|
<property name="centerButtons">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QGroupBox" name="groupBox">
|
||||||
|
<property name="title">
|
||||||
|
<string>Pen settings</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QGridLayout" name="gridLayout_2">
|
||||||
|
<item row="1" column="0">
|
||||||
|
<widget class="QSlider" name="widthSlider">
|
||||||
|
<property name="maximum">
|
||||||
|
<number>2500</number>
|
||||||
|
</property>
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="4" column="0" colspan="2">
|
||||||
|
<widget class="QPushButton" name="penColor">
|
||||||
|
<property name="text">
|
||||||
|
<string>Choose pen color</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="0">
|
||||||
|
<widget class="QCheckBox" name="cosmetic">
|
||||||
|
<property name="text">
|
||||||
|
<string>Cosmetic</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QLabel" name="label_3">
|
||||||
|
<property name="text">
|
||||||
|
<string>Width</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="5" column="0">
|
||||||
|
<widget class="QLabel" name="label_5">
|
||||||
|
<property name="text">
|
||||||
|
<string>Pen alpha</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="1">
|
||||||
|
<widget class="QDoubleSpinBox" name="widthSpinner"/>
|
||||||
|
</item>
|
||||||
|
<item row="6" column="0">
|
||||||
|
<widget class="QSlider" name="penAlphaSlider">
|
||||||
|
<property name="maximum">
|
||||||
|
<number>255</number>
|
||||||
|
</property>
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="6" column="1">
|
||||||
|
<widget class="QSpinBox" name="penAlphaSpin">
|
||||||
|
<property name="maximum">
|
||||||
|
<number>255</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="1" rowspan="2">
|
||||||
<widget class="QGroupBox" name="groupBox_4">
|
<widget class="QGroupBox" name="groupBox_4">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>Arrow settings</string>
|
<string>Arrow settings</string>
|
||||||
|
@ -329,23 +256,73 @@
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="1">
|
<item row="0" column="1" rowspan="3">
|
||||||
<widget class="QGroupBox" name="groupBox_5">
|
<widget class="QGroupBox" name="groupBox_3">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>Other editor settings</string>
|
<string>Blur settings</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout_6">
|
<layout class="QGridLayout" name="gridLayout_3">
|
||||||
<item row="0" column="0">
|
<item row="1" column="0" colspan="2">
|
||||||
<widget class="QCheckBox" name="gridBox">
|
<widget class="QSlider" name="radSlider">
|
||||||
<property name="text">
|
<property name="maximum">
|
||||||
<string>Enable grid</string>
|
<number>3000</number>
|
||||||
|
</property>
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0">
|
<item row="3" column="0" colspan="3">
|
||||||
<widget class="QPushButton" name="highlightColor">
|
<widget class="QCheckBox" name="performance">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Highligh color</string>
|
<string>Performance Hint</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="4" column="0" colspan="3">
|
||||||
|
<widget class="QCheckBox" name="animated">
|
||||||
|
<property name="text">
|
||||||
|
<string>Animated Hint</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="5" column="0">
|
||||||
|
<widget class="QCheckBox" name="quality">
|
||||||
|
<property name="text">
|
||||||
|
<string>Quality Hint</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="0" colspan="2">
|
||||||
|
<widget class="QLabel" name="label_2">
|
||||||
|
<property name="whatsThis">
|
||||||
|
<string notr="true">http://doc.qt.io/qt-5/qgraphicsblureffect.html#BlurHint-enum</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string><a href="http://doc.qt.io/qt-5/qgraphicsblureffect.html#BlurHint-enum">Blur Hints</string>
|
||||||
|
</property>
|
||||||
|
<property name="openExternalLinks">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="textInteractionFlags">
|
||||||
|
<set>Qt::TextBrowserInteraction</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="0" colspan="3">
|
||||||
|
<widget class="QLabel" name="label">
|
||||||
|
<property name="text">
|
||||||
|
<string>Blur Radius</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="2">
|
||||||
|
<widget class="QDoubleSpinBox" name="radSpinner">
|
||||||
|
<property name="suffix">
|
||||||
|
<string notr="true">px</string>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<double>30.000000000000000</double>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|
|
@ -1,8 +1,11 @@
|
||||||
#include "screenoverlay.hpp"
|
#include "screenoverlay.hpp"
|
||||||
|
|
||||||
|
#include "screenoverlaysettings.hpp"
|
||||||
|
#include <QApplication>
|
||||||
#include <QCursor>
|
#include <QCursor>
|
||||||
#include <QGraphicsSceneMouseEvent>
|
#include <QGraphicsSceneMouseEvent>
|
||||||
#include <QGraphicsView>
|
#include <QGraphicsView>
|
||||||
|
#include <QKeyEvent>
|
||||||
#include <settings.hpp>
|
#include <settings.hpp>
|
||||||
#include <utils.hpp>
|
#include <utils.hpp>
|
||||||
|
|
||||||
|
@ -34,6 +37,7 @@ ScreenOverlay::ScreenOverlay(QPixmap pixmap, QObject *parent) : QGraphicsScene(p
|
||||||
magnifierHintBox->setZValue(199);
|
magnifierHintBox->setZValue(199);
|
||||||
magnifierHint->setZValue(199);
|
magnifierHint->setZValue(199);
|
||||||
updateMag();
|
updateMag();
|
||||||
|
loadSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScreenOverlay::wheelEvent(QGraphicsSceneWheelEvent *e) {
|
void ScreenOverlay::wheelEvent(QGraphicsSceneWheelEvent *e) {
|
||||||
|
@ -59,7 +63,7 @@ void ScreenOverlay::wheelEvent(QGraphicsSceneWheelEvent *e) {
|
||||||
void ScreenOverlay::mouseMoveEvent(QGraphicsSceneMouseEvent *e) {
|
void ScreenOverlay::mouseMoveEvent(QGraphicsSceneMouseEvent *e) {
|
||||||
QPointF delta = e->scenePos() - cursorPos();
|
QPointF delta = e->scenePos() - cursorPos();
|
||||||
if (e->modifiers() & Qt::ShiftModifier) {
|
if (e->modifiers() & Qt::ShiftModifier) {
|
||||||
_cursorPos += delta / 2;
|
setCursorPos(cursorPos() + (delta / 2));
|
||||||
QCursor::setPos(views()[0]->mapToGlobal(cursorPos().toPoint()));
|
QCursor::setPos(views()[0]->mapToGlobal(cursorPos().toPoint()));
|
||||||
} else
|
} else
|
||||||
setCursorPos(e->scenePos());
|
setCursorPos(e->scenePos());
|
||||||
|
@ -68,6 +72,18 @@ void ScreenOverlay::mouseMoveEvent(QGraphicsSceneMouseEvent *e) {
|
||||||
mouseMoved(e, cursorPos(), delta);
|
mouseMoved(e, cursorPos(), delta);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ScreenOverlay::moveMouse(QPoint newPos) {
|
||||||
|
QMouseEvent eve(QEvent::MouseMove, newPos, Qt::NoButton, Qt::NoButton, Qt::NoModifier);
|
||||||
|
for (auto &v : views()) {
|
||||||
|
QCursor::setPos(v->mapToGlobal(newPos));
|
||||||
|
QApplication::sendEvent(v->viewport(), &eve);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ScreenOverlay::moveMouseBy(QPoint delta) {
|
||||||
|
moveMouse(cursorPos().toPoint() + delta);
|
||||||
|
}
|
||||||
|
|
||||||
void ScreenOverlay::hideMag() {
|
void ScreenOverlay::hideMag() {
|
||||||
magnifier->setVisible(false);
|
magnifier->setVisible(false);
|
||||||
cursorItem->setVisible(false);
|
cursorItem->setVisible(false);
|
||||||
|
@ -144,3 +160,65 @@ void ScreenOverlay::setHighlight(QColor highlight) {
|
||||||
gridRectsY[i]->setBrush(c);
|
gridRectsY[i]->setBrush(c);
|
||||||
highlightChanged(highlight);
|
highlightChanged(highlight);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ScreenOverlay::keyPressEvent(QKeyEvent *e) {
|
||||||
|
switch (movementPattern()) {
|
||||||
|
case MP_JKL:
|
||||||
|
if (e->key() == Qt::Key_J)
|
||||||
|
moveMouseBy(QPoint(-1, 0));
|
||||||
|
else if (e->key() == Qt::Key_K)
|
||||||
|
moveMouseBy(QPoint(0, 1));
|
||||||
|
else if (e->key() == Qt::Key_L)
|
||||||
|
moveMouseBy(QPoint(0, -1));
|
||||||
|
else if (e->key() == Qt::Key_Semicolon)
|
||||||
|
moveMouseBy(QPoint(1, 0));
|
||||||
|
break;
|
||||||
|
case MP_HJKL:
|
||||||
|
if (e->key() == Qt::Key_H)
|
||||||
|
moveMouseBy(QPoint(-1, 0));
|
||||||
|
else if (e->key() == Qt::Key_J)
|
||||||
|
moveMouseBy(QPoint(0, 1));
|
||||||
|
else if (e->key() == Qt::Key_K)
|
||||||
|
moveMouseBy(QPoint(0, -1));
|
||||||
|
else if (e->key() == Qt::Key_L)
|
||||||
|
moveMouseBy(QPoint(1, 0));
|
||||||
|
break;
|
||||||
|
case MP_ARROWS:
|
||||||
|
if (e->key() == Qt::Key_Left)
|
||||||
|
moveMouseBy(QPoint(-1, 0));
|
||||||
|
else if (e->key() == Qt::Key_Down)
|
||||||
|
moveMouseBy(QPoint(0, 1));
|
||||||
|
else if (e->key() == Qt::Key_Up)
|
||||||
|
moveMouseBy(QPoint(0, -1));
|
||||||
|
else if (e->key() == Qt::Key_Right)
|
||||||
|
moveMouseBy(QPoint(1, 0));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ScreenOverlay::hide() {
|
||||||
|
for (auto &v : views()) {
|
||||||
|
v->hide();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ScreenOverlay::show() {
|
||||||
|
for (auto &v : views()) {
|
||||||
|
if (QApplication::screens().size() > 1)
|
||||||
|
v->show();
|
||||||
|
else
|
||||||
|
v->showFullScreen();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ScreenOverlay::showSettings() {
|
||||||
|
hide();
|
||||||
|
ScreenOverlaySettings(this).exec();
|
||||||
|
show();
|
||||||
|
}
|
||||||
|
|
||||||
|
void ScreenOverlay::loadSettings() {
|
||||||
|
setHighlight(settings::settings().value("highlightColor", QColor(Qt::cyan)).value<QColor>());
|
||||||
|
setMovementPattern(settings::settings().value("movementPattern", MP_HJKL).value<MovementPattern>());
|
||||||
|
setGrid(settings::settings().value("gridEnabled", true).toBool());
|
||||||
|
}
|
|
@ -4,21 +4,21 @@
|
||||||
#include <QGraphicsPixmapItem>
|
#include <QGraphicsPixmapItem>
|
||||||
#include <QGraphicsRectItem>
|
#include <QGraphicsRectItem>
|
||||||
#include <QGraphicsScene>
|
#include <QGraphicsScene>
|
||||||
|
#include <QGraphicsView>
|
||||||
|
|
||||||
class ScreenOverlay : public QGraphicsScene {
|
class ScreenOverlay : public QGraphicsScene {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
|
enum MovementPattern { MP_JKL, MP_HJKL, MP_ARROWS };
|
||||||
explicit ScreenOverlay(QPixmap pixmap, QObject *parent = 0);
|
explicit ScreenOverlay(QPixmap pixmap, QObject *parent = 0);
|
||||||
|
|
||||||
void mouseMoveEvent(QGraphicsSceneMouseEvent *e) override;
|
void moveMouse(QPoint newPoint);
|
||||||
void wheelEvent(QGraphicsSceneWheelEvent *e) override;
|
void moveMouseBy(QPoint delta);
|
||||||
|
MovementPattern movementPattern() {
|
||||||
virtual void mouseMoved(QGraphicsSceneMouseEvent *, QPointF, QPointF) {
|
return _movementPattern;
|
||||||
}
|
}
|
||||||
virtual void highlightChanged(QColor) {
|
void setMovementPattern(MovementPattern nmp) {
|
||||||
}
|
_movementPattern = nmp;
|
||||||
virtual QString generateHint() {
|
|
||||||
return QString();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QPixmap &pixmap() {
|
QPixmap &pixmap() {
|
||||||
|
@ -52,8 +52,26 @@ public:
|
||||||
return _cursorPos;
|
return _cursorPos;
|
||||||
}
|
}
|
||||||
void setCursorPos(QPointF cursorPos) {
|
void setCursorPos(QPointF cursorPos) {
|
||||||
|
if (!pixmap().rect().contains(cursorPos.toPoint())) return;
|
||||||
_cursorPos = cursorPos;
|
_cursorPos = cursorPos;
|
||||||
}
|
}
|
||||||
|
void showSettings();
|
||||||
|
void hide();
|
||||||
|
void show();
|
||||||
|
void loadSettings();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void mouseMoveEvent(QGraphicsSceneMouseEvent *e) override;
|
||||||
|
void wheelEvent(QGraphicsSceneWheelEvent *e) override;
|
||||||
|
void keyPressEvent(QKeyEvent *e) override;
|
||||||
|
|
||||||
|
virtual void mouseMoved(QGraphicsSceneMouseEvent *, QPointF, QPointF) {
|
||||||
|
}
|
||||||
|
virtual void highlightChanged(QColor) {
|
||||||
|
}
|
||||||
|
virtual QString generateHint() {
|
||||||
|
return QString();
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QPointF _cursorPos = QPoint(0, 0);
|
QPointF _cursorPos = QPoint(0, 0);
|
||||||
|
@ -67,6 +85,7 @@ private:
|
||||||
QColor _highlight = Qt::cyan;
|
QColor _highlight = Qt::cyan;
|
||||||
bool _grid = true;
|
bool _grid = true;
|
||||||
QPixmap _pixmap;
|
QPixmap _pixmap;
|
||||||
|
MovementPattern _movementPattern = MP_ARROWS;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* SCREENOVERLAY_HPP */
|
#endif /* SCREENOVERLAY_HPP */
|
|
@ -0,0 +1,29 @@
|
||||||
|
#include "screenoverlaysettings.hpp"
|
||||||
|
#include "ui_screenoverlaysettings.h"
|
||||||
|
|
||||||
|
#include <settings.hpp>
|
||||||
|
#include <QColorDialog>
|
||||||
|
|
||||||
|
ScreenOverlaySettings::ScreenOverlaySettings(ScreenOverlay *overlay, QWidget *parent)
|
||||||
|
: overlay(overlay), QDialog(parent), ui(new Ui::ScreenOverlaySettings) {
|
||||||
|
ui->setupUi(this);
|
||||||
|
|
||||||
|
ui->gridBox->setChecked(overlay->grid());
|
||||||
|
ui->movementPattern->setCurrentIndex(overlay->movementPattern());
|
||||||
|
highlight = overlay->highlight();
|
||||||
|
}
|
||||||
|
|
||||||
|
void ScreenOverlaySettings::on_buttonBox_accepted() {
|
||||||
|
settings::settings().setValue("gridEnabled", ui->gridBox->isChecked());
|
||||||
|
settings::settings().setValue("highlightColor", highlight);
|
||||||
|
settings::settings().setValue("movementPattern", ui->movementPattern->currentIndex());
|
||||||
|
overlay->loadSettings();
|
||||||
|
}
|
||||||
|
|
||||||
|
void ScreenOverlaySettings::on_setHighlight_pressed() {
|
||||||
|
highlight = QColorDialog::getColor(highlight, this, tr("Highlight color"));
|
||||||
|
}
|
||||||
|
|
||||||
|
ScreenOverlaySettings::~ScreenOverlaySettings() {
|
||||||
|
delete ui;
|
||||||
|
}
|
|
@ -0,0 +1,29 @@
|
||||||
|
#ifndef SCREENOVERLAYSETTINGS_H
|
||||||
|
#define SCREENOVERLAYSETTINGS_H
|
||||||
|
|
||||||
|
#include <QDialog>
|
||||||
|
#include "screenoverlay.hpp"
|
||||||
|
|
||||||
|
namespace Ui {
|
||||||
|
class ScreenOverlaySettings;
|
||||||
|
}
|
||||||
|
|
||||||
|
class ScreenOverlaySettings : public QDialog
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit ScreenOverlaySettings(ScreenOverlay *overlay, QWidget *parent = 0);
|
||||||
|
~ScreenOverlaySettings();
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void on_buttonBox_accepted();
|
||||||
|
void on_setHighlight_pressed();
|
||||||
|
|
||||||
|
private:
|
||||||
|
Ui::ScreenOverlaySettings *ui;
|
||||||
|
QColor highlight;
|
||||||
|
ScreenOverlay *overlay;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // SCREENOVERLAYSETTINGS_H
|
|
@ -0,0 +1,104 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>ScreenOverlaySettings</class>
|
||||||
|
<widget class="QDialog" name="ScreenOverlaySettings">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>208</width>
|
||||||
|
<height>179</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>Screen overlay settings</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label">
|
||||||
|
<property name="text">
|
||||||
|
<string>Keyboard movement pattern</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QComboBox" name="movementPattern">
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>JKL; movement (Home-row)</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>HJKL movement (Vim-like)</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Arrow movement</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="gridBox">
|
||||||
|
<property name="text">
|
||||||
|
<string>Enable grid</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="setHighlight">
|
||||||
|
<property name="text">
|
||||||
|
<string>Set highlight color</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QDialogButtonBox" name="buttonBox">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="standardButtons">
|
||||||
|
<set>QDialogButtonBox::Ok</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<resources/>
|
||||||
|
<connections>
|
||||||
|
<connection>
|
||||||
|
<sender>buttonBox</sender>
|
||||||
|
<signal>accepted()</signal>
|
||||||
|
<receiver>ScreenOverlaySettings</receiver>
|
||||||
|
<slot>accept()</slot>
|
||||||
|
<hints>
|
||||||
|
<hint type="sourcelabel">
|
||||||
|
<x>248</x>
|
||||||
|
<y>254</y>
|
||||||
|
</hint>
|
||||||
|
<hint type="destinationlabel">
|
||||||
|
<x>157</x>
|
||||||
|
<y>274</y>
|
||||||
|
</hint>
|
||||||
|
</hints>
|
||||||
|
</connection>
|
||||||
|
<connection>
|
||||||
|
<sender>buttonBox</sender>
|
||||||
|
<signal>rejected()</signal>
|
||||||
|
<receiver>ScreenOverlaySettings</receiver>
|
||||||
|
<slot>reject()</slot>
|
||||||
|
<hints>
|
||||||
|
<hint type="sourcelabel">
|
||||||
|
<x>316</x>
|
||||||
|
<y>260</y>
|
||||||
|
</hint>
|
||||||
|
<hint type="destinationlabel">
|
||||||
|
<x>286</x>
|
||||||
|
<y>274</y>
|
||||||
|
</hint>
|
||||||
|
</hints>
|
||||||
|
</connection>
|
||||||
|
</connections>
|
||||||
|
</ui>
|
14
src/src.pro
14
src/src.pro
|
@ -67,9 +67,10 @@ SOURCES += main.cpp\
|
||||||
logs/requestlogging.cpp \
|
logs/requestlogging.cpp \
|
||||||
logs/historydialog.cpp \
|
logs/historydialog.cpp \
|
||||||
monospacetextdialog.cpp \
|
monospacetextdialog.cpp \
|
||||||
screenoverlayview.cpp \
|
|
||||||
cropeditor/selectionrectangle.cpp \
|
cropeditor/selectionrectangle.cpp \
|
||||||
screenoverlay.cpp
|
screenoverlay/screenoverlayview.cpp \
|
||||||
|
screenoverlay/screenoverlay.cpp \
|
||||||
|
screenoverlay/screenoverlaysettings.cpp
|
||||||
|
|
||||||
HEADERS += mainwindow.hpp \
|
HEADERS += mainwindow.hpp \
|
||||||
cropeditor/cropeditor.hpp \
|
cropeditor/cropeditor.hpp \
|
||||||
|
@ -116,11 +117,11 @@ HEADERS += mainwindow.hpp \
|
||||||
filenamevalidator.hpp \
|
filenamevalidator.hpp \
|
||||||
logs/requestlogging.hpp \
|
logs/requestlogging.hpp \
|
||||||
logs/historydialog.hpp \
|
logs/historydialog.hpp \
|
||||||
screenoverlayview.hpp \
|
|
||||||
screenoverlayview.hpp \
|
|
||||||
monospacetextdialog.hpp \
|
monospacetextdialog.hpp \
|
||||||
cropeditor/selectionrectangle.hpp \
|
cropeditor/selectionrectangle.hpp \
|
||||||
screenoverlay.hpp
|
screenoverlay/screenoverlayview.hpp \
|
||||||
|
screenoverlay/screenoverlay.hpp \
|
||||||
|
screenoverlay/screenoverlaysettings.hpp
|
||||||
|
|
||||||
nopkg {
|
nopkg {
|
||||||
# win32 {
|
# win32 {
|
||||||
|
@ -181,7 +182,8 @@ FORMS += mainwindow.ui \
|
||||||
hotkeyinputdialog.ui \
|
hotkeyinputdialog.ui \
|
||||||
uploaders/default/imgursettingsdialog.ui \
|
uploaders/default/imgursettingsdialog.ui \
|
||||||
logs/historydialog.ui \
|
logs/historydialog.ui \
|
||||||
monospacetextdialog.ui
|
monospacetextdialog.ui \
|
||||||
|
screenoverlay/screenoverlaysettings.ui
|
||||||
|
|
||||||
RESOURCES += \
|
RESOURCES += \
|
||||||
icon.qrc \
|
icon.qrc \
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QPixmap>
|
#include <QPixmap>
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
|
#include <QScreen>
|
||||||
|
|
||||||
namespace utils {
|
namespace utils {
|
||||||
QColor invertColor(QColor color);
|
QColor invertColor(QColor color);
|
||||||
|
|
Loading…
Reference in New Issue