Commit Graph

29 Commits

Author SHA1 Message Date
borgmanJeremy
a6144df367 Fix alignment bug and applied many clang format warnings (#2448)
* Fix alignment bug and applied many clang format warnings

* removed nodiscard from slot
2022-02-23 06:33:58 -06:00
borgmanJeremy
0ac48f5c4b Clang tidy (#2372)
* Added missing braces

* applied some clang modernize

* clarified auto pointer

* clang-tidy
2022-02-06 12:12:09 -06:00
borgmanJeremy
8ab1ac0eaa Bumping Qt-Color-Widgets (#2052)
* Bumping Qt-Color-Widgets

* changing Qt Color Widget CMAKE setup
2021-11-20 20:44:58 -06:00
borgmanJeremy
53cc11ac58 adjusted layout of side bar to center slider (#2093) 2021-11-19 18:47:39 -06:00
Clayton
f25d58b6db Allows color form elements to wrap, sets minimum width to thickness s… (#2068)
* Allows color form elements to wrap, sets minimum width to thickness slider.

* Uses named constant variable for slider width
2021-11-15 11:40:14 -06:00
Haris Gušić
534f05b238 Refactor tool size handling (#1969)
* Add ConfigHandler::toolSize and setToolSize

* Refactor thickness (now toolSize) in CaptureWidget

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Fix update of tool size while object is drawn

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Rename thickness to tool size across the board

Tool size is the generic term. Depending on the selected tool,
different specialized names are used. This has always been the case
in the config.

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Reorder circle count tool

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* clang-format

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
2021-10-20 00:01:35 +02:00
Haris Gušić
b05b028861 Miscellaneous small fixes (#1972)
* m_captureWindow->activateWindow(), raise()

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Revert "m_captureWindow->activateWindow(), raise()"

This reverts commit 36320aa38a9584864a5fab32a2ce4872ff5ad072.

* screen --number: indicate 0-indexation

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Fix color update bug

Also refactored SidePanelWidget sigslots related to color change.

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Stop creating empty flameshot.conf file

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
2021-10-17 17:38:16 +02:00
Haris Gušić
fef7787011 Capture GUI refactor (#1939)
* Merge CTB::ButtonType into CaptureTool::Type

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Remove configshortcuts.cpp which I forgot to do earlier

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Add activeButtonTool & activeButtonToolType in CaptureWidget

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Rename slots in CaptureTool for better mnemonics

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Fix move tool bug

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Refactor ShortcutsWidget::initButtons

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Move code from CaptureWidget to SelectionWidget: part 1

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Move code from CaptureWidget to SelectionWidget: part 2

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Move code from CaptureWidget to SelectionWidget: part 3

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Move code from CaptureWidget to SelectionWidget: part 4

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Add SelectionWidget::updateCursor

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Move code from CaptureWidget to SelectionWidget: part 5

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Refactor mouse events in CaptureWidget

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Overlay message update

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Replace connect/disconnect with blockSignals

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* updateIcon on button animation finished

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Remove CaptureWidget::selectAll

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Move moveLeft and similar to SelectionWidget

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Mark update calls for removal

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Specialize CaptureWidget update to affected rects

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Tune update of tool objects

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Remove redundant CaptureTool requests

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Improve performance of update in CaptureWidget

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Fix failing builds

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Fix failing builds again

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Fix undo/redo update

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Undo/redo update workaround

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Extend capture tool update rects

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Fix circle count tool update bug

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Add 'Left Double-Click' tooltip to copy button

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Improve ColorPicker performance

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
2021-10-08 11:04:06 -05:00
Mitchel Humpherys
c2ea8b6f61 Reduce max thickness (#1940)
The thickness slider is fairly small, so it's difficult to make small
adjustments. The max value of the thickness slider is currently 100, which
is actually pretty huge.

Since most common use cases involve smaller pixel values (closer to the
0-10 range, I suspect), reduce the maximum slider value to 25, allowing for
easier fine grained control of the drawing thickness.

Although fine grained control is already possible via the scroll wheel,
this change improves the overall usability of the tool, especially for new
users who many not know that thickness can be adjusted with the scroll
wheel (or for users who don't have a scroll wheel).
2021-10-06 19:50:54 -05:00
Haris Gušić
aca0db963b Color grabber zoom preview (#1869)
* Add ColorGrabWidget

The new widget aims to decouple color grabbing from the SidePanelWidget.

* Refactor SidePanelWidget to use ColorGrabWidget

- All color grabbing functionality is now moved to ColorGrabWidget
- SidePanelWidget now uses a more organized sigslot approach
- Removed QColorPickingEventFilter

* Fix bug and complete implementation

Timer not yet implemented.

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Add 0.5s timer

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Fix failing builds

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Add hex color editor

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Add right mouse button instant preview

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Make zoom widget toggle-able

* Implement OverlayMessage class

* Make Right click do the same as Space

* Unzoom widget when mouse leaves it

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Fix some small issues

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Toggle panel when grabbing color

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Show with timer even if magnifier active

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Reduce timer delay

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Fix OverlayMessage bug

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
2021-09-13 09:09:25 -05:00
Haris Gušić
9147d4ea03 Implement tool thickness via keyboard (#1882)
* Implement changing tool size by keyboard

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>

* Fix very poor performance when changing thickness

* Make thickness get saved to config

Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
2021-09-11 12:57:43 -05:00
Yurii Puchkov
df5760c15a NC/Optimisations and bug fixes for objects editing (#1600)
* Optimise undo/redo for thickness, do not save every change on mouse wheel, save just the result

(cherry picked from commit c0bd74790e086dcde1c242a31e27f992a04c07e2)

* fix - In some cases undo/redo stack has excess steps (root cause is in the start move object event on a small not noticeable mouse move)

(cherry picked from commit 912f39f38083e368979f34ef14821979c34482bb)

* fix - It is impossible to remove an object using the "Undo the latest modification" button on second attempt (full undo, draw something, full undo again)

(cherry picked from commit a7f77a130a497ac6fdecd59eb43c889dcc6cbe1a)

* fix - Picked font family in the text editing tool is applied to the autoincrement tool

(cherry picked from commit 11c5eb29b1078bd6aba91fe7a74c2682767ad47c)

* Add git hash to version in the about dialog

(cherry picked from commit b4dbf52b3217b51614100bd307046772a37dc484)

* Add configuration option to limit undo steps

(cherry picked from commit f13cbecabb172060b196a535348f145457ad2f0f)

* Object delete operation is not registered on the undo stack

(cherry picked from commit 5c966cb5d3702a4d735dd542ad03a80899250b4a)

* fix - Unable to draw an object from second attempt after ColorPicker was called

(cherry picked from commit 49a119886fec253376703e8aa2386e16bc23cbcf)

* fix - App freezes and then crashes when changing object line thickness via Active thickness slider in the tool settings

(cherry picked from commit 26fd64f1c333f70c67282630362cbc5fc8427a39)

* fix - set min and max values for thickness slider to 1-100

(cherry picked from commit 6d8661666e4e199a3c29f991d52bef73ec36129c)

* fix - Crash on Move Tool button with an active Text editor

(cherry picked from commit 461f95da3afda56c0e9693e768e86b18d056eecc)

* fix - Text is not modified when picking it as object in the list

(cherry picked from commit 366bb0928b430d442dc67299353f7dc5ceb743b4)

* fix - Text modification cannot be undone
fix - Object that was created after the text object disappears after undo editing text

(cherry picked from commit 79b2fb92aca65b177cffb386db141d30551a2b1c)

* fix - Text is not saved if picking any object in the objects list without clicking at the empty space

(cherry picked from commit 4679a744a3d2498fe27379f89d48b347a34ae0dc)

* Last available undo step reset everything to the beginning

(cherry picked from commit 4af7423d00cfaa9feabc905400aa3ac30fc4a3ea)

* Missed changes (cherry-pick) for switching ColorPicker behaviour (right mouse click and hold to right mouse click and left click)

Co-authored-by: Yuriy Puchkov <yuriy.puchkov@namecheap.com>
2021-05-02 12:48:22 -05:00
Boyuan Yang
a9c7cc7b04 Use SPDX-License-Identifier
closes: #1374 .

Use SPDX short-form identifiers instead of lengthy copyright
header to document per-file license and copyright.

This commit updates all files under src/ directory where applicable
as well as org.flameshot.Flameshot.metainfo.xml.
2021-02-20 19:22:53 -05:00
Yuriy Puchkov
ebdb3743dd Code refactoring - remove Q_OS_MAC64 (is not required, is covered by Q_OS_DARWIN)
(cherry picked from commit e511b521cec6edd9f77916c6ee753329326a5f91)
2021-02-17 18:46:12 +02:00
Yuriy Puchkov
dd54d028a1 Code refactoring - remove Q_OS_MACX (is not required, is covered by Q_OS_DARWIN)
(cherry picked from commit 00b9aae5266aaffb9a01a6f689e1829ae8218bdc)
2021-02-17 18:46:12 +02:00
Yuriy Puchkov
a893fdfc75 Code refactoring - remove Q_OS_MAC (deprecated synonym for Q_OS_DARWIN)
(cherry picked from commit aff1649670aa5ba64f2927933a29c62b06fee21f)
2021-02-17 18:46:12 +02:00
Yuriy Puchkov
dc7f62ab8d Fix - MacOS - get currentScreen on the edge bottom and right returns nullptr and application crashes
(cherry picked from commit 01ae74fbed34849db485db53ffbdf4a938ebea8e)
2021-02-17 18:46:12 +02:00
Yuriy Puchkov
94f0aecf81 Grab color returns black color
(cherry picked from commit aa2e236c7dcf882205701ea00c4fed7cfbf7c0c2)
2021-02-17 18:46:12 +02:00
Yuriy Puchkov
4cfa25b966 fix - MacOS - Grabbed color differs from the clicked area
(cherry picked from commit 850d7f1df3c8a3fa9aa3db7beaba242abe78a855)
2021-02-17 18:46:12 +02:00
Sonu Lohani
c477c3dac6 Fix value update when slider moved through mouse scroll 2021-02-01 19:14:59 -06:00
Yuriy Puchkov
d4d3b9eae0 Merge branch 'master-flameshotorg' into master_nc_merge_upstream
# Conflicts:
#	.travis.yml
#	appveyor.yml
#	data/graphics.qrc
#	data/img/app/keyboard.svg
#	data/img/material/black/delete.png
#	data/img/material/black/delete.svg
#	data/img/material/black/filepath.svg
#	data/img/material/black/shortcut.svg
#	data/img/material/white/filepath.svg
#	data/img/material/white/shortcut.svg
#	data/translations/Internationalization_hu.ts
#	data/translations/Internationalization_ka.ts
#	external/Qt-Color-Widgets/src/color_wheel.cpp
#	external/singleapplication/singleapplication.cpp
#	flameshot.pro
#	src/cli/commandlineparser.cpp
#	src/config/buttonlistview.cpp
#	src/config/configwindow.cpp
#	src/config/configwindow.h
#	src/config/geneneralconf.cpp
#	src/config/geneneralconf.h
#	src/config/uicoloreditor.cpp
#	src/config/uicoloreditor.h
#	src/core/controller.cpp
#	src/core/globalshortcutfilter.cpp
#	src/main.cpp
#	src/third-party/Qt-Color-Widgets/src/color_utils.cpp
#	src/tools/abstractactiontool.h
#	src/tools/abstractpathtool.h
#	src/tools/arrow/arrowtool.cpp
#	src/tools/arrow/arrowtool.h
#	src/tools/blur/blurtool.cpp
#	src/tools/capturetool.h
#	src/tools/circle/circletool.cpp
#	src/tools/circle/circletool.h
#	src/tools/copy/copytool.cpp
#	src/tools/copy/copytool.h
#	src/tools/exit/exittool.cpp
#	src/tools/exit/exittool.h
#	src/tools/imgur/imguruploader.cpp
#	src/tools/launcher/applaunchertool.cpp
#	src/tools/launcher/applaunchertool.h
#	src/tools/launcher/applauncherwidget.cpp
#	src/tools/launcher/openwithprogram.cpp
#	src/tools/line/linetool.cpp
#	src/tools/line/linetool.h
#	src/tools/marker/markertool.cpp
#	src/tools/marker/markertool.h
#	src/tools/move/movetool.cpp
#	src/tools/pencil/penciltool.cpp
#	src/tools/pencil/penciltool.h
#	src/tools/pin/pintool.cpp
#	src/tools/pin/pintool.h
#	src/tools/pin/pinwidget.cpp
#	src/tools/pixelate/pixelatetool.h
#	src/tools/rectangle/rectangletool.cpp
#	src/tools/rectangle/rectangletool.h
#	src/tools/redo/redotool.cpp
#	src/tools/redo/redotool.h
#	src/tools/save/savetool.cpp
#	src/tools/save/savetool.h
#	src/tools/selection/selectiontool.cpp
#	src/tools/selection/selectiontool.h
#	src/tools/sizeindicator/sizeindicatortool.cpp
#	src/tools/sizeindicator/sizeindicatortool.h
#	src/tools/storage/imgur/imguruploader.h
#	src/tools/storage/imgur/imguruploadertool.cpp
#	src/tools/storage/imgur/imguruploadertool.h
#	src/tools/text/textconfig.cpp
#	src/tools/text/texttool.cpp
#	src/tools/text/texttool.h
#	src/tools/toolfactory.cpp
#	src/tools/toolfactory.h
#	src/tools/undo/undotool.cpp
#	src/tools/undo/undotool.h
#	src/utils/confighandler.cpp
#	src/utils/confighandler.h
#	src/utils/dbusutils.cpp
#	src/utils/screenshotsaver.cpp
#	src/utils/screenshotsaver.h
#	src/widgets/capture/buttonhandler.cpp
#	src/widgets/capture/buttonhandler.h
#	src/widgets/capture/capturebutton.cpp
#	src/widgets/capture/capturebutton.h
#	src/widgets/capture/capturewidget.cpp
#	src/widgets/capture/capturewidget.h
#	src/widgets/capture/colorpicker.cpp
#	src/widgets/capturelauncher.cpp
#	src/widgets/infowindow.cpp
#	src/widgets/infowindow.h
#	src/widgets/panel/sidepanelwidget.cpp
#	src/widgets/panel/utilitypanel.cpp
#	src/widgets/panel/utilitypanel.h
#	translations/Internationalization_ca.ts
#	translations/Internationalization_de_DE.ts
#	translations/Internationalization_es.ts
#	translations/Internationalization_fr.ts
#	translations/Internationalization_ja.ts
#	translations/Internationalization_nl.ts
#	translations/Internationalization_pl.ts
#	translations/Internationalization_pt_br.ts
#	translations/Internationalization_ru.ts
#	translations/Internationalization_sk.ts
#	translations/Internationalization_sr.ts
#	translations/Internationalization_tr.ts
#	translations/Internationalization_uk.ts
#	translations/Internationalization_zh_CN.ts
#	translations/Internationalization_zh_TW.ts
2020-09-24 18:52:49 +03:00
Jeremy Borgman
0d5386edd4 Changed clang format to new agreement 2020-09-24 07:53:28 -05:00
Yuriy Puchkov
b88a5fbce8 Code refactoring - change code style to the new clang-format rules 2020-09-23 15:25:13 +03:00
Yuriy Puchkov
d061290fb1 Add configurable shortcuts for drawing tools 2020-09-14 16:14:32 +03:00
Jeremy Borgman
c8d15205be reformatted to Mozilla code style 2020-09-04 20:40:45 -05:00
Jeremy Borgman
dc77029cde Fixed most depratated warnings. 2020-07-13 15:02:18 -05:00
lupoDharkael
42619158fa Update copyright year 2019-03-04 16:38:45 +01:00
Alfredo Ramos
ee2f583acd Fix some issues detected by Clazy (#384)
* Fix old style connect

* Fix unneeded QString memory allocations
2018-10-24 01:04:42 +02:00
Alfredo Ramos
da49ed556f [WIP] Add line thickness to side panel (#374)
* Add thickness slider

* Fix enums compatibility

* Rename ColorPickerWidget to SidePanelWidget
2018-10-10 23:34:42 +02:00