Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
57adae2
~ Use CMAKE_POSITION_INDEPENDENT_CODE instead of setting -fPIC flag
4lex4 Jan 22, 2020
7dcdf36
~ qss: explicitly set QMenu indicator in selected and unchecked state…
4lex4 Jan 20, 2020
9b159f5
~ Fix fixDpiInPlace function
4lex4 Jan 21, 2020
f01e39c
~ Prompt on canceling selection only if it's a user action
4lex4 Jan 21, 2020
fadc751
The feature to sort thumbnails in reverse order
4lex4 Jan 21, 2020
5889358
Fix the bug with guides misplaced when the source images had differen…
4lex4 Jan 21, 2020
abc086a
~ More clearly visible broken chain icon
4lex4 Jan 22, 2020
1c507bb
Fix warnings on launching
4lex4 Jan 23, 2020
2498333
~ Fix: CMAKE_POSITION_INDEPENDENT_CODE and CMAKE_INSTALL_RPATH_USE_LI…
4lex4 Jan 23, 2020
6ac0b41
Improvements and new features on zones interaction
4lex4 Jan 27, 2020
8d5a1b2
~ Consistent naming of local variables
4lex4 Jan 27, 2020
7f0b087
~ Refactor content mask feature
4lex4 Jan 29, 2020
87fdbaf
~ Remove all the info listeners when ImageView hidden
4lex4 Jan 29, 2020
dd2e191
Fix: horizontal original alignment was incorrectly parsed from XML
4lex4 Jan 29, 2020
3d71d36
~ Don't use hard-coded enum values as keys for ColorParams to conform…
4lex4 Jan 30, 2020
1d7e950
~ Disable drawBase property of QTabBar in the themes stylesheet
4lex4 Feb 1, 2020
c88dd7e
Add deviation highlighting button to the thumbnail panel
4lex4 Feb 2, 2020
9934d48
Add buttons to scale thumbnails to the thumbnails panel and respectiv…
4lex4 Feb 2, 2020
c0941c9
~ Remove the unused font from ui files
4lex4 Feb 2, 2020
b14bb3a
Improvements and fixes in deviation highlighting feature:
4lex4 Feb 2, 2020
5f29684
Fix visual glitches around thumbnails at the margins stage
4lex4 Feb 3, 2020
79c5ecd
Reprocess output if the source image has been modified
4lex4 Feb 4, 2020
6901fd0
Add shortcut to manually reload page (F5 key)
4lex4 Feb 4, 2020
a00ab48
Allow dragging the page in lasso zone creation mode by pressing any m…
4lex4 Feb 4, 2020
df443d0
Change the key combination for dragging a guide to Ctrl+Alt+LMB
4lex4 Feb 4, 2020
5c1edd0
~ Fix a possible lag on switching filter on large projects
4lex4 Feb 7, 2020
35ecbcc
~ Add CMake DEVELOPER_VERSION option to enable the internal debug fea…
4lex4 Feb 7, 2020
09fc0df
~ Use std::shared_ptr instead of intrusive_ptr
4lex4 Feb 11, 2020
2c2bd6b
~ Don't use unique_ptr for QObject* members with this parent
4lex4 Feb 11, 2020
b70fa25
~ Implement ConnectionManager to reduce repeating code and ease its m…
4lex4 Feb 13, 2020
c907634
~ Inline some short methods to increase performance
4lex4 Feb 14, 2020
bc36e9c
Make some shortcuts work on different keyboard layouts
4lex4 Feb 19, 2020
cf51057
~ Fix: the cancel shortcut of color pickup interaction was active eve…
4lex4 Mar 6, 2020
d098a7b
Make speckles more visible and add despeckle overlay if no speckles a…
FurloSK Mar 3, 2020
f6c8e5b
Fix tab order for margin spin boxes
FurloSK Mar 5, 2020
e04e60a
~ Fix missing header
4lex4 Mar 17, 2020
3d1e74e
Fix build with Qt 5.15 (missing QPainterPath includes)
a17r May 30, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
20 changes: 13 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,6 @@ if (NOT DEFAULT_COMPILER_FLAGS_IS_SET)
message(WARNING "Only MSVC toolchain is supported to build for Windows XP.")
endif()

if (UNIX)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
endif()

if (CMAKE_COMPILER_IS_GNUCC AND CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wpedantic -Werror=return-type -Wno-unused")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic -Werror=return-type -Wno-unused")
Expand All @@ -60,7 +55,8 @@ if (NOT DEFAULT_COMPILER_FLAGS_IS_SET)
endif()

if (UNIX)
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
option(CMAKE_POSITION_INDEPENDENT_CODE "" ON)
option(CMAKE_INSTALL_RPATH_USE_LINK_PATH "" ON)
endif()

include(cmake/SetDefaultBuildType.cmake)
Expand Down Expand Up @@ -238,7 +234,7 @@ endif()
enable_testing()

# Prepare config.h
option(PORTABLE_VERSION "Whether to build the portable version or not." ON)
option(PORTABLE_VERSION "Whether to build the portable version." ON)
if (PORTABLE_VERSION)
set(PORTABLE_CONFIG_DIR "config")
endif()
Expand All @@ -251,6 +247,16 @@ else()
set(PLUGIN_DIRS ".:../lib/${APPLICATION_NAME}")
endif()
configure_file(config.h.in "${CMAKE_BINARY_DIR}/config.h" @ONLY)
file(READ "${CMAKE_BINARY_DIR}/config.h" config_h_contents)
set(enable_developer_version_default OFF)
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
set(enable_developer_version_default ON)
endif()
option(DEVELOPER_VERSION "Whether to enable the internal debug features." ${enable_developer_version_default})
if (NOT DEVELOPER_VERSION)
string(REGEX REPLACE "(#define[ \\t]+ENABLE_DEBUG_FEATURES[^\n]*)" "//\\1" config_h_contents ${config_h_contents})
endif()
file(WRITE "${CMAKE_BINARY_DIR}/config.h" ${config_h_contents})
include_directories(BEFORE "${CMAKE_BINARY_DIR}")

# Extract VERSION and VERSION_QUAD from version.h
Expand Down
28 changes: 16 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ has't been moved due to dirty realization. Their functionality is fully covered

* Page splitting settings now influence on the output by filling offcut.
Fill offcut option has been added.

* Page layout and all the other views now consider splitting settings.
Corresponding improvements are done for thumbnails.

Expand All @@ -187,8 +187,6 @@ has't been moved due to dirty realization. Their functionality is fully covered
3. UI: Added cutters interaction between each other. They can't more intersect each other,
which created a wrong page layout configuration before.

* Optimized memory usage on the output stage.

* Reworking on [multi column thumbnails view](#multi-column-thumbnails-view-reworked) feature from ver. Enhanced.
Now thumbnails are shown evenly.

Expand Down Expand Up @@ -315,13 +313,19 @@ has't been moved due to dirty realization. Their functionality is fully covered
Added sensitivity option. If sensitivity equals 25%, the results will be the same as they were in old "Quadro" mode, if 100% - as in old "Rectangular".

* ##### New zone interaction modes
**`Shift+LMB`** on a zone - drag the zone.
**`Ctrl+Shift+LMB`** on a zone - drag the zone copying.
**`Del`** when the cursor is over a zone - delete the zone.
Hold **`Ctrl`** when dragging a zone vertex - make the angle of the vertex right.
**`Ctrl+Alt+Click`** - copy the latest created zone to the cursor position.
**`Ctrl`** while creating a new zone - switch to rectangular mode.
Hold **`Shift+Alt+LMB`** while creating a new zone - use lasso (free drawing) mode.
* Zone creation mode:
Press **`Z`** to switch to polygonal mode.
Press **`X`** to switch to lasso (free drawing) mode.
Press **`C`** to switch to rectangular mode.
Press **`Z`** or **`X`** while creating a new zone to switch between polygonal and rectangular modes respectively.
* Zone:
**`Shift+LMB`** on a zone - drag the zone.
**`Ctrl+Shift+LMB`** on a zone - drag the zone copying.
**`Ctrl+Alt+Click`** - copy the latest created zone to the current cursor position.
**`Del`** when the cursor is over a zone - delete the zone.
* Zone vertex:
**`D`** when the cursor is over a zone vertex - delete the vertex.
Hold **`Ctrl`** when dragging a zone vertex - make the angle of the vertex right.

* ##### Saving zoom and focus on switching output tabs
The save is precise and considers the images transformations.
Expand All @@ -334,7 +338,7 @@ has't been moved due to dirty realization. Their functionality is fully covered
The system affects every aspect of the program, so, for example, it's now possible to adjust margins in pixels, but not only in millimetres or inches.

* ##### Status bar panel
The panel shows the next information: mouse position relative to the image, physical size of the image, position of the selected page in current order and the page name and type (`[L]` or `[R]` - left or right page, if the page has been splitted).
The panel shows the next information: zone creation mode icon, mouse position relative to the image, physical size of the image, position of the selected page in current order and the page name and type (`[L]` or `[R]` - left or right page, if the page has been splitted).

This feature is also affected by [measurement units system](#measurement-units-system).

Expand Down Expand Up @@ -381,7 +385,7 @@ has't been moved due to dirty realization. Their functionality is fully covered
Capabilities:
* **`Right-click`** to create/remove guides from the **context menu** called.
* **`Right-click`** on a guide to delete that guide from the **context menu** called.
* **`Shift+LMB`** - drag the guide under the cursor.
* **`Ctrl+Alt+LMB`** - drag the guide under the cursor.
* **`Shift/Ctrl+LMB`** on the content rectangle - drag the page content.
Hold **`Shift`** pressed to restrict moving along the horizontal axis only or **`Ctrl`** for the vertical one.
Hold **`Shift+Ctrl`** for usual dragging.
Expand Down
1 change: 1 addition & 0 deletions config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#define PLUGIN_DIRS "@PLUGIN_DIRS@"

#define PORTABLE_CONFIG_DIR "@PORTABLE_CONFIG_DIR@"
#define ENABLE_DEBUG_FEATURES
#define APPLICATION_NAME "@APPLICATION_NAME@"
#define ORGANIZATION_NAME APPLICATION_NAME

Expand Down
2 changes: 1 addition & 1 deletion src/app/DefaultParamsDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ DefaultParamsDialog::DefaultParamsDialog(QWidget* parent)
Utils::mapSetValue(m_alignmentByButton, alignBottomBtn, Alignment(Alignment::BOTTOM, Alignment::HCENTER));
Utils::mapSetValue(m_alignmentByButton, alignBottomRightBtn, Alignment(Alignment::BOTTOM, Alignment::RIGHT));

m_alignmentButtonGroup = std::make_unique<QButtonGroup>(this);
m_alignmentButtonGroup = new QButtonGroup(this);
for (const auto& buttonAndAlignment : m_alignmentByButton) {
m_alignmentButtonGroup->addButton(buttonAndAlignment.first);
}
Expand Down
5 changes: 3 additions & 2 deletions src/app/DefaultParamsDialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@
#ifndef SCANTAILOR_APP_DEFAULTPARAMSDIALOG_H_
#define SCANTAILOR_APP_DEFAULTPARAMSDIALOG_H_

#include <core/ConnectionManager.h>

#include <QButtonGroup>
#include <QWidget>
#include <list>
#include <set>
#include <unordered_map>
#include <core/ConnectionManager.h>

#include "DefaultParams.h"
#include "DefaultParamsProfileManager.h"
Expand Down Expand Up @@ -146,7 +147,7 @@ class DefaultParamsDialog : public QDialog, private Ui::DefaultParamsDialog {
bool m_topBottomLinkEnabled;
OrthogonalRotation m_orthogonalRotation;
std::unordered_map<QToolButton*, page_layout::Alignment> m_alignmentByButton;
std::unique_ptr<QButtonGroup> m_alignmentButtonGroup;
QButtonGroup* m_alignmentButtonGroup;
DefaultParamsProfileManager m_profileManager;
int m_customDpiItemIdx;
QString m_customDpiValue;
Expand Down
41 changes: 19 additions & 22 deletions src/app/DefaultParamsDialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -393,8 +393,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>193</width>
<height>162</height>
<width>637</width>
<height>442</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_2">
Expand Down Expand Up @@ -470,8 +470,7 @@
<widget class="QToolButton" name="singlePageUncutBtn">
<property name="icon">
<iconset resource="../resources/resources.qrc">
<normaloff>:/icons/single_page_uncut.svg</normaloff>
<normalon>:/icons/single_page_uncut_selected.svg</normalon>:/icons/single_page_uncut.svg</iconset>
<normaloff>:/icons/single_page_uncut.svg</normaloff>:/icons/single_page_uncut.svg</iconset>
</property>
<property name="iconSize">
<size>
Expand All @@ -497,8 +496,7 @@
<widget class="QToolButton" name="pagePlusOffcutBtn">
<property name="icon">
<iconset resource="../resources/resources.qrc">
<normaloff>:/icons/right_page_plus_offcut.svg</normaloff>
<normalon>:/icons/right_page_plus_offcut_selected.svg</normalon>:/icons/right_page_plus_offcut.svg</iconset>
<normaloff>:/icons/right_page_plus_offcut.svg</normaloff>:/icons/right_page_plus_offcut.svg</iconset>
</property>
<property name="iconSize">
<size>
Expand All @@ -521,8 +519,7 @@
<widget class="QToolButton" name="twoPagesBtn">
<property name="icon">
<iconset resource="../resources/resources.qrc">
<normaloff>:/icons/two_pages.svg</normaloff>
<normalon>:/icons/two_pages_selected.svg</normalon>:/icons/two_pages.svg</iconset>
<normaloff>:/icons/two_pages.svg</normaloff>:/icons/two_pages.svg</iconset>
</property>
<property name="iconSize">
<size>
Expand Down Expand Up @@ -1117,8 +1114,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>637</width>
<height>442</height>
<width>406</width>
<height>237</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_10">
Expand Down Expand Up @@ -1208,14 +1205,14 @@
<widget class="QToolButton" name="topBottomLink">
<property name="minimumSize">
<size>
<width>18</width>
<height>46</height>
<width>20</width>
<height>36</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>18</width>
<height>46</height>
<width>20</width>
<height>36</height>
</size>
</property>
<property name="styleSheet">
Expand Down Expand Up @@ -1246,8 +1243,8 @@ QToolButton:pressed {
</property>
<property name="iconSize">
<size>
<width>10</width>
<height>30</height>
<width>18</width>
<height>24</height>
</size>
</property>
</widget>
Expand Down Expand Up @@ -1277,14 +1274,14 @@ QToolButton:pressed {
<widget class="QToolButton" name="leftRightLink">
<property name="minimumSize">
<size>
<width>18</width>
<height>46</height>
<width>20</width>
<height>36</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>18</width>
<height>46</height>
<width>20</width>
<height>36</height>
</size>
</property>
<property name="styleSheet">
Expand Down Expand Up @@ -1315,8 +1312,8 @@ QToolButton:pressed {
</property>
<property name="iconSize">
<size>
<width>10</width>
<height>30</height>
<width>18</width>
<height>24</height>
</size>
</property>
<property name="checked">
Expand Down
7 changes: 4 additions & 3 deletions src/app/FixDpiDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,13 +188,14 @@ class FixDpiDialog::FilterModel : private QSortFilterProxyModel {


FixDpiDialog::FixDpiDialog(const std::vector<ImageFileInfo>& files, QWidget* parent)
: QDialog(parent), m_pages(new TreeModel(files)), m_undefinedDpiPages(new FilterModel(*m_pages)) {
: QDialog(parent),
m_pages(std::make_unique<TreeModel>(files)),
m_undefinedDpiPages(std::make_unique<FilterModel>(*m_pages)) {
setupUi(this);

m_normalPalette = xDpi->palette();
m_errorPalette = m_normalPalette;
const QColor errorTextColor
= ColorSchemeManager::instance().getColorParam(ColorScheme::FixDpiDialogErrorText, QColor(Qt::red));
const QColor errorTextColor = ColorSchemeManager::instance().getColorParam("FixDpiDialogErrorText", QColor(Qt::red));
m_errorPalette.setColor(QPalette::Text, errorTextColor);

dpiCombo->addItem("300 x 300", QSize(300, 300));
Expand Down
Loading