gui: Add checkboxes for alpha/opaque in surfaces view.
- pass alpha/opaque settings through to image viewer
- removed caching of thumbnails in ApiSurface instances
- updating thumbnails (due to changed alpha/opaque settings) did not
mesh with constness
- ApiSurfaces should be unaware of thumbnails -> caching should happen
e.g. in SurfacesView
Fixes #374.
diff --git a/gui/imageviewer.cpp b/gui/imageviewer.cpp
index 6953c00..560b477 100644
--- a/gui/imageviewer.cpp
+++ b/gui/imageviewer.cpp
@@ -10,11 +10,13 @@
#include <QPixmap>
#include <QScrollBar>
-ImageViewer::ImageViewer(QWidget *parent)
+ImageViewer::ImageViewer(QWidget *parent, bool opaque, bool alpha)
: QDialog(parent),
m_image(0)
{
setupUi(this);
+ opaqueCheckBox->setChecked(opaque);
+ alphaCheckBox->setChecked(alpha);
connect(lowerSpinBox, SIGNAL(valueChanged(double)),
SLOT(slotUpdate()));
@@ -65,9 +67,7 @@
{
delete m_image;
m_image = ApiSurface::imageFromData(data);
- m_convertedImage = ApiSurface::qimageFromRawImage(m_image);
- m_pixelWidget->setSurface(m_convertedImage);
- updateGeometry();
+ slotUpdate();
}
void ImageViewer::slotUpdate()