diff --git a/data/pref.xml b/data/pref.xml
index b7b269072..5ef71b5d5 100644
--- a/data/pref.xml
+++ b/data/pref.xml
@@ -261,7 +261,6 @@
-
diff --git a/data/widgets/timeline_conf.xml b/data/widgets/timeline_conf.xml
index 9c5e28a49..0c70b5a67 100644
--- a/data/widgets/timeline_conf.xml
+++ b/data/widgets/timeline_conf.xml
@@ -11,10 +11,6 @@
-
-
-
-
diff --git a/src/app/thumbnails.cpp b/src/app/thumbnails.cpp
index a357f5093..c461a9171 100644
--- a/src/app/thumbnails.cpp
+++ b/src/app/thumbnails.cpp
@@ -33,7 +33,8 @@ namespace app {
DocumentPreferences& docPref = Preferences::instance().document(document);
int opacity = docPref.thumbnails.opacity();
- gfx::Color background = color_utils::color_for_ui(docPref.thumbnails.background());
+ doc::color_t bg1 = color_utils::color_for_image(docPref.bg.color1(), image->pixelFormat());
+ doc::color_t bg2 = color_utils::color_for_image(docPref.bg.color2(), image->pixelFormat());
gfx::Size image_size = image->size();
@@ -51,10 +52,32 @@ namespace app {
}
const doc::Sprite* sprite = document->sprite();
+ // TODO doc::Image::createCopy() from pre-rendered checkered background
base::UniquePtr thumb_img(doc::Image::create(
image->pixelFormat(), thumb_size.w, thumb_size.h));
- clear_image(thumb_img.get(), background);
+ double alpha = opacity / 255.0;
+ uint8_t bg_r[] = { rgba_getr(bg1), rgba_getr(bg2) };
+ uint8_t bg_g[] = { rgba_getg(bg1), rgba_getg(bg2) };
+ uint8_t bg_b[] = { rgba_getb(bg1), rgba_getb(bg2) };
+ uint8_t bg_a[] = { rgba_geta(bg1), rgba_geta(bg2) };
+
+ doc::color_t bg[] = {
+ rgba(bg_r[0], bg_g[0], bg_b[0], (int)(bg_a[0] * alpha)),
+ rgba(bg_r[1], bg_g[1], bg_b[1], (int)(bg_a[1] * alpha))
+ };
+
+ int block_size = MID(4, thumb_size.w/8, 16);
+ for (int dst_y = 0; dst_y < thumb_size.h; dst_y++) {
+ for (int dst_x = 0; dst_x < thumb_size.w; dst_x++) {
+ thumb_img->putPixel(dst_x, dst_y,
+ bg[
+ ((dst_x / block_size) % 2) ^
+ ((dst_y / block_size) % 2)
+ ]
+ );
+ }
+ }
base::UniquePtr scale_img;
const doc::Image* source = image;
diff --git a/src/app/ui/configure_timeline_popup.cpp b/src/app/ui/configure_timeline_popup.cpp
index f4f0d56ee..7e65d6175 100644
--- a/src/app/ui/configure_timeline_popup.cpp
+++ b/src/app/ui/configure_timeline_popup.cpp
@@ -63,7 +63,6 @@ ConfigureTimelinePopup::ConfigureTimelinePopup()
m_box->infront()->Click.connect(base::Bind(&ConfigureTimelinePopup::onPositionChange, this));
m_box->thumbOpacity()->Change.connect(base::Bind(&ConfigureTimelinePopup::onThumbOpacityChange, this));
- m_box->thumbBackground()->Change.connect(&ConfigureTimelinePopup::onThumbBackgroundChange, 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));
@@ -116,7 +115,6 @@ void ConfigureTimelinePopup::updateWidgetsFromCurrentSettings()
}
m_box->thumbOpacity()->setValue(docPref.thumbnails.opacity());
- m_box->thumbBackground()->setColor(docPref.thumbnails.background());
m_box->thumbEnabled()->setSelected(docPref.thumbnails.enabled());
m_box->thumbOverlayEnabled()->setSelected(docPref.thumbnails.overlayEnabled());
m_box->thumbOverlaySize()->setValue(docPref.thumbnails.overlaySize());
@@ -196,11 +194,6 @@ void ConfigureTimelinePopup::onThumbOpacityChange()
docPref().thumbnails.opacity(m_box->thumbOpacity()->getValue());
}
-void ConfigureTimelinePopup::onThumbBackgroundChange(const app::Color& color)
-{
- docPref().thumbnails.background(color);
-}
-
void ConfigureTimelinePopup::onThumbEnabledChange()
{
docPref().thumbnails.enabled(m_box->thumbEnabled()->isSelected());
diff --git a/src/app/ui/configure_timeline_popup.h b/src/app/ui/configure_timeline_popup.h
index acd75f495..74789213d 100644
--- a/src/app/ui/configure_timeline_popup.h
+++ b/src/app/ui/configure_timeline_popup.h
@@ -42,7 +42,6 @@ namespace app {
void onPositionChange();
void onThumbOpacityChange();
- void onThumbBackgroundChange(const app::Color& color);
void onThumbEnabledChange();
void onThumbOverlayEnabledChange();
void onThumbOverlaySizeChange();
diff --git a/src/app/ui/timeline.cpp b/src/app/ui/timeline.cpp
index c201aa6c4..6c38d754e 100644
--- a/src/app/ui/timeline.cpp
+++ b/src/app/ui/timeline.cpp
@@ -1638,11 +1638,9 @@ void Timeline::drawCelOverlay(ui::Graphics* g)
she::Surface* overlay_surf = thumb::get_cel_thumbnail(cel, overlay_size, cel_image_on_overlay);
- gfx::Color background = color_utils::color_for_ui(docPref().thumbnails.background());
- gfx::Color border = color_utils::blackandwhite_neg(background);
g->drawRgbaSurface(overlay_surf,
m_thumbnailsOverlayInner.x, m_thumbnailsOverlayInner.y);
- g->drawRect(border, m_thumbnailsOverlayOuter);
+ g->drawRect(gfx::rgba(0,0,0,255), m_thumbnailsOverlayOuter);
overlay_surf->dispose();
}