| 1174 | } |
| 1175 | |
| 1176 | void WorksheetView::changeZoom(QAction* action) { |
| 1177 | zoomFitNoneAction->setChecked(true); |
| 1178 | m_worksheet->setZoomFit(Worksheet::ZoomFit::None); |
| 1179 | if (action == zoomInViewAction) |
| 1180 | zoom(1); |
| 1181 | else if (action == zoomOutViewAction) |
| 1182 | zoom(-1); |
| 1183 | else if (action == zoomOriginAction) { |
| 1184 | static const float hscale = GuiTools::dpi(this).first / (Worksheet::convertToSceneUnits(1, Worksheet::Unit::Inch)); |
| 1185 | static const float vscale = GuiTools::dpi(this).second / (Worksheet::convertToSceneUnits(1, Worksheet::Unit::Inch)); |
| 1186 | setTransform(QTransform::fromScale(hscale, vscale)); |
| 1187 | } |
| 1188 | |
| 1189 | currentZoomAction = action; |
| 1190 | if (tbZoom) |
| 1191 | tbZoom->setDefaultAction(action); |
| 1192 | |
| 1193 | updateLabelsZoom(); |
| 1194 | } |
| 1195 | |
| 1196 | void WorksheetView::updateFit() { |
| 1197 | switch (m_worksheet->zoomFit()) { |
nothing calls this directly
no test coverage detected