git-svn-id: svn://db.shs.com.ru/libs@304 a8b55f48-bf90-11e4-a774-851b48703e85
This commit is contained in:
@@ -42,6 +42,7 @@ void BlockView::_init() {
|
||||
cur_scl = thumb_scl = 1.;
|
||||
_talpha = 0.;
|
||||
ae_enabled = is_nav_anim = true;
|
||||
nav_prev_aa = nav_prev_grid = true;
|
||||
thumb_size = QSizeF(200, 200);
|
||||
if (scene() == 0) {
|
||||
scene_ = new QGraphicsScene;
|
||||
@@ -66,6 +67,7 @@ void BlockView::_init() {
|
||||
nav_anim.setPropertyName("_nav");
|
||||
nav_anim.setEasingCurve(QEasingCurve::InQuad);
|
||||
nav_anim.setDuration(200);
|
||||
connect(&nav_anim, SIGNAL(finished()), this, SLOT(_navFinished()));
|
||||
connect(scene_, SIGNAL(sceneRectChanged(QRectF)), this, SLOT(adjustThumb()));
|
||||
connect(scene_, SIGNAL(selectionChanged()), this, SLOT(sceneSelectionChanged()));
|
||||
centerOn(scene_->sceneRect().center());
|
||||
@@ -1397,6 +1399,12 @@ QRectF BlockView::_nav() const {
|
||||
void BlockView::animateNav(QRectF d) {
|
||||
nav_target = d;
|
||||
if (is_nav_anim) {
|
||||
if (nav_anim.state() != QAbstractAnimation::Running) {
|
||||
nav_prev_aa = renderHints().testFlag(QPainter::Antialiasing);
|
||||
nav_prev_grid = isGridVisible();
|
||||
setRenderHint(QPainter::Antialiasing, false);
|
||||
setGridVisible(false);
|
||||
}
|
||||
nav_anim.stop();
|
||||
nav_anim.setStartValue(_nav());
|
||||
nav_anim.setEndValue(d);
|
||||
@@ -1532,7 +1540,7 @@ void BlockView::sceneSelectionChanged() {
|
||||
|
||||
void BlockView::_setThumb(double v) {
|
||||
_talpha = v;
|
||||
QMetaObject::invokeMethod(&widget_thumb, "repaint", Qt::QueuedConnection);
|
||||
QMetaObject::invokeMethod(&widget_thumb, "update", Qt::QueuedConnection);
|
||||
if (_talpha <= 0.01) widget_thumb.hide();
|
||||
else widget_thumb.show();
|
||||
}
|
||||
@@ -1543,6 +1551,12 @@ void BlockView::_setNav(QRectF v) {
|
||||
}
|
||||
|
||||
|
||||
void BlockView::_navFinished() {
|
||||
setRenderHint(QPainter::Antialiasing, nav_prev_aa);
|
||||
setGridVisible(nav_prev_grid);
|
||||
}
|
||||
|
||||
|
||||
void BlockView::reconnectAll() {
|
||||
//qDebug() << "reconnect";
|
||||
removeJunk();
|
||||
|
||||
@@ -154,6 +154,7 @@ protected:
|
||||
int timer_thumb, thumb_hide_delay, thick;
|
||||
bool mm_drag, new_bus, new_branch, moved, mm_cancel, iconnect, mm_copy, mm_thumb, ae_enabled, is_nav_anim;
|
||||
bool grid_visible, grid_snap, pm_connect, navigation, m_connect, m_trace_with_buses, m_pin_mc, minimap;
|
||||
bool nav_prev_aa, nav_prev_grid;
|
||||
double grid_step, grid_points, cur_scl, _talpha, thumb_scl;
|
||||
|
||||
protected slots:
|
||||
@@ -169,6 +170,7 @@ protected slots:
|
||||
void sceneSelectionChanged();
|
||||
void _setThumb(double v);
|
||||
void _setNav(QRectF v);
|
||||
void _navFinished();
|
||||
|
||||
public slots:
|
||||
void setGridPen(const QPen & pen) {grid_pen = pen; _updateBack();}
|
||||
|
||||
Reference in New Issue
Block a user