Commit d325e7da authored by Gilles Caulier's avatar Gilles Caulier 🗼
Browse files

backport commit #3b82901e from git/master to frameworks branch

CCBUGS: 261568
parent 62b7ecb1
......@@ -41,7 +41,7 @@
namespace Digikam
{
void DigikamImageDelegatePrivate::init(DigikamImageDelegate* q, ImageCategorizedView* parent)
void DigikamImageDelegatePrivate::init(DigikamImageDelegate* const q, ImageCategorizedView* const parent)
{
categoryDrawer = new ImageCategoryDrawer(parent);
......@@ -78,18 +78,17 @@ void DigikamImageDelegate::updateRects()
{
Q_D(DigikamImageDelegate);
int y = d->margin;
d->pixmapRect = QRect(d->margin, y, d->contentWidth, d->contentWidth);
y = d->pixmapRect.bottom();
d->imageInformationRect = QRect(d->margin, y, d->contentWidth, 0);
const ApplicationSettings* albumSettings = ApplicationSettings::instance();
d->drawImageFormat = albumSettings->getIconShowImageFormat();
d->drawCoordinates = ApplicationSettings::instance()->getIconShowCoordinates();
const int iconSize = 22;
d->pickLabelRect = QRect(d->margin, y, iconSize, iconSize);
d->groupRect = QRect(d->contentWidth - iconSize, y, iconSize, iconSize);
d->coordinatesRect = QRect(d->contentWidth - 16+2, d->pixmapRect.top(), 16, 16);
int y = d->margin;
d->pixmapRect = QRect(d->margin, y, d->contentWidth, d->contentWidth);
y = d->pixmapRect.bottom();
d->imageInformationRect = QRect(d->margin, y, d->contentWidth, 0);
const ApplicationSettings* const albumSettings = ApplicationSettings::instance();
d->drawImageFormat = albumSettings->getIconShowImageFormat();
d->drawCoordinates = ApplicationSettings::instance()->getIconShowCoordinates();
const int iconSize = qBound(16, (d->contentWidth + 2*d->margin) / 8 - 2, 48);
d->pickLabelRect = QRect(d->margin, y, iconSize, iconSize);
d->groupRect = QRect(d->contentWidth - iconSize, y, iconSize, iconSize);
d->coordinatesRect = QRect(d->contentWidth - iconSize+2, d->pixmapRect.top(), iconSize, iconSize);
if (albumSettings->getIconShowRating())
{
......
......@@ -47,7 +47,7 @@ public:
}
virtual ~DigikamImageDelegatePrivate();
void init(DigikamImageDelegate* q, ImageCategorizedView* parent);
void init(DigikamImageDelegate* const q, ImageCategorizedView* const parent);
};
// -----------------------------------------------------------------------------------------
......
......@@ -115,8 +115,10 @@ void ImageThumbnailDelegate::updateRects()
Q_D(ImageThumbnailDelegate);
d->coordinatesRect = QRect(d->contentWidth - 16+2, d->pixmapRect.top(), 16, 16);
d->pixmapRect = QRect(d->margin, d->margin, d->contentWidth, d->contentWidth);
d->rect = QRect(0, 0, d->contentWidth + 2*d->margin, d->contentWidth + 2*d->margin);
d->pixmapRect = QRect(d->margin, d->margin, d->contentWidth, d->contentWidth);
const int iconSize = qBound(16, (d->contentWidth + 2*d->margin) / 8 - 2, 48);
d->coordinatesRect = QRect(d->contentWidth - iconSize+2, d->pixmapRect.top(), iconSize, iconSize);
d->drawImageFormat = ApplicationSettings::instance()->getIconShowImageFormat();
d->drawCoordinates = ApplicationSettings::instance()->getIconShowCoordinates();
......
......@@ -92,13 +92,15 @@ void ItemViewImageDelegatePrivate::makeStarPolygon()
}
ItemViewImageDelegate::ItemViewImageDelegate(QObject* const parent)
: DItemDelegate(parent), d_ptr(new ItemViewImageDelegatePrivate)
: DItemDelegate(parent),
d_ptr(new ItemViewImageDelegatePrivate)
{
d_ptr->init(this);
}
ItemViewImageDelegate::ItemViewImageDelegate(ItemViewImageDelegatePrivate& dd, QObject* const parent)
: DItemDelegate(parent), d_ptr(&dd)
: DItemDelegate(parent),
d_ptr(&dd)
{
d_ptr->init(this);
}
......@@ -489,7 +491,7 @@ void ItemViewImageDelegate::drawPanelSideIcon(QPainter* p, bool left, bool right
{
Q_D(const ItemViewImageDelegate);
int iconSize = 16;
const int iconSize = qBound(16, d->rect.width() / 8 - 2, 48);
if (left)
{
......
......@@ -672,7 +672,7 @@ void ImportThumbnailDelegate::updateRects()
d->drawImageFormat = ImportSettings::instance()->getIconShowImageFormat();
d->drawCoordinates = ImportSettings::instance()->getIconShowCoordinates();
const int iconSize = 16;
const int iconSize = qBound(16, (d->contentWidth + 2*d->margin) / 8 - 2, 48);
int pos = iconSize + 2;
d->downloadRect = QRect(d->contentWidth - pos, d->pixmapRect.top(), iconSize, iconSize);
pos += iconSize;
......@@ -743,7 +743,7 @@ void ImportNormalDelegate::updateRects()
const ImportSettings* const importSettings = ImportSettings::instance();
d->drawImageFormat = importSettings->getIconShowImageFormat();
d->drawCoordinates = ImportSettings::instance()->getIconShowCoordinates();
const int iconSize = 16;
const int iconSize = qBound(16, (d->contentWidth + 2*d->margin) / 8 - 2, 48);
d->pickLabelRect = QRect(d->margin, y, iconSize, iconSize);
// d->groupRect = QRect(d->contentWidth - iconSize, y, iconSize, iconSize); // TODO
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment