diff --git a/flameshot.pro b/flameshot.pro index 70f15b6a..3638eddf 100644 --- a/flameshot.pro +++ b/flameshot.pro @@ -37,7 +37,6 @@ DEFINES += QAPPLICATION_CLASS=QApplication SOURCES += src/main.cpp\ src/controller.cpp \ - src/capture/button.cpp \ src/capture/buttonhandler.cpp \ src/infowindow.cpp \ src/config/configwindow.cpp \ @@ -52,11 +51,12 @@ SOURCES += src/main.cpp\ src/config/clickablelabel.cpp \ src/config/filenameeditor.cpp \ src/utils/filenamehandler.cpp \ - src/config/strftimechooserwidget.cpp + src/config/strftimechooserwidget.cpp \ + src/capture/tools/capturetool.cpp \ + src/capture/capturebutton.cpp HEADERS += \ src/controller.h \ - src/capture/button.h \ src/capture/buttonhandler.h \ src/infowindow.h \ src/config/configwindow.h \ @@ -71,7 +71,9 @@ HEADERS += \ src/config/clickablelabel.h \ src/config/filenameeditor.h \ src/utils/filenamehandler.h \ - src/config/strftimechooserwidget.h + src/config/strftimechooserwidget.h \ + src/capture/tools/capturetool.h \ + src/capture/capturebutton.h RESOURCES += \ graphics.qrc diff --git a/img/buttonIconsBlack/format-text.png b/img/buttonIconsBlack/format-text.png deleted file mode 100644 index 7c62a4dc..00000000 Binary files a/img/buttonIconsBlack/format-text.png and /dev/null differ diff --git a/img/buttonIconsBlack/mouse-off.png b/img/buttonIconsBlack/mouse-off.png deleted file mode 100644 index e52e6bb9..00000000 Binary files a/img/buttonIconsBlack/mouse-off.png and /dev/null differ diff --git a/img/buttonIconsBlack/mouse.png b/img/buttonIconsBlack/mouse.png deleted file mode 100644 index b4a87987..00000000 Binary files a/img/buttonIconsBlack/mouse.png and /dev/null differ diff --git a/img/buttonIconsWhite/mouse-off.png b/img/buttonIconsWhite/mouse-off.png deleted file mode 100644 index 5774518f..00000000 Binary files a/img/buttonIconsWhite/mouse-off.png and /dev/null differ diff --git a/img/buttonIconsWhite/mouse.png b/img/buttonIconsWhite/mouse.png deleted file mode 100644 index 4c270d5f..00000000 Binary files a/img/buttonIconsWhite/mouse.png and /dev/null differ diff --git a/src/capture/buttonhandler.cpp b/src/capture/buttonhandler.cpp index e63b72d6..9fe31f60 100644 --- a/src/capture/buttonhandler.cpp +++ b/src/capture/buttonhandler.cpp @@ -25,7 +25,7 @@ namespace { const int SEPARATION = 6; } -ButtonHandler::ButtonHandler(const QVector &v, QObject *parent) : +ButtonHandler::ButtonHandler(const QVector &v, QObject *parent) : QObject(parent) { if (!v.isEmpty()) { @@ -40,11 +40,11 @@ ButtonHandler::ButtonHandler(QObject *parent) : } void ButtonHandler::hide() { - for (Button *b: m_vectorButtons) b->hide(); + for (CaptureButton *b: m_vectorButtons) b->hide(); } void ButtonHandler::show() { - for (Button *b: m_vectorButtons) b->animatedShow(); + for (CaptureButton *b: m_vectorButtons) b->animatedShow(); } bool ButtonHandler::isVisible() const { @@ -63,13 +63,13 @@ size_t ButtonHandler::size() const { void ButtonHandler::updatePosition(const QRect &selection, const QRect &limits) { - const QVector::size_type vecLength = m_vectorButtons.size(); + const QVector::size_type vecLength = m_vectorButtons.size(); if (vecLength == 0) { return; } // button dimmensions - const int baseHeight = Button::getButtonBaseSize(); - const int baseWidth = Button::getButtonBaseSize(); + const int baseHeight = CaptureButton::getButtonBaseSize(); + const int baseWidth = CaptureButton::getButtonBaseSize(); // copy of the selection area for internal modifications QRect baseArea = selection; @@ -104,7 +104,7 @@ void ButtonHandler::updatePosition(const QRect &selection, baseArea.setHeight(baseHeight); } // indicates the actual button to be moved - QVector::size_type elemIndicator = 0; + QVector::size_type elemIndicator = 0; while (elemIndicator < vecLength) { // update of blocked sides @@ -263,9 +263,9 @@ QVector ButtonHandler::getHPoints( if (elements % 2 == 0) { shift = m_distance * (elements / 2) - (SEPARATION / 2); } else { - shift = m_distance * ((elements-1) / 2) + Button::getButtonBaseSize() / 2; + shift = m_distance * ((elements-1) / 2) + CaptureButton::getButtonBaseSize() / 2; } - if (!leftToRight) { shift -= Button::getButtonBaseSize(); } + if (!leftToRight) { shift -= CaptureButton::getButtonBaseSize(); } int x = leftToRight ? center.x() - shift : center.x() + shift; QPoint i(x, center.y()); @@ -289,9 +289,9 @@ QVector ButtonHandler::getVPoints( if (elements % 2 == 0) { shift = m_distance * (elements / 2) - (SEPARATION / 2); } else { - shift = m_distance * ((elements-1) / 2) + Button::getButtonBaseSize() / 2; + shift = m_distance * ((elements-1) / 2) + CaptureButton::getButtonBaseSize() / 2; } - if (!upToDown) { shift -= Button::getButtonBaseSize(); } + if (!upToDown) { shift -= CaptureButton::getButtonBaseSize(); } int y = upToDown ? center.y() - shift : center.y() + shift; QPoint i(center.x(), y); @@ -303,8 +303,8 @@ QVector ButtonHandler::getVPoints( return res; } // setButtons redefines the buttons of the button handler -void ButtonHandler::setButtons(const QVector