Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions resources/forms/preferences.ui
Original file line number Diff line number Diff line change
Expand Up @@ -948,6 +948,13 @@
</property>
</widget>
</item>
<item row="1" column="0" colspan="2">
<widget class="QCheckBox" name="autoSwitchToEraserCheckBox">
<property name="text">
<string>Ignore broken eraser detection for tablets</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="markerTab">
Expand Down
7 changes: 5 additions & 2 deletions src/board/UBBoardView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -350,13 +350,16 @@ void UBBoardView::tabletEvent (QTabletEvent * event)
UBStylusTool::Enum currentTool = (UBStylusTool::Enum)dc->stylusTool ();

if (event->type () == QEvent::TabletPress || event->type () == QEvent::TabletEnterProximity) {
const bool ignoreBrokenEraser = UBSettings::settings()->boardIgnoreBrokenEraserDetection->get().toBool();
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
if (event->pointerType () == QPointingDevice::PointerType::Eraser) {
#else
if (event->pointerType () == QTabletEvent::Eraser) {
#endif
dc->setStylusTool (UBStylusTool::Eraser);
mUsingTabletEraser = true;
if (!ignoreBrokenEraser) {
dc->setStylusTool (UBStylusTool::Eraser);
mUsingTabletEraser = true;
}
}
else {
if (mUsingTabletEraser && currentTool == UBStylusTool::Eraser)
Expand Down
3 changes: 3 additions & 0 deletions src/core/UBPreferencesController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,8 @@ void UBPreferencesController::wire()
connect(mPenProperties->circleCheckBox, SIGNAL(clicked(bool)), settings, SLOT(setPenPreviewCircle(bool)));
connect(mPenProperties->circleSpinBox, SIGNAL(valueChanged(int)), this, SLOT(penPreviewFromSizeChanged(int)));

connect(mPreferencesUI->autoSwitchToEraserCheckBox, SIGNAL(clicked(bool)), settings->boardIgnoreBrokenEraserDetection, SLOT(setBool(bool)));

// marker
QList<QColor> markerLightBackgroundColors = settings->boardMarkerLightBackgroundColors->colors();
QList<QColor> markerDarkBackgroundColors = settings->boardMarkerDarkBackgroundColors->colors();
Expand Down Expand Up @@ -342,6 +344,7 @@ void UBPreferencesController::init()
mPenProperties->pressureSensitiveCheckBox->setChecked(settings->boardPenPressureSensitive->get().toBool());
mPenProperties->circleCheckBox->setChecked(settings->showPenPreviewCircle->get().toBool());
mPenProperties->circleSpinBox->setValue(settings->penPreviewFromSize->get().toInt());
mPreferencesUI->autoSwitchToEraserCheckBox->setChecked(settings->boardIgnoreBrokenEraserDetection->get().toBool());

// marker tab
mMarkerProperties->fineSlider->setValue(settings->boardMarkerFineWidth->get().toDouble() * sSliderRatio);
Expand Down
1 change: 1 addition & 0 deletions src/core/UBSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ void UBSettings::init()
boardMarkerPressureSensitive = new UBSetting(this, "Board", "MarkerPressureSensitive", false);

boardUseHighResTabletEvent = new UBSetting(this, "Board", "UseHighResTabletEvent", true);
boardIgnoreBrokenEraserDetection = new UBSetting(this, "Board", "IgnoreBrokenEraserDetection", false);

boardInterpolatePenStrokes = new UBSetting(this, "Board", "InterpolatePenStrokes", true);
boardSimplifyPenStrokes = new UBSetting(this, "Board", "SimplifyPenStrokes", true);
Expand Down
1 change: 1 addition & 0 deletions src/core/UBSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ class UBSettings : public QObject
UBSetting* boardMarkerPressureSensitive;

UBSetting* boardUseHighResTabletEvent;
UBSetting* boardIgnoreBrokenEraserDetection;

UBSetting* boardInterpolatePenStrokes;
UBSetting* boardSimplifyPenStrokes;
Expand Down