diff --git a/data/pref.xml b/data/pref.xml
index 6270be672..9cdb42770 100644
--- a/data/pref.xml
+++ b/data/pref.xml
@@ -234,9 +234,6 @@
-
diff --git a/data/strings/en.ini b/data/strings/en.ini
index 3d6620d9b..97621ce03 100644
--- a/data/strings/en.ini
+++ b/data/strings/en.ini
@@ -867,10 +867,8 @@ bottom = &Bottom
frame_header = Frame Header:
first_frame = First Frame:
thumbnails = Thumbnails
-force = Force
-zoom = Zoom:
-overlay = Overlay
-size = Size:
+thumbnail_size = Thumbnail Size:
+overlay_size = Overlay Size:
onion_skin = Onion Skin:
merge_frames = Merge Frames
red_blue_tint = Red/Blue Tint
diff --git a/data/widgets/timeline_conf.xml b/data/widgets/timeline_conf.xml
index fc09c8bb9..3b9d1e45b 100644
--- a/data/widgets/timeline_conf.xml
+++ b/data/widgets/timeline_conf.xml
@@ -21,16 +21,14 @@
-
+
-
-
-
+
+
-
-
+
diff --git a/src/app/ui/configure_timeline_popup.cpp b/src/app/ui/configure_timeline_popup.cpp
index 84543e340..76c1bba82 100644
--- a/src/app/ui/configure_timeline_popup.cpp
+++ b/src/app/ui/configure_timeline_popup.cpp
@@ -64,14 +64,13 @@ ConfigureTimelinePopup::ConfigureTimelinePopup()
m_box->infront()->Click.connect(base::Bind(&ConfigureTimelinePopup::onPositionChange, this));
m_box->zoom()->Change.connect(base::Bind(&ConfigureTimelinePopup::onZoomChange, this));
- m_box->thumbCheck()->Click.connect(base::Bind(&ConfigureTimelinePopup::onThumbBoxChange, this));
m_box->thumbEnabled()->Click.connect(base::Bind(&ConfigureTimelinePopup::onThumbEnabledChange, this));
m_box->thumbOverlayEnabled()->Click.connect(base::Bind(&ConfigureTimelinePopup::onThumbOverlayEnabledChange, this));
m_box->thumbOverlaySize()->Change.connect(base::Bind(&ConfigureTimelinePopup::onThumbOverlaySizeChange, this));
- bool visibleThumbBox = Preferences::instance().thumbnails.visibleOptions();
- m_box->thumbHSeparator()->setVisible(visibleThumbBox);
- m_box->thumbBox()->setVisible(visibleThumbBox);
+ const bool visibleThumb = docPref().thumbnails.enabled();
+ m_box->thumbHSeparator()->setVisible(visibleThumb);
+ m_box->thumbBox()->setVisible(visibleThumb);
}
app::Document* ConfigureTimelinePopup::doc()
@@ -132,13 +131,12 @@ void ConfigureTimelinePopup::updateWidgetsFromCurrentSettings()
break;
}
- bool visibleThumbBox = Preferences::instance().thumbnails.visibleOptions();
+ const bool visibleThumb = docPref.thumbnails.enabled();
m_box->zoom()->setValue(int(docPref.thumbnails.zoom())); // TODO add a slider for floating points
- m_box->thumbCheck()->setSelected(visibleThumbBox);
- m_box->thumbHSeparator()->setVisible(visibleThumbBox);
- m_box->thumbBox()->setVisible(visibleThumbBox);
- m_box->thumbEnabled()->setSelected(docPref.thumbnails.enabled());
+ m_box->thumbEnabled()->setSelected(visibleThumb);
+ m_box->thumbHSeparator()->setVisible(visibleThumb);
+ m_box->thumbBox()->setVisible(visibleThumb);
m_box->thumbOverlayEnabled()->setSelected(docPref.thumbnails.overlayEnabled());
m_box->thumbOverlaySize()->setValue(docPref.thumbnails.overlaySize());
@@ -242,17 +240,10 @@ void ConfigureTimelinePopup::onZoomChange()
docPref().thumbnails.zoom(m_box->zoom()->getValue());
}
-void ConfigureTimelinePopup::onThumbBoxChange()
-{
- auto& option = Preferences::instance().thumbnails.visibleOptions;
- option(!option());
-
- updateWidgetsFromCurrentSettings();
-}
-
void ConfigureTimelinePopup::onThumbEnabledChange()
{
docPref().thumbnails.enabled(m_box->thumbEnabled()->isSelected());
+ updateWidgetsFromCurrentSettings();
}
void ConfigureTimelinePopup::onThumbOverlayEnabledChange()
diff --git a/src/app/ui/configure_timeline_popup.h b/src/app/ui/configure_timeline_popup.h
index a3fd354f8..b1f804bc9 100644
--- a/src/app/ui/configure_timeline_popup.h
+++ b/src/app/ui/configure_timeline_popup.h
@@ -43,7 +43,6 @@ namespace app {
void onPositionChange();
void onZoomChange();
- void onThumbBoxChange();
void onThumbEnabledChange();
void onThumbOverlayEnabledChange();
void onThumbOverlaySizeChange();
diff --git a/src/app/ui/timeline/timeline.cpp b/src/app/ui/timeline/timeline.cpp
index 193bfadcf..47d4796c4 100644
--- a/src/app/ui/timeline/timeline.cpp
+++ b/src/app/ui/timeline/timeline.cpp
@@ -238,29 +238,35 @@ Timeline::~Timeline()
delete m_confPopup;
}
-void Timeline::setZoom(double zoom)
+void Timeline::setZoom(const double zoom)
{
m_zoom = MID(1.0, zoom, 10.0);
m_thumbnailsOverlayDirection = gfx::Point(int(frameBoxWidth()*1.0), int(frameBoxWidth()*0.5));
m_thumbnailsOverlayVisible = false;
}
-void Timeline::setZoomAndUpdate(double zoom)
+void Timeline::setZoomAndUpdate(const double zoom,
+ const bool updatePref)
{
if (zoom != m_zoom) {
setZoom(zoom);
+ regenerateTagBands();
updateScrollBars();
setViewScroll(viewScroll());
invalidate();
}
- if (zoom != docPref().thumbnails.zoom()) {
+ if (updatePref && zoom != docPref().thumbnails.zoom()) {
docPref().thumbnails.zoom(zoom);
+ docPref().thumbnails.enabled(zoom > 1);
}
}
void Timeline::onThumbnailsPrefChange()
{
- setZoomAndUpdate(docPref().thumbnails.zoom());
+ setZoomAndUpdate(
+ docPref().thumbnails.enabled() ?
+ docPref().thumbnails.zoom(): 1.0,
+ false);
}
void Timeline::updateUsingEditor(Editor* editor)
@@ -304,7 +310,9 @@ void Timeline::updateUsingEditor(Editor* editor)
m_thumbnailsPrefConn = docPref.thumbnails.AfterChange.connect(
base::Bind(&Timeline::onThumbnailsPrefChange, this));
- setZoom(docPref.thumbnails.zoom());
+ setZoom(
+ docPref.thumbnails.enabled() ?
+ docPref.thumbnails.zoom(): 1.0);
// If we are already in the same position as the "editor", we don't
// need to update the at all timeline.
@@ -1217,7 +1225,7 @@ bool Timeline::onProcessMessage(Message* msg)
else if (dz > 1.0) dz = 1.0;
}
- setZoomAndUpdate(m_zoom - dz);
+ setZoomAndUpdate(m_zoom - dz, true);
}
else {
if (!precise) {
@@ -1248,7 +1256,9 @@ bool Timeline::onProcessMessage(Message* msg)
break;
case kTouchMagnifyMessage:
- setZoomAndUpdate(m_zoom + m_zoom * static_cast(msg)->magnification());
+ setZoomAndUpdate(
+ m_zoom + m_zoom * static_cast(msg)->magnification(),
+ true);
break;
}
@@ -1996,7 +2006,7 @@ void Timeline::drawCel(ui::Graphics* g, layer_t layerIndex, frame_t frame, Cel*
drawPart(g, bounds, nullptr, style, is_active, is_hover);
// Draw thumbnail
- if ((docPref().thumbnails.enabled() || m_zoom > 1) && image) {
+ if ((docPref().thumbnails.enabled() && m_zoom > 1) && image) {
gfx::Rect thumb_bounds =
gfx::Rect(bounds).shrink(
skinTheme()->calcBorder(this, style));
@@ -3473,12 +3483,12 @@ int Timeline::headerBoxHeight() const
int Timeline::layerBoxHeight() const
{
- return int(m_zoom*skinTheme()->dimensions.timelineBaseSize() + int(m_zoom > 1) * headerBoxHeight());
+ return int(zoom()*skinTheme()->dimensions.timelineBaseSize());
}
int Timeline::frameBoxWidth() const
{
- return int(m_zoom*skinTheme()->dimensions.timelineBaseSize());
+ return int(zoom()*skinTheme()->dimensions.timelineBaseSize());
}
int Timeline::outlineWidth() const
@@ -3494,6 +3504,14 @@ int Timeline::oneTagHeight() const
skinTheme()->dimensions.timelineTagsAreaHeight();
}
+double Timeline::zoom() const
+{
+ if (docPref().thumbnails.enabled())
+ return m_zoom;
+ else
+ return 1.0;
+}
+
// Returns the last frame where the frame tag (or frame tag label)
// is visible in the timeline.
int Timeline::calcTagVisibleToFrame(FrameTag* frameTag) const
diff --git a/src/app/ui/timeline/timeline.h b/src/app/ui/timeline/timeline.h
index 746684cd1..9069871b4 100644
--- a/src/app/ui/timeline/timeline.h
+++ b/src/app/ui/timeline/timeline.h
@@ -311,8 +311,11 @@ namespace app {
void updateCelOverlayBounds(const Hit& hit);
void drawCelOverlay(ui::Graphics* g);
void onThumbnailsPrefChange();
- void setZoom(double zoom);
- void setZoomAndUpdate(double zoom);
+ void setZoom(const double zoom);
+ void setZoomAndUpdate(const double zoom,
+ const bool updatePref);
+
+ double zoom() const;
ui::ScrollBar m_hbar;
ui::ScrollBar m_vbar;