| 1100 | // ============================================================================ |
| 1101 | |
| 1102 | void ControlPanelDialog::createToolsTab() |
| 1103 | { |
| 1104 | toolsTab = new QWidget(this); |
| 1105 | QVBoxLayout *layout = new QVBoxLayout(toolsTab); |
| 1106 | |
| 1107 | QSettings settings("SpeedyNote", "App"); |
| 1108 | |
| 1109 | // The old global "Minimum stroke width" row has moved to the Pen |
| 1110 | // thickness-preset editor (each preset owns its own min width now). |
| 1111 | |
| 1112 | // --- Panning settings group --- |
| 1113 | QGroupBox *panGroup = new QGroupBox(tr("Panning"), toolsTab); |
| 1114 | QFormLayout *panLayout = new QFormLayout(panGroup); |
| 1115 | |
| 1116 | wheelScrollSpeedSpin = new QDoubleSpinBox(panGroup); |
| 1117 | wheelScrollSpeedSpin->setRange(5.0, 200.0); |
| 1118 | wheelScrollSpeedSpin->setSingleStep(5.0); |
| 1119 | wheelScrollSpeedSpin->setDecimals(1); |
| 1120 | wheelScrollSpeedSpin->setSuffix(tr(" px")); |
| 1121 | wheelScrollSpeedSpin->setValue(settings.value("tools/wheelScrollSpeed", 40.0).toDouble()); |
| 1122 | |
| 1123 | panLayout->addRow(tr("Mouse wheel scroll speed:"), wheelScrollSpeedSpin); |
| 1124 | |
| 1125 | QLabel *panHint = new QLabel( |
| 1126 | tr("Distance the viewport moves per mouse wheel click, in document units. " |
| 1127 | "Applies to vertical panning (wheel / `+wheel) and horizontal panning (Shift+wheel). " |
| 1128 | "Does not affect touchpad scrolling."), |
| 1129 | panGroup); |
| 1130 | panHint->setWordWrap(true); |
| 1131 | panHint->setStyleSheet("color: gray; font-size: 11px;"); |
| 1132 | panLayout->addRow(panHint); |
| 1133 | |
| 1134 | layout->addWidget(panGroup); |
| 1135 | |
| 1136 | // --- OCR settings group --- |
| 1137 | QGroupBox *ocrGroup = new QGroupBox(tr("OCR (Handwriting Recognition)"), toolsTab); |
| 1138 | QVBoxLayout *ocrLayout = new QVBoxLayout(ocrGroup); |
| 1139 | |
| 1140 | ocrCjkGridModeCheck = new QCheckBox(tr("CJK grid-cell mode (box-by-box character detection)"), ocrGroup); |
| 1141 | ocrCjkGridModeCheck->setChecked(settings.value("ocrCjkGridMode", false).toBool()); |
| 1142 | ocrLayout->addWidget(ocrCjkGridModeCheck); |
| 1143 | |
| 1144 | QLabel *ocrHint = new QLabel( |
| 1145 | tr("When \"Snap OCR to Grid/Lines\" is enabled on the OCR toolbar and the " |
| 1146 | "background is a grid, this option makes each grid cell detect one CJK " |
| 1147 | "character. Adjacent characters are merged into sentences. " |
| 1148 | "Leave unchecked for line-based detection (suitable for most languages)."), |
| 1149 | ocrGroup); |
| 1150 | ocrHint->setWordWrap(true); |
| 1151 | ocrHint->setStyleSheet("color: gray; font-size: 11px;"); |
| 1152 | ocrLayout->addWidget(ocrHint); |
| 1153 | |
| 1154 | layout->addWidget(ocrGroup); |
| 1155 | layout->addStretch(); |
| 1156 | |
| 1157 | tabWidget->addTab(toolsTab, tr("Tools")); |
| 1158 | } |
| 1159 |
nothing calls this directly
no test coverage detected