Commit f3384e77 authored by Erwan Demairy's avatar Erwan Demairy

Handle properly the display of the data serie (one pixmap and two small icons to remove and save).

parent cb9c6c13
......@@ -53,14 +53,14 @@ protected:
~dtkVisualizationWidgetsDataManager(void);
protected:
void enterEvent(QEvent *);
void leaveEvent(QEvent *);
void enterEvent(QEvent *) override;
void leaveEvent(QEvent *) override;
protected:
void mousePressEvent(QMouseEvent *);
void mousePressEvent(QMouseEvent *) override;
protected:
void paintEvent(QPaintEvent *);
void paintEvent(QPaintEvent *) override;
private:
class dtkVisualizationWidgetsDataManagerPrivate *d;
......
#include "dtkVisualizationWidgetsDataManagerItemButton.h"
#include <dtkFonts>
#include <QApplication>
#include <QStyle>
#include <dtkFontAwesome>
dtkVisualizationWidgetsDataManagerItemButton::dtkVisualizationWidgetsDataManagerItemButton(const QColor& color, int icon, QWidget *parent) : QLabel(parent)
{
// this->font = new gnomonFontAwesome(this);
// this->font->initFontAwesome();
// this->font->setDefaultOption("color", color);
//
// this->setPixmap(this->font->icon(icon).pixmap(16, 16));
this->setText("TODO TODO");
this->font = dtkFontAwesome::instance();
this->font->initFontAwesome();
this->font->setDefaultOption("color", color);
this->setPixmap(this->font->icon(icon).pixmap(16, 16));
this->setStyleSheet("background: none; border: none;");
}
......
......@@ -3,7 +3,7 @@
#include <QtCore>
#include <QLabel>
class gnomonFontAwesome;
class dtkFontAwesome;
// ///////////////////////////////////////////////////////////////////
// gnomonItemButton
......@@ -24,5 +24,5 @@ protected:
void mousePressEvent(QMouseEvent *);
private:
gnomonFontAwesome *font;
dtkFontAwesome *font;
};
......@@ -8,12 +8,12 @@
QPixmap dtkVisualizationWidgetsDataSerie::pixmap() {
QPixmap dtkVisualizationWidgetsDataSerie::pixmap() const {
QStyle *style = QApplication::style();
QIcon icon = style->standardIcon(QStyle::SP_DesktopIcon );
return icon.pixmap(50,50);
QIcon icon = style->standardIcon(QStyle::SP_DriveCDIcon);
return icon.pixmap(25,25);
}
long dtkVisualizationWidgetsDataSerie::count() {
return 0;
long dtkVisualizationWidgetsDataSerie::count() const {
return 2;
}
......@@ -10,9 +10,12 @@
class dtkVisualizationWidgetsDataSerie: public QObject {
Q_OBJECT
public:
public:
QPixmap pixmap();
long count();
QPixmap pixmap() const;
long count() const;
};
using dtkVisualizationWidgetsDataSeriePtr = QPointer<dtkVisualizationWidgetsDataSerie>;
......
Markdown is supported
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