* Don't show buttons if selection is inactive
Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
* Move tool creates new selection if not visible
Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
* Make thickness adjustment methods uniform
Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
* Hide cursor while changing thickness
Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
* Make --path work correctly with relative paths
Relative paths are taken relative to the working directory of the calling
command, not relative to the daemon's working directory.
* Allow file paths in --path and refactor
* Remove some redundancy
These actions are already performed in the respective functions in
FlameshotDBusAdapter.
* Tweak --path error checker a bit more
* Rework FileNameHandler and update references
The class now has a much simpler interface.
- Screenshot paths are now universally determined by the function
properScreenshotPath
- Some unreferenced methods have been removed
- The documentation of properScreenshotPath documents the changes well.
* Add crude tests for --path
Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
* Fix failing build on Windows
Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
* Add a test for invalid path
Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
* Make tests clearer
Thanks to @mmahmoudian for his review and contribution.
Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
* Fix bug in properScreenshotPath
Auto-numeration did not work when the screenshot was automatically
saved when copied to clipboard.
Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
* Fall back to default pictures location
Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
* Revert "Remove some redundancy"
This was not redundancy. I had actually introduced a bug with this.
This reverts commit 011ef737564892e494518443e6b80ccf3d286ae1.
* Change default path only on interactive save
Previously, the default save path was changed every time a screenshot
was saved. Now, that only happens when it gets saved from the GUI.
Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
* Change --path help text
Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
* Allow other image formats
Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
* Show shortcuts in CaptureToolButton tooltips
Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
* Change size indicator tooltip to reduce ambiguity
* Make CaptureWidget::initShortcuts uniform
Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
* Disable window flags in debug builds
Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
* Remove pointer in extendedRect parameter
Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
* Move color initialization to the constructor
* Rename updateButtons to initButtons
Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
* Rename handleButtonSignal to handleToolSignal
Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
* Remove useless code in pixmap()
Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
* Remove obsolete comment
Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
* Move processTool definition inline
Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
* Merge painter, aliasing and process into a function
Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
* Fix inconsistent (non)usage of emit
Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
* Rename nameID to type
Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
* Remove some redundancy in confighandler.cpp
- In `getButtons`: instead of re-adding all the buttons manually, now
the buttons are taken from
`CaptureToolButton::getIterableButtonTypes()` and those we want
unchecked are removed.
- Changed some parts to use `fromButtonToInt` instead of re-implementing
it inline each time
Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
* Revert "Disable window flags in debug builds"
This reverts commit 2adb583359bc0a1fd2d335f2d0e88299a4d1dd65.
* Disable window flags in debug builds
Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
* Make `ShortcutsWidget` load all shortcuts
`ShortcutsWidget" now loads shortcuts for all capture widgets,
regardless of enabled state in 'Interface settings'.
Also removed unnecessary indirection which made the API confusing:
- Removed `ConfigHandler::setShortcutsDefault` which was only called
once on a temporary `ConfigHandler` and hence had no effect
- Removed function `ConfigHandler::shortcuts`
- `ShortcutsWidget` now calls `ConfigShortcuts::captureShortcutsDefault`
directly instead of through `ConfigHandler::shortcuts`
Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
* Enable shortcuts for hidden buttons
Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
* Fix crash if ButtonHandler has no buttons
Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
* obligatory clang-format
Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
* GeneralConf.cpp: Remove redundant initializations
Removed unnecessary setChecked and setValue calls in init* methods which
get called inside updateComponents anyway. Also added missing function
calls in updateComponents. This has exposed more bugs.
Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
* Merge updateComponents and setActualFormData
Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
* Fix useJpgForClipboard checkbox
Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
* Fix crash when 'Automatic updates' is checked
The config window used to crash when 'Automatic updates' check box was
interacted with, if the application started with the system tray
disabled.
Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
* Some cleanup
Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
* Fix#1697 and #1726
Changed ConfigWindow to inherit QWidget and moved QTabWidget to be an
attribute. setMinimumSize is no longer necessary in ConfigWindow.
Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
* Create scroll area around checkboxes
Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
* Do not truncate tab bar anymore
Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
* Set parent widget to prevent a memory leak
Signed-off-by: Haris Gušić <harisgusic.dev@gmail.com>
Using QFileInfo::baseName() discards everything after the first ., so
filenames like 1.2.3.4.png would be changed to 1.png. (See #1722).
Changing this to QFileInfo::completeBaseName() only discards the suffix,
so we have 1.2.3.4.jpg becoming 1.2.3.4.png, for example.
* fix - It is possible to edit previously created text by clicking editing frame of another one & search optimization
(cherry picked from commit 749c968f0bfe1ea4b54c0f2e58c0766365f9fc01)
* fix - It is possible to edit previously created text by clicking editing frame of another one (final fix)
(cherry picked from commit f80de3137b2a364d39021440c812fc97c81423ea)
Co-authored-by: Yuriy Puchkov <yuriy.puchkov@namecheap.com>
* fix - App crashes if during editing text add any object (one more fix for the same issue)
(cherry picked from commit 08a3b01929ac01de26a25883f3acded6a29c500b)
* fix - Upload doesn't called (active tool is not set on processTool)
(cherry picked from commit d914b2ba7ba4d1741f6e990587d13a5d08b0c591)
* fix - crash on draw (rollback optimisation)
(cherry picked from commit 2769c45eac69c6a36284a4d5a16ca2c49262d158)
Co-authored-by: Yuriy Puchkov <yuriy.puchkov@namecheap.com>
* fix - crash if during editing text add any object
(cherry picked from commit f5ae7c083965a4a65bd39ff554d667a1e68c4b37)
* fix - Phantom is displayed on a screen if the figure was moved after double click on it and the last changes were undo and redo
(cherry picked from commit 181979162fc7b2c398d7c84e95526ebb4fa4780f)
* fix - Undo tool undo the last created object instead undo changing if click undo during editing object
(cherry picked from commit 27bbb3a3b29718d476b9f8d98a0efa9fa12f16c2)
Co-authored-by: Yuriy Puchkov <yuriy.puchkov@namecheap.com>