Fixing commit for merging. This is a new feature to add a gui button for

chaging the global thickness.
This commit is contained in:
Martin-Eckleben
2020-09-28 21:55:25 +02:00
committed by borgmanJeremy
parent 0401bf08ea
commit 1bf75693dd
14 changed files with 396 additions and 45 deletions

View File

@@ -74,5 +74,9 @@
<file>img/material/white/shortcut.svg</file>
<file>img/material/black/filepath.svg</file>
<file>img/material/white/filepath.svg</file>
<file>img/material/black/plus.svg</file>
<file>img/material/white/plus.svg</file>
<file>img/material/black/minus.svg</file>
<file>img/material/white/minus.svg</file>
</qresource>
</RCC>
</RCC>

View File

@@ -1,7 +1,53 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Svg Vector Icons : http://www.onlinewebfonts.com/icon -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 1000 1000" enable-background="new 0 0 1000 1000" xml:space="preserve">
<metadata> Svg Vector Icons : http://www.onlinewebfonts.com/icon </metadata>
<g><path d="M876.9,311.5c-20.8,0-37.7,16.9-37.7,37.7v490c0,41.6-33.8,75.4-75.4,75.4H236.2c-41.6,0-75.4-33.8-75.4-75.4v-490c0-20.8-16.9-37.7-37.7-37.7c-20.8,0-37.7,16.9-37.7,37.7v490c0,83.3,67.5,150.8,150.8,150.8h527.7c83.3,0,150.8-67.5,150.8-150.8v-490C914.6,328.4,897.8,311.5,876.9,311.5z M349.2,763.8V349.2c0-20.8-16.9-37.7-37.7-37.7c-20.8,0-37.7,16.9-37.7,37.7v414.6c0,20.8,16.9,37.7,37.7,37.7C332.3,801.5,349.2,784.7,349.2,763.8z M952.3,160.8H650.8V47.7c0-20.8-16.8-37.7-37.7-37.7H386.9c-20.8,0-37.7,16.9-37.7,37.7v113.1H47.7c-20.8,0-37.7,16.9-37.7,37.7c0,20.8,16.9,37.7,37.7,37.7h904.6c20.8,0,37.7-16.8,37.7-37.7C990,177.7,973.2,160.8,952.3,160.8z M575.4,160.8H424.6V85.4h150.8V160.8z M726.2,763.8V349.2c0-20.8-16.8-37.7-37.7-37.7c-20.8,0-37.7,16.9-37.7,37.7v414.6c0,20.8,16.8,37.7,37.7,37.7C709.3,801.5,726.2,784.7,726.2,763.8z M537.7,763.8V349.2c0-20.8-16.8-37.7-37.7-37.7c-20.8,0-37.7,16.9-37.7,37.7v414.6c0,20.8,16.9,37.7,37.7,37.7C520.8,801.5,537.7,784.7,537.7,763.8z"/></g>
</svg>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.1"
x="0px"
y="0px"
viewBox="0 0 24 24"
enable-background="new 0 0 1000 1000"
xml:space="preserve"
id="svg8"
sodipodi:docname="delete.svg"
width="24"
height="24"
inkscape:version="1.0.1 (3bc2e813f5, 2020-09-07)"
inkscape:export-filename="/home/martin/custom/github/flameshot/data/img/material/black/delete.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96"><defs
id="defs12" /><sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1920"
inkscape:window-height="1055"
id="namedview10"
showgrid="false"
inkscape:zoom="6.6714359"
inkscape:cx="26.410099"
inkscape:cy="39.672267"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="svg8" />
<metadata
id="metadata2"> Svg Vector Icons : http://www.onlinewebfonts.com/icon <rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata>
<g
id="g6"
transform="matrix(0.02091837,0,0,0.02091837,1.5408163,1.5408163)"><path
d="m 876.9,311.5 c -20.8,0 -37.7,16.9 -37.7,37.7 v 490 c 0,41.6 -33.8,75.4 -75.4,75.4 H 236.2 c -41.6,0 -75.4,-33.8 -75.4,-75.4 v -490 c 0,-20.8 -16.9,-37.7 -37.7,-37.7 -20.8,0 -37.7,16.9 -37.7,37.7 v 490 c 0,83.3 67.5,150.8 150.8,150.8 h 527.7 c 83.3,0 150.8,-67.5 150.8,-150.8 v -490 c -0.1,-20.8 -16.9,-37.7 -37.8,-37.7 z M 349.2,763.8 V 349.2 c 0,-20.8 -16.9,-37.7 -37.7,-37.7 -20.8,0 -37.7,16.9 -37.7,37.7 v 414.6 c 0,20.8 16.9,37.7 37.7,37.7 20.8,0 37.7,-16.8 37.7,-37.7 z m 603.1,-603 H 650.8 V 47.7 C 650.8,26.9 634,10 613.1,10 H 386.9 c -20.8,0 -37.7,16.9 -37.7,37.7 V 160.8 H 47.7 c -20.8,0 -37.7,16.9 -37.7,37.7 0,20.8 16.9,37.7 37.7,37.7 h 904.6 c 20.8,0 37.7,-16.8 37.7,-37.7 0,-20.8 -16.8,-37.7 -37.7,-37.7 z m -376.9,0 H 424.6 V 85.4 h 150.8 z m 150.8,603 V 349.2 c 0,-20.8 -16.8,-37.7 -37.7,-37.7 -20.8,0 -37.7,16.9 -37.7,37.7 v 414.6 c 0,20.8 16.8,37.7 37.7,37.7 20.8,0 37.7,-16.8 37.7,-37.7 z m -188.5,0 V 349.2 c 0,-20.8 -16.8,-37.7 -37.7,-37.7 -20.8,0 -37.7,16.9 -37.7,37.7 v 414.6 c 0,20.8 16.9,37.7 37.7,37.7 20.8,0 37.7,-16.8 37.7,-37.7 z"
id="path4" /></g>
</svg>

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

@@ -0,0 +1,56 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.1"
x="0px"
y="0px"
viewBox="0 0 24 24"
enable-background="new 0 0 1000 1000"
xml:space="preserve"
id="svg8"
sodipodi:docname="delete.svg"
inkscape:version="1.0.1 (3bc2e813f5, 2020-09-07)"
inkscape:export-filename="/home/martin/custom/github/flameshot/data/img/material/white/delete.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96"
width="24"
height="24"><defs
id="defs12" /><sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1920"
inkscape:window-height="1027"
id="namedview10"
showgrid="false"
inkscape:pagecheckerboard="true"
inkscape:zoom="18.250993"
inkscape:cx="9.5139227"
inkscape:cy="17.399017"
inkscape:window-x="1920"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="svg8" />
<metadata
id="metadata2"> Svg Vector Icons : http://www.onlinewebfonts.com/icon <rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata>
<g
id="g6"
style="fill:#ffffff"
transform="matrix(0.02091837,0,0,0.02091837,1.5408163,1.5408163)"><path
d="m 876.9,311.5 c -20.8,0 -37.7,16.9 -37.7,37.7 v 490 c 0,41.6 -33.8,75.4 -75.4,75.4 H 236.2 c -41.6,0 -75.4,-33.8 -75.4,-75.4 v -490 c 0,-20.8 -16.9,-37.7 -37.7,-37.7 -20.8,0 -37.7,16.9 -37.7,37.7 v 490 c 0,83.3 67.5,150.8 150.8,150.8 h 527.7 c 83.3,0 150.8,-67.5 150.8,-150.8 v -490 c -0.1,-20.8 -16.9,-37.7 -37.8,-37.7 z M 349.2,763.8 V 349.2 c 0,-20.8 -16.9,-37.7 -37.7,-37.7 -20.8,0 -37.7,16.9 -37.7,37.7 v 414.6 c 0,20.8 16.9,37.7 37.7,37.7 20.8,0 37.7,-16.8 37.7,-37.7 z m 603.1,-603 H 650.8 V 47.7 C 650.8,26.9 634,10 613.1,10 H 386.9 c -20.8,0 -37.7,16.9 -37.7,37.7 V 160.8 H 47.7 c -20.8,0 -37.7,16.9 -37.7,37.7 0,20.8 16.9,37.7 37.7,37.7 h 904.6 c 20.8,0 37.7,-16.8 37.7,-37.7 0,-20.8 -16.8,-37.7 -37.7,-37.7 z m -376.9,0 H 424.6 V 85.4 h 150.8 z m 150.8,603 V 349.2 c 0,-20.8 -16.8,-37.7 -37.7,-37.7 -20.8,0 -37.7,16.9 -37.7,37.7 v 414.6 c 0,20.8 16.8,37.7 37.7,37.7 20.8,0 37.7,-16.8 37.7,-37.7 z m -188.5,0 V 349.2 c 0,-20.8 -16.8,-37.7 -37.7,-37.7 -20.8,0 -37.7,16.9 -37.7,37.7 v 414.6 c 0,20.8 16.9,37.7 37.7,37.7 20.8,0 37.7,-16.8 37.7,-37.7 z"
id="path4"
style="fill:#ffffff" /></g>
</svg>

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

@@ -117,41 +117,43 @@ target_sources(
main.cpp)
target_include_directories(
flameshot
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../external/singleapplication/>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../external/Qt-Color-Widgets/include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../dbus/>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/cli>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/config>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/core>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/tools>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/tools/arrow>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/tools/pixelate>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/tools/circle>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/tools/circlecount>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/tools/copy>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/tools/exit>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/tools/imgur>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/tools/launcher>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/tools/line>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/tools/marker>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/tools/move>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/tools/pencil>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/tools/pin>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/tools/rectangle>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/tools/redo>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/tools/save>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/tools/selection>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/tools/sizeindicator>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/tools/text>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/tools/undo>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/utils>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/widgets>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/widgets/panel>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/widgets/capture>
$<INSTALL_INTERFACE:include/mylib>)
flameshot
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../external/singleapplication/>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../external/Qt-Color-Widgets/include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../dbus/>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/cli>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/config>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/core>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/tools>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/tools/arrow>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/tools/pixelate>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/tools/circle>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/tools/circlecount>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/tools/copy>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/tools/exit>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/tools/imgur>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/tools/launcher>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/tools/line>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/tools/marker>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/tools/move>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/tools/pencil>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/tools/pin>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/tools/rectangle>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/tools/redo>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/tools/save>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/tools/selection>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/tools/sizeindicator>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/tools/text>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/tools/undo>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/tools/sizeincrease>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/tools/sizedecrease>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/utils>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/widgets>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/widgets/panel>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/widgets/capture>
$<INSTALL_INTERFACE:include/mylib>)
target_link_libraries(
flameshot

View File

@@ -4,6 +4,8 @@ target_sources(flameshot PRIVATE circle/circletool.h circle/circletool.cpp)
target_sources(flameshot PRIVATE circlecount/circlecounttool.h circlecount/circlecounttool.cpp)
target_sources(flameshot PRIVATE copy/copytool.h copy/copytool.cpp)
target_sources(flameshot PRIVATE exit/exittool.h exit/exittool.cpp)
target_sources(flameshot PRIVATE sizeincrease/sizeincreasetool.h sizeincrease/sizeincreasetool.cpp)
target_sources(flameshot PRIVATE sizedecrease/sizedecreasetool.h sizedecrease/sizedecreasetool.cpp)
target_sources(
flameshot
PRIVATE imgur/imguruploader.h

View File

@@ -31,7 +31,9 @@ enum class ToolType
SIZEINDICATOR,
TEXT,
UNDO,
UPLOAD
UPLOAD,
SIZEINCREASE,
SIZEDECREASE
};
class CaptureTool : public QObject
@@ -79,6 +81,10 @@ public:
REQ_INCREMENT_CIRCLE_COUNT,
REQ_DECREMENT_CIRCLE_COUNT,
// increase tool size for all tools
REQ_INCREASE_TOOL_SIZE,
// decrease tool size for all tools
REQ_DECREASE_TOOL_SIZE
};
explicit CaptureTool(QObject* parent = nullptr)

View File

@@ -0,0 +1,59 @@
// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors
//
// This file is part of Flameshot.
//
// Flameshot 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.
//
// Flameshot 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 Flameshot. If not, see <http://www.gnu.org/licenses/>.
#include "sizedecreasetool.h"
#include <QPainter>
SizeDecreaseTool::SizeDecreaseTool(QObject* parent)
: AbstractActionTool(parent)
{}
bool SizeDecreaseTool::closeOnButtonPressed() const
{
return false;
}
QIcon SizeDecreaseTool::icon(const QColor& background, bool inEditor) const
{
Q_UNUSED(inEditor);
return QIcon(iconPath(background) + "minus.svg");
}
QString SizeDecreaseTool::name() const
{
return tr("Increase Tool Size");
}
ToolType SizeDecreaseTool::nameID() const
{
return ToolType::SIZEDECREASE;
}
QString SizeDecreaseTool::description() const
{
return tr("Decrease the size of the other tools");
}
CaptureTool* SizeDecreaseTool::copy(QObject* parent)
{
return new SizeDecreaseTool(parent);
}
void SizeDecreaseTool::pressed(const CaptureContext& context)
{
Q_UNUSED(context);
emit requestAction(REQ_DECREASE_TOOL_SIZE);
}

View File

@@ -0,0 +1,41 @@
// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors
//
// This file is part of Flameshot.
//
// Flameshot 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.
//
// Flameshot 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 Flameshot. If not, see <http://www.gnu.org/licenses/>.
#pragma once
#include "src/tools/abstractactiontool.h"
class SizeDecreaseTool : public AbstractActionTool
{
Q_OBJECT
public:
explicit SizeDecreaseTool(QObject* parent = nullptr);
bool closeOnButtonPressed() const;
QIcon icon(const QColor& background, bool inEditor) const override;
QString name() const override;
QString description() const override;
CaptureTool* copy(QObject* parent = nullptr) override;
protected:
ToolType nameID() const override;
public slots:
void pressed(const CaptureContext& context) override;
};

View File

@@ -0,0 +1,59 @@
// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors
//
// This file is part of Flameshot.
//
// Flameshot 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.
//
// Flameshot 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 Flameshot. If not, see <http://www.gnu.org/licenses/>.
#include "sizeincreasetool.h"
#include <QPainter>
SizeIncreaseTool::SizeIncreaseTool(QObject* parent)
: AbstractActionTool(parent)
{}
bool SizeIncreaseTool::closeOnButtonPressed() const
{
return false;
}
QIcon SizeIncreaseTool::icon(const QColor& background, bool inEditor) const
{
Q_UNUSED(inEditor);
return QIcon(iconPath(background) + "plus.svg");
}
QString SizeIncreaseTool::name() const
{
return tr("Increase Tool Size");
}
ToolType SizeIncreaseTool::nameID() const
{
return ToolType::SIZEINCREASE;
}
QString SizeIncreaseTool::description() const
{
return tr("Increase the size of the other tools");
}
CaptureTool* SizeIncreaseTool::copy(QObject* parent)
{
return new SizeIncreaseTool(parent);
}
void SizeIncreaseTool::pressed(const CaptureContext& context)
{
Q_UNUSED(context);
emit requestAction(REQ_INCREASE_TOOL_SIZE);
}

View File

@@ -0,0 +1,41 @@
// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors
//
// This file is part of Flameshot.
//
// Flameshot 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.
//
// Flameshot 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 Flameshot. If not, see <http://www.gnu.org/licenses/>.
#pragma once
#include "src/tools/abstractactiontool.h"
class SizeIncreaseTool : public AbstractActionTool
{
Q_OBJECT
public:
explicit SizeIncreaseTool(QObject* parent = nullptr);
bool closeOnButtonPressed() const;
QIcon icon(const QColor& background, bool inEditor) const override;
QString name() const override;
QString description() const override;
CaptureTool* copy(QObject* parent = nullptr) override;
protected:
ToolType nameID() const override;
public slots:
void pressed(const CaptureContext& context) override;
};

View File

@@ -19,6 +19,8 @@
#include "redo/redotool.h"
#include "save/savetool.h"
#include "selection/selectiontool.h"
#include "sizedecrease/sizedecreasetool.h"
#include "sizeincrease/sizeincreasetool.h"
#include "sizeindicator/sizeindicatortool.h"
#include "src/utils/confighandler.h"
#include "text/texttool.h"
@@ -95,6 +97,12 @@ CaptureTool* ToolFactory::CreateTool(CaptureToolButton::ButtonType t,
case CaptureToolButton::TYPE_CIRCLECOUNT:
tool = new CircleCountTool(parent);
break;
case CaptureToolButton::TYPE_SIZEINCREASE:
tool = new SizeIncreaseTool(parent);
break;
case CaptureToolButton::TYPE_SIZEDECREASE:
tool = new SizeDecreaseTool(parent);
break;
default:
tool = nullptr;
break;

View File

@@ -126,6 +126,9 @@ static std::map<CaptureToolButton::ButtonType, int> buttonTypeOrder
#else
{ CaptureToolButton::TYPE_EXIT, 17 }, { CaptureToolButton::TYPE_PIN, 18 },
#endif
{ CaptureToolButton::TYPE_SIZEINCREASE, 20 },
{ CaptureToolButton::TYPE_SIZEDECREASE, 21 },
};
int CaptureToolButton::getPriorityByButton(CaptureToolButton::ButtonType b)
@@ -159,4 +162,6 @@ QVector<CaptureToolButton::ButtonType>
#endif
CaptureToolButton::TYPE_PIN,
CaptureToolButton::TYPE_CIRCLECOUNT,
CaptureToolButton::TYPE_SIZEINCREASE,
CaptureToolButton::TYPE_SIZEDECREASE,
};

View File

@@ -39,7 +39,9 @@ public:
TYPE_REDO = 16,
TYPE_PIN = 17,
TYPE_TEXT = 18,
TYPE_CIRCLECOUNT = 19
TYPE_CIRCLECOUNT = 19,
TYPE_SIZEINCREASE = 20,
TYPE_SIZEDECREASE = 21,
};
Q_ENUM(ButtonType)

View File

@@ -958,6 +958,26 @@ void CaptureWidget::handleButtonSignal(CaptureTool::Request r)
w->show();
}
break;
case CaptureTool::REQ_INCREASE_TOOL_SIZE:
// increase thickness
m_context.thickness = qBound(0, m_context.thickness + 1, 100);
// show notifier circle
m_notifierBox->showMessage(QString::number(m_context.thickness));
emit thicknessChanged(m_context.thickness);
break;
case CaptureTool::REQ_DECREASE_TOOL_SIZE:
// decrease thickness
m_context.thickness = qBound(0, m_context.thickness - 1, 100);
// show notifier circle
m_notifierBox->showMessage(QString::number(m_context.thickness));
emit thicknessChanged(m_context.thickness);
break;
default:
break;
}