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.
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>
* flameshot.pro: Install SVG icon into $prefix/share/icons/hicolor/scalable/apps instead of $prefix/share/pixmaps
While #293 somehow solves the icon problem, it is not the best solution.
According to Freedesktop.org Icon Theme Specification
(https://specifications.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html):
Directory Layout
[...]
By default, apps should look in $HOME/.icons (for backwards compatibility),
in $XDG_DATA_DIRS/icons and in /usr/share/pixmaps (in that order).
[...]
In order to have a place for third party applications to install their icons
there should always exist a theme called "hicolor".
While using /pixmaps/ directory ensures the least priority in search
icons, the directory name itself "pixmaps" does not suite our actual
situation (provided that "flameshot.svg" is a scalable icon, not a *pixmap*).
I suggest that we place this icon into the "hicolor" theme (aka fallback theme)
in /icons/ directory under "scalable/apps/" subdirectory.
Proposed changes:
1. Install flameshot.svg under
$prefix/share/icons/hicolor/scalable/apps/
instad of
$prefix/share/pixmaps/ .
2. Rename qmake "icon" target into "appsvgicon" target so that the
name "icon" may still be used in the future for other tasks.
3. The embedded rpm spec file is updated accordingly.
Signed-off-by: Boyuan Yang <073plan@gmail.com>
* img/app/flameshot.png: Use 128x128 size instead of 100x100
Converted using inkscape:
inkscape -z -e flameshot.png -w 128 -h 128 flameshot.svg
* img: Add hicolor subdir for installation under /usr/share/icons/hicolor/*
* flameshot.pro: Use wildcard to install hicolor icon dir
The embedded rpm spec file is updated too.
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
This reduces build time but this change was primarily made to place the commands to its right place.
This also did a small fix in the travis/linux_script.sh file to use paths defined in variables instead of using the hard-coded ones.
It now installs the image in any of the following paths, depending if CONFIG+=packaging was set in the qmake command.
/usr/local/share/pixmaps/
/usr/share/pixmaps
* Fix path for RPM packages
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.
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.
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
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.
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.
This will make easier to see and edit colors in the settings file.
The format is defined by QColor::HexRgb
Fixes#142https://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
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.