Commit Graph

293 Commits

Author SHA1 Message Date
Jiachen Yang
b612bdbbae fixing #459 by update m_context with m_selection (#470) 2019-02-22 16:29:40 +01:00
Pavel Makarenko
8887b4e7ce Add support for more images formats (#436)
* Add support for more images formats

* Resolves extension verifying  in case of empty save path string

* Code formatting
2019-01-30 15:37:56 +01:00
Boyuan Yang
25246a79f0 utils/confighandler.cpp: Enable Pin and Text tool by default (#443)
This commit enables all the available tools by default so that
users may use them out-of-box without bothering with modifying
configuration.
2019-01-09 19:08:54 +01:00
James LaChance
472a275bb9 Exit non-zero when aborting with --raw. (#424)
This fixes #302. Note that I also added a non-zero exit status when DBus
fails to connect.
2018-12-28 16:39:04 +01:00
luzpaz
665f309018 Misc. source comment typos (#423)
Found via `codespell -i 3 -w -S ./translations -L uint,exten -C 3`
2018-12-28 16:13:29 +01:00
Alfredo Ramos
2716631591 Document shortcut for sidebar (#401)
* Document shortcut for sidebar

* Use appveyor-retry to prevent transfer.sh timeouts
2018-11-14 16:51:22 +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
dgw
7d91b00072 Make tools' (English) tooltip phrasing consistent (#375)
Some tooltips were written as imperatives ("Set foo to bar"), others
were written as simple present ("Performs foo action"). All should now
be consistently written in imperative form (unless I missed any…).
2018-10-21 10:22:21 +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
Streppel
c3ad9b6c41 Fixes #362 (#363)
This fixes #362, making the enter key copy the content of the GUI selection copy the content to the clipboard
2018-10-04 16:43:25 +02:00
lupoDharkael
affba85666 Remove Wayland duplicated screenshots after dbus calls 2018-09-28 23:31:22 +02:00
Ahmed Zetao Yang
503de1be04 Pin Tool: Improve adjustment (#352)
Fix pin widget adjustment position
2018-09-21 13:55:16 +02:00
lupoDharkael
415b059fb2 Fix #311
Flameshot was unable to start new captures after saving with
    Ctrl+s while having a text area active from the Text tool.
    This was caused by the overloaded call to close() which
    was deleting the text area instead of closing the capture
    and the consequent call of the destructor. That caused an
    always active capture session.
2018-09-13 15:35:49 +02:00
Boyuan Yang
36c62f6e81 infowindow: Pop up infowindow at screen center (#318)
Currently info window will pop up at the topleft corner of the screen,
which is rather bothering. This patch will move the window to
screen center when popped up.

Since QGuiApplication::ScreenAt() is introduced since Qt 5.10, the
code will only take effect when compiled against Qt >= 5.10.

Signed-off-by: Boyuan Yang <073plan@gmail.com>
2018-08-19 18:33:00 +02:00
Jiachen Yang
59d88dd2de fix auto locale detection (#308)
Current implementation QLocale::system.language() will not correctly
differs Simplified Chinese with Traditional Chinese, which is causing
problems to load translations for zh_TW. This fix the problem by
following the documentation here:
https://doc.qt.io/qt-5/qtranslator.html#load-1
2018-08-12 11:39:42 +02:00
Peter Cai
ae9d18ce9e blur: fix HiDPI awareness (#305)
When copying from a QPixmap, the rectangle area should be scaled according to `devicePixelRatio`.

This fixes #300.
2018-08-11 11:44:32 +02:00
Alfredo Ramos
7ba02666d1 Fix most of the issues reported by cppcheck (#290) 2018-07-29 00:17:50 +02:00
Alfredo Ramos
228c4f15e5 Use absolute locations in translation files (#288)
They provide context when using Qt Liguist, as it shows the source code where it is being used.

Also replaced QT (capital T) with Qt, as the latter is the correct name.
2018-07-28 00:03:02 +02:00
Alfredo Ramos
d09580b873 Optimize and use SVG images where possible (#281)
SVG images have been optimized with svgo, this will slightly reduce package size though the main reason for this was to remove unneeded markup.

Image paths have been changed and merged, now the directory tree looks like this:

img
├── app
├── material
│   ├── black
│   └── white
└── preview

The reason to merge the paths is to avoid duplicate files for buttons and configuration.

SVG icons are used by default now, PNG images have not been deleted from the images directory, but they were deleted from the graphics.qrc resource file.

All image paths were updated accordingly, except in the tray icon, I could not make it work using the SVG image.
2018-07-24 00:43:01 +02:00
Alfredo Ramos
9748ae015e Fix image file saving (#279)
This change ensures that the file name contains the PNG extension.

Currently the screenshots are saved as PNG only, so this only checks if the absolute path contains .png, it does not check the file suffix (QFileInfo).

Fixes #278
2018-07-23 11:15:39 +02:00
Peter Cai
21670e3344 screengrabber: fix devicePixelRatio detection (#277) 2018-07-22 15:30:52 +02:00
Alfredo Ramos
b301880872 Update Spanish translation and cleanup (#268)
* Fix TextTool warning

It throws the following warning:

src/tools/text/texttool.cpp:50: Class TextTool lacks Q_OBJECT macro

* Add missing translations

* Remove obsolete translations

lupdate -no-obsolete flameshot.pro
2018-07-07 22:37:32 +02:00
Boyuan Yang
ecdd3b2e45 Fix typo; Refresh translation; Update zh-CN translation (#267)
* Fix typos found by codespell

* redotool: Mark description string as translatable

* Refresh translation; Update zh_CN translation again
2018-07-07 14:23:24 +02:00
Danilo Egêa Gondolfo
df3958e43a Use defined(Q_OS_LINUX) || defined(Q_OS_UNIX) where applicable to support BSD OSs. (#264) 2018-07-01 13:45:49 +02:00
Alfredo Ramos
c75c9aa7f8 Set keyboard shortcuts to read-only (#261)
Currently keyboard shortcuts cannot be changed, double clicking a cell in the Information window only changes the text, not the shortcut.

This could help to avoid user confusion, and should be reverted once the application adds an option to change keyboard shortcuts.
2018-06-29 16:23:14 +02:00
Alfredo Ramos
2efc082599 Remove hard-coded Imgur client_id (#253)
This will allow users to set their own Imgur client_id passing the IMGUR_CLIENT_ID variable to qmake.

If the users does not set this variable, it will fallback to the default value.
2018-06-15 00:14:26 +02:00
Giuseppe Burtini
a0616fa970 Fix typo (#250)
http://www.dictionary.com/browse/selection
2018-06-10 22:26:28 +02:00
Alfredo Ramos
a56a58aea9 Store settings colors in hexadecimal format (#243)
This will make easier to see and edit colors in the settings file.

The format is defined by QColor::HexRgb

Fixes #142

https://doc.qt.io/qt-5/qcolor.html#NameFormat-enum

* Add config colors validation

If the user adds an invalid hexadecimal colors, defined default colors will be used instead
2018-06-07 14:23:41 +02:00
lupoDharkael
0481c7cc9d Fix initial index in font family combo box 2018-05-28 19:22:24 +02:00
lupoDharkael
c5498ff385 Integrate Pin widget with user defined colors 2018-05-26 18:55:05 +02:00
lupoDharkael
49227fac43 Solve cppcheck warnings 2018-05-26 18:38:06 +02:00
lupoDharkael
dcaa2e321f Add text configuration in panel 2018-05-26 17:59:44 +02:00
lupoDharkael
cf7066a33e Add cancel information in grab color button 2018-05-23 12:55:26 +02:00
lupoDharkael
33377d50d5 Toggle panel with Space while grabbing a color 2018-05-19 00:55:11 +02:00
lupoDharkael
a8bb555c12 Fix negative selection geometry bug
normalize only swaps the sides if width() or height() is < 0,
but we need it to happen when it is <=0 because with QRect's
normalized method we get negative geometry and that causes a bug
when we position the buttons.
2018-05-17 22:14:02 +02:00
lupoDharkael
12faddff8b Revert: Prevent alt+tab from stealing keyboard
Using grabKeyboard() is not a good solution as it breaks
the text tool and causes other problems.
2018-05-17 20:56:13 +02:00
lupoDharkael
c81ee94a82 Tool: add permanent config method 2018-05-17 20:18:52 +02:00
lupoDharkael
13b0e61d36 Prevent alt+tab from stealing keyboard (#133) 2018-05-17 19:01:06 +02:00
lupoDharkael
09921d507c Replace QKeySequence::Cancel (#226) 2018-05-17 17:45:25 +02:00
lupoDharkael
0bd0ab9ba4 Add side panel help text 2018-05-16 23:20:23 +02:00
lupoDharkael
6adcfef413 Add color tools inside the capture editor 2018-05-16 23:02:30 +02:00
Alfredo Ramos
e69859dc72 Fix config export (#220)
If the user presses the Cancel button using the QFileDialog::getSaveFileName() modal file dialog, it will return null string.

Adding this condition will prevent to show an error when trying to write to disk using an invalid filename.
2018-05-13 23:46:16 +02:00
lupoDharkael
c766b3e048 Add capture individual screens option 2018-05-08 21:23:09 +02:00
Alfredo Ramos
1e93057ceb Add delete Imgur image button (#210) 2018-05-06 22:41:52 +02:00
lupoDharkael
33d7e220fc UtilityPanel: force arrow cursor 2018-05-06 15:23:48 +02:00
lupoDharkael
5432614651 Add Text tool
closes #11
Add an initial version of the text tool.
This commit adds:
- Basic text tool.
- On demand thickness and color update.
- Generalized logic for future widget based tools.
2018-05-06 13:56:45 +02:00
Alfredo Ramos
40605ab6b5 Get Imgur data fom JSON object (#206) 2018-05-06 12:41:00 +02:00
lupoDharkael
2fd8bd209b Pin Tool: fix content margins in Windows 2018-05-04 11:21:20 +02:00
lupoDharkael
c68179f64c Pin tool cleanup 2018-05-03 18:53:13 +02:00
Ahmed Zetao Yang
fe8a43a02a Improvement of Pin tool (#191)
- no taskbar window for pin widget
- completely ignore the window manager
- add borderless window shadow effects
2018-05-03 18:11:06 +02:00