WIP: multi selection property dialog

This commit is contained in:
Matthias Koefferlein
2022-10-08 00:37:39 +02:00
parent 43c7e87cc0
commit 187aae2649
9 changed files with 278 additions and 86 deletions
+10 -14
View File
@@ -198,20 +198,6 @@ LayoutCanvas::~LayoutCanvas ()
clear_fg_bitmaps ();
}
#if defined(HAVE_QT) && QT_VERSION >= 0x050000
double
LayoutCanvas::dpr () const
{
return widget () ? widget ()->devicePixelRatio () : 1.0;
}
#else
double
LayoutCanvas::dpr () const
{
return 1.0;
}
#endif
double
LayoutCanvas::resolution () const
{
@@ -297,6 +283,16 @@ LayoutCanvas::set_highres_mode (bool hrm)
}
}
double
LayoutCanvas::dpr () const
{
#if defined(HAVE_QT) && QT_VERSION >= 0x50000
return widget () ? widget ()->devicePixelRatio () : 1.0;
#else
return 1.0;
#endif
}
void
LayoutCanvas::set_colors (tl::Color background, tl::Color foreground, tl::Color active)
{
+5 -1
View File
@@ -277,6 +277,11 @@ public:
return m_hrm;
}
/**
* @brief Gets the default device pixel ratio for this canvas
*/
double dpr () const;
/**
* @brief Sets the depth of the image cache
*/
@@ -439,7 +444,6 @@ private:
void do_redraw_all (bool force_redraw = true);
void prepare_drawing ();
double dpr () const;
virtual double resolution () const;
const std::vector<ViewOp> &scaled_view_ops (unsigned int lw);
@@ -1548,6 +1548,10 @@ single_bitmap_to_image (const lay::ViewOp &view_op, lay::Bitmap &bitmap,
tl::PixelBuffer
LayoutViewBase::icon_for_layer (const LayerPropertiesConstIterator &iter, unsigned int w, unsigned int h, double dpr, unsigned int di_off, bool no_state)
{
if (dpr < 0.0) {
dpr = canvas ()->dpr ();
}
int oversampling = canvas () ? canvas ()->oversampling () : 1;
double gamma = 2.0;
+2 -2
View File
@@ -587,11 +587,11 @@ public:
* @param iter indicates the layer
* @param w The width in logical pixels of the generated pixmap (will be multiplied by dpr)
* @param h The height in logical pixels of the generated pixmap (will be multiplied by dpr)
* @param dpr The device pixel ratio (number of image pixes per logical pixel)
* @param dpr The device pixel ratio (number of image pixes per logical pixel) - negative values mean auto-detect
* @param di_off The dither pattern offset (used for animation)
* @param no_state If true, the state will not be indicated
*/
tl::PixelBuffer icon_for_layer (const lay::LayerPropertiesConstIterator &iter, unsigned int w, unsigned int h, double dpr, unsigned int di_off, bool no_state);
tl::PixelBuffer icon_for_layer (const lay::LayerPropertiesConstIterator &iter, unsigned int w, unsigned int h, double dpr = -1.0, unsigned int di_off = 0, bool no_state = false);
/**
* @brief Sets the layers that are selected in the layer browser
+17
View File
@@ -29,6 +29,7 @@
#include "layEditable.h"
#include <QFrame>
#include <QIcon>
namespace db
{
@@ -97,11 +98,27 @@ public:
*/
virtual std::string description (size_t entry) const = 0;
/**
* @brief Gets the icon for the nth entry
*/
virtual QIcon icon (size_t /*entry*/, int /*w*/, int /*h*/) const
{
return QIcon ();
}
/**
* @brief Gets a description text for the whole group
*/
virtual std::string description () const = 0;
/**
* @brief Gets the icon associated with the whole group
*/
virtual QIcon icon (int /*w*/, int /*h*/) const
{
return QIcon ();
}
/**
* @brief Update the display
*