wiRedPanda
Logic Circuit Simulator
Loading...
Searching...
No Matches
DolphinZoom.h
Go to the documentation of this file.
1// Copyright 2015 - 2026, GIBIS-UNIFESP and the wiRedPanda contributors
2// SPDX-License-Identifier: GPL-3.0-or-later
3
7
8#pragma once
9
10class QTableView;
11
23{
24public:
26 explicit DolphinZoom(QTableView *view);
27
29 void zoomIn();
31 void zoomOut();
33 void reset();
36 void fitScreen();
38 void apply() const;
39
41 int zoomLevel() const { return m_zoomLevel; }
43 double fitScale() const { return m_fitScale; }
45 bool canZoomIn() const;
47 bool canZoomOut() const;
48
49private:
50 QTableView *m_view = nullptr;
51 int m_zoomLevel = 0;
52 double m_fitScale = 1.0;
53};
bool canZoomIn() const
True if Zoom In is still possible (below the max level).
void zoomIn()
Increases the discrete column-zoom one step (capped) and re-applies.
double fitScale() const
Current uniform Fit Screen scale.
Definition DolphinZoom.h:43
void fitScreen()
int zoomLevel() const
Current discrete column-zoom level.
Definition DolphinZoom.h:41
void zoomOut()
Decreases the discrete column-zoom one step (floored at the baseline) and re-applies.
bool canZoomOut() const
True if Zoom Out is still possible (above the baseline).
void reset()
Resets both axes to the baseline (level 0, scale 1.0) and re-applies.
DolphinZoom(QTableView *view)
Constructs the zoom controller for view (not owned; must outlive this).
void apply() const
Applies the current zoom to the view's row/column section sizes and font.