mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Resolution-independent DiveEventItem icon sizes
Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
5f44fdd9cf
commit
048f18db85
1 changed files with 7 additions and 2 deletions
|
@ -8,6 +8,7 @@
|
||||||
#include "profile.h"
|
#include "profile.h"
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include "gettextfromc.h"
|
#include "gettextfromc.h"
|
||||||
|
#include "metrics.h"
|
||||||
|
|
||||||
extern struct ev_select *ev_namelist;
|
extern struct ev_select *ev_namelist;
|
||||||
extern int evn_used;
|
extern int evn_used;
|
||||||
|
@ -58,8 +59,12 @@ void DiveEventItem::setEvent(struct event *ev)
|
||||||
|
|
||||||
void DiveEventItem::setupPixmap()
|
void DiveEventItem::setupPixmap()
|
||||||
{
|
{
|
||||||
#define EVENT_PIXMAP(PIX) QPixmap(QString(PIX)).scaled(20, 20, Qt::KeepAspectRatio, Qt::SmoothTransformation)
|
const IconMetrics& metrics = defaultIconMetrics();
|
||||||
#define EVENT_PIXMAP_BIGGER(PIX) QPixmap(QString(PIX)).scaled(40, 38, Qt::KeepAspectRatio, Qt::SmoothTransformation)
|
int sz_bigger = metrics.sz_med + metrics.sz_small; // ex 40px
|
||||||
|
int sz_pix = sz_bigger/2; // ex 20px
|
||||||
|
|
||||||
|
#define EVENT_PIXMAP(PIX) QPixmap(QString(PIX)).scaled(sz_pix, sz_pix, Qt::KeepAspectRatio, Qt::SmoothTransformation)
|
||||||
|
#define EVENT_PIXMAP_BIGGER(PIX) QPixmap(QString(PIX)).scaled(sz_bigger, sz_bigger, Qt::KeepAspectRatio, Qt::SmoothTransformation)
|
||||||
if (!internalEvent->name) {
|
if (!internalEvent->name) {
|
||||||
setPixmap(EVENT_PIXMAP(":warning"));
|
setPixmap(EVENT_PIXMAP(":warning"));
|
||||||
} else if (internalEvent->type == SAMPLE_EVENT_BOOKMARK) {
|
} else if (internalEvent->type == SAMPLE_EVENT_BOOKMARK) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue