Skip to content

Commit 142b2b4

Browse files
Address review: rename setting and flip default for eraser workaround
Rename boardAutoSwitchToEraser -> boardIgnoreBrokenEraserDetection to make it clear this is a workaround for broken eraser detection, not a general preference. Default is now false (opt-in). Update the checkbox label to "Ignore broken eraser detection for tablets". Signed-off-by: ElmotiemSofian <sofianelmotiem@gmail.com>
1 parent b7d222e commit 142b2b4

5 files changed

Lines changed: 7 additions & 7 deletions

File tree

resources/forms/preferences.ui

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -951,7 +951,7 @@
951951
<item row="1" column="0" colspan="2">
952952
<widget class="QCheckBox" name="autoSwitchToEraserCheckBox">
953953
<property name="text">
954-
<string>Automatically switch to eraser when tablet eraser is detected</string>
954+
<string>Ignore broken eraser detection for tablets</string>
955955
</property>
956956
</widget>
957957
</item>

src/board/UBBoardView.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -350,13 +350,13 @@ void UBBoardView::tabletEvent (QTabletEvent * event)
350350
UBStylusTool::Enum currentTool = (UBStylusTool::Enum)dc->stylusTool ();
351351

352352
if (event->type () == QEvent::TabletPress || event->type () == QEvent::TabletEnterProximity) {
353-
const bool autoSwitch = UBSettings::settings()->boardAutoSwitchToEraser->get().toBool();
353+
const bool ignoreBrokenEraser = UBSettings::settings()->boardIgnoreBrokenEraserDetection->get().toBool();
354354
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
355355
if (event->pointerType () == QPointingDevice::PointerType::Eraser) {
356356
#else
357357
if (event->pointerType () == QTabletEvent::Eraser) {
358358
#endif
359-
if (autoSwitch) {
359+
if (!ignoreBrokenEraser) {
360360
dc->setStylusTool (UBStylusTool::Eraser);
361361
mUsingTabletEraser = true;
362362
}

src/core/UBPreferencesController.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ void UBPreferencesController::wire()
271271
connect(mPenProperties->circleCheckBox, SIGNAL(clicked(bool)), settings, SLOT(setPenPreviewCircle(bool)));
272272
connect(mPenProperties->circleSpinBox, SIGNAL(valueChanged(int)), this, SLOT(penPreviewFromSizeChanged(int)));
273273

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

276276
// marker
277277
QList<QColor> markerLightBackgroundColors = settings->boardMarkerLightBackgroundColors->colors();
@@ -344,7 +344,7 @@ void UBPreferencesController::init()
344344
mPenProperties->pressureSensitiveCheckBox->setChecked(settings->boardPenPressureSensitive->get().toBool());
345345
mPenProperties->circleCheckBox->setChecked(settings->showPenPreviewCircle->get().toBool());
346346
mPenProperties->circleSpinBox->setValue(settings->penPreviewFromSize->get().toInt());
347-
mPreferencesUI->autoSwitchToEraserCheckBox->setChecked(settings->boardAutoSwitchToEraser->get().toBool());
347+
mPreferencesUI->autoSwitchToEraserCheckBox->setChecked(settings->boardIgnoreBrokenEraserDetection->get().toBool());
348348

349349
// marker tab
350350
mMarkerProperties->fineSlider->setValue(settings->boardMarkerFineWidth->get().toDouble() * sSliderRatio);

src/core/UBSettings.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ void UBSettings::init()
285285
boardMarkerPressureSensitive = new UBSetting(this, "Board", "MarkerPressureSensitive", false);
286286

287287
boardUseHighResTabletEvent = new UBSetting(this, "Board", "UseHighResTabletEvent", true);
288-
boardAutoSwitchToEraser = new UBSetting(this, "Board", "AutoSwitchToEraser", true);
288+
boardIgnoreBrokenEraserDetection = new UBSetting(this, "Board", "IgnoreBrokenEraserDetection", false);
289289

290290
boardInterpolatePenStrokes = new UBSetting(this, "Board", "InterpolatePenStrokes", true);
291291
boardSimplifyPenStrokes = new UBSetting(this, "Board", "SimplifyPenStrokes", true);

src/core/UBSettings.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ class UBSettings : public QObject
287287
UBSetting* boardMarkerPressureSensitive;
288288

289289
UBSetting* boardUseHighResTabletEvent;
290-
UBSetting* boardAutoSwitchToEraser;
290+
UBSetting* boardIgnoreBrokenEraserDetection;
291291

292292
UBSetting* boardInterpolatePenStrokes;
293293
UBSetting* boardSimplifyPenStrokes;

0 commit comments

Comments
 (0)