saving timeline zoom pref onProcessMessage

This commit is contained in:
Carlo "zED" Caputo 2016-10-08 23:03:48 -03:00
parent ab23254cf8
commit f0093a2d57
2 changed files with 9 additions and 2 deletions

View File

@ -185,6 +185,12 @@ void Timeline::setZoom(double zoom)
m_zoom = MID(1.0, zoom, 10.0);
}
void Timeline::setZoomAndSavePref(double zoom)
{
setZoom(zoom);
docPref().thumbnails.zoom(zoom);
}
void Timeline::onThumbnailsPrefChange()
{
setZoom(docPref().thumbnails.zoom());
@ -1065,7 +1071,7 @@ bool Timeline::onProcessMessage(Message* msg)
if (msg->altPressed()) {
double next_zoom = m_zoom + (dz < 0 ? -1 : 1);
setZoom(next_zoom);
setZoomAndSavePref(next_zoom);
invalidate();
}
else {
@ -1092,7 +1098,7 @@ bool Timeline::onProcessMessage(Message* msg)
break;
case kTouchMagnifyMessage:
setZoom(m_zoom + m_zoom * static_cast<ui::TouchMessage*>(msg)->magnification());
setZoomAndSavePref(m_zoom + m_zoom * static_cast<ui::TouchMessage*>(msg)->magnification());
invalidate();
break;
}

View File

@ -311,6 +311,7 @@ namespace app {
void drawCelOverlay(ui::Graphics* g);
void onThumbnailsPrefChange();
void setZoom(double zoom);
void setZoomAndSavePref(double zoom);
ui::ScrollBar m_hbar;
ui::ScrollBar m_vbar;