Commit 893ff139 authored by WINTZ Julien's avatar WINTZ Julien

Enough with all that nonsense.

parent 182672b5
......@@ -12,12 +12,13 @@
// Code:
#include <dtkFonts>
#include "dtkWidgetsHUDItem.h"
#include "dtkWidgetsLayoutItem.h"
#include "dtkWidgetsOverlayPane.h"
#include <dtkFonts>
#include <dtkThemes>
class dtkWidgetsHUDItemPrivate
{
public:
......@@ -30,7 +31,7 @@ dtkWidgetsHUDItem::dtkWidgetsHUDItem(fa::icon icon, QWidget *parent) : QFrame(pa
dtkFontAwesome::instance()->initFontAwesome();
dtkFontAwesome::instance()->setDefaultOption("scale-factor", 1.0);
dtkFontAwesome::instance()->setDefaultOption("color", dtkWidgetsLayoutItemProxy::color);
dtkFontAwesome::instance()->setDefaultOption("color", dtkThemesEngine::instance()->color("@fg"));
d->label = new QLabel(this);
d->label->setPixmap(dtkFontAwesome::instance()->icon(icon).pixmap(16, 16));
......@@ -59,8 +60,8 @@ void dtkWidgetsHUDItem::paintEvent(QPaintEvent *event)
{
QPainter painter(this);
painter.setRenderHint(QPainter::Antialiasing, true);
painter.setPen(dtkWidgetsOverlayPane::color);
painter.setBrush(dtkWidgetsOverlayPane::color);
painter.setPen(dtkThemesEngine::instance()->color("@fg"));
painter.setBrush(dtkThemesEngine::instance()->color("@bg"));
painter.drawRoundedRect(event->rect(), event->rect().size().width()/2, event->rect().size().height()/2);
QFrame::paintEvent(event);
......
......@@ -75,20 +75,13 @@ void dtkWidgetsLayoutItemButton::paintEvent(QPaintEvent *event)
{
QFrame::paintEvent(event);
QPainter painter(this);
painter.setRenderHints(QPainter::Antialiasing);
dtkFontAwesome::instance()->setDefaultOption("color", dtkThemesEngine::instance()->color("@fg"));
QPainter painter(this);
painter.setRenderHints(QPainter::Antialiasing);
painter.drawPixmap(0, 0, 16, 16, dtkFontAwesome::instance()->icon(m_icon).pixmap(16, 16));
}
// ///////////////////////////////////////////////////////////////////
// dtkWidgetsLayoutItemProxy
// ///////////////////////////////////////////////////////////////////
QColor dtkWidgetsLayoutItemProxy::color = QColor("#eeeeee");
// /////////////////////////////////////////////////////////////////
// dtkWidgetsLayoutItemProxy
// /////////////////////////////////////////////////////////////////
......@@ -97,8 +90,6 @@ dtkWidgetsLayoutItemProxy::dtkWidgetsLayoutItemProxy(QWidget *parent) : QFrame(p
{
d->view = NULL;
dtkFontAwesome::instance()->setDefaultOption("color", this->color);
QVBoxLayout *layout = new QVBoxLayout(this);
layout->setContentsMargins(0, 0, 0, 0);
......@@ -228,11 +219,6 @@ void dtkWidgetsLayoutItemProxy::setView(dtkWidgetsWidget *view)
QTimer::singleShot(100, d->view->widget(), SLOT(update()));
}
void dtkWidgetsLayoutItemProxy::setColor(QColor color)
{
dtkWidgetsLayoutItemProxy::color = color;
}
void dtkWidgetsLayoutItemProxy::focusInEvent(QFocusEvent *event)
{
QFrame::focusInEvent(event);
......@@ -274,9 +260,9 @@ void dtkWidgetsLayoutItemProxy::mouseMoveEvent(QMouseEvent *event)
QRect rect(this->rect().width() / 2 - this->rect().width() / 4, this->rect().height() / 2 - this->rect().height() / 4, this->rect().size().width() / 2, this->rect().size().height() / 2);
if(rect.contains(event->pos()))
dtkFontAwesome::instance()->setDefaultOption("color", this->color.lighter());
dtkFontAwesome::instance()->setDefaultOption("color", dtkThemesEngine::instance()->color("@fg").lighter());
else
dtkFontAwesome::instance()->setDefaultOption("color", this->color);
dtkFontAwesome::instance()->setDefaultOption("color", dtkThemesEngine::instance()->color("@fg"));
this->update();
}
......@@ -305,7 +291,7 @@ void dtkWidgetsLayoutItemProxy::paintEvent(QPaintEvent *event)
QRect rect(event->rect().width() / 2 - event->rect().width() / 4, event->rect().height() / 2 - event->rect().height() / 4, event->rect().size().width() / 2, event->rect().size().height() / 2);
if (d->dirty)
dtkFontAwesome::instance()->setDefaultOption("color", this->color);
dtkFontAwesome::instance()->setDefaultOption("color", dtkThemesEngine::instance()->color("@fg"));
QPainter painter(this);
painter.drawPixmap(rect, dtkFontAwesome::instance()->icon(fa::plussquare).pixmap(rect.size().width(), rect.size().height()));
......
......@@ -47,9 +47,6 @@ public:
public:
void setView(dtkWidgetsWidget *view);
public:
static void setColor(QColor);
signals:
void focusedIn(void);
void focusedOut(void);
......@@ -66,9 +63,6 @@ protected:
protected:
void paintEvent(QPaintEvent *);
public:
static QColor color;
private:
dtkWidgetsLayoutItemProxyPrivate *d;
......
......@@ -141,11 +141,6 @@ void dtkWidgetsOverlayPane::deactivate(void)
d->deactivate = true;
}
void dtkWidgetsOverlayPane::setColor(QColor color)
{
dtkWidgetsOverlayPane::color = color;
}
void dtkWidgetsOverlayPane::enterEvent(QEvent *)
{
emit entered();
......@@ -156,17 +151,6 @@ void dtkWidgetsOverlayPane::leaveEvent(QEvent *)
emit left();
}
void dtkWidgetsOverlayPane::paintEvent(QPaintEvent *event)
{
QRect rect = event->rect();
rect.setWidth(d->width);
QPainter painter(this);
painter.fillRect(rect, altbg_color);
painter.setPen(color);
painter.drawLine(rect.topRight(), rect.bottomRight());
}
void dtkWidgetsOverlayPane::addLayout(QLayout *layout)
{
d->layout->addLayout(layout);
......@@ -187,7 +171,5 @@ void dtkWidgetsOverlayPane::clear(void)
}
}
QColor dtkWidgetsOverlayPane::color = QColor("#242525");
//
// dtkWidgetsOverlayPane.cpp ends here
......@@ -57,16 +57,9 @@ public:
public slots:
void clear(void);
public:
static void setColor(QColor);
protected:
void enterEvent(QEvent *);
void leaveEvent(QEvent *);
void paintEvent(QPaintEvent *event);
private:
static QColor color;
private:
class dtkWidgetsOverlayPanePrivate *d;
......
......@@ -16,6 +16,7 @@
#include "dtkWidgetsOverlayPaneItem.h"
#include <dtkFonts>
#include <dtkThemes>
// ///////////////////////////////////////////////////////////////////
// dtkWidgetsOverlayPaneItemHeader
......@@ -55,7 +56,6 @@ private:
dtkWidgetsOverlayPaneItemHeader::dtkWidgetsOverlayPaneItemHeader(QWidget *parent) : QFrame(parent)
{
dtkFontAwesome::instance()->initFontAwesome();
dtkFontAwesome::instance()->setDefaultOption("color", dtkWidgetsLayoutItemProxy::color);
this->title = new QLabel(this);
this->title->setAlignment(Qt::AlignLeft | Qt::AlignVCenter);
......@@ -90,22 +90,22 @@ void dtkWidgetsOverlayPaneItemHeader::setTitle(const QString& title)
void dtkWidgetsOverlayPaneItemHeader::toggle(void)
{
QVariantMap options;
options.insert("text", dtkWidgetsLayoutItemProxy::color);
options.insert("text-active", dtkWidgetsLayoutItemProxy::color);
options.insert("text-disabled", dtkWidgetsLayoutItemProxy::color);
options.insert("text-selected", dtkWidgetsLayoutItemProxy::color);
options.insert("color", dtkWidgetsLayoutItemProxy::color);
options.insert("color-active", dtkWidgetsLayoutItemProxy::color);
options.insert("color-disabled", dtkWidgetsLayoutItemProxy::color);
options.insert("color-selected", dtkWidgetsLayoutItemProxy::color);
// // QVariantMap options;
// // options.insert("text", dtkThemesEngine::instance()->color("@fg"));
// // options.insert("text-active", dtkThemesEngine::instance()->color("@fg"));
// // options.insert("text-disabled", dtkThemesEngine::instance()->color("@fg"));
// // options.insert("text-selected", dtkThemesEngine::instance()->color("@fg"));
// // options.insert("color", dtkThemesEngine::instance()->color("@fg"));
// // options.insert("color-active", dtkThemesEngine::instance()->color("@fg"));
// // options.insert("color-disabled", dtkThemesEngine::instance()->color("@fg"));
// // options.insert("color-selected", dtkThemesEngine::instance()->color("@fg"));
this->expanded = !this->expanded;
if (this->expanded)
this->handle->setPixmap(dtkFontAwesome::instance()->icon(fa::minussquareo, options).pixmap(25, 25));
this->handle->setPixmap(dtkFontAwesome::instance()->icon(fa::minussquareo).pixmap(25, 25));
else
this->handle->setPixmap(dtkFontAwesome::instance()->icon(fa::plussquareo, options).pixmap(25, 25));
this->handle->setPixmap(dtkFontAwesome::instance()->icon(fa::plussquareo).pixmap(25, 25));
emit toggled(this->expanded);
}
......
......@@ -70,7 +70,7 @@ dtkWidgetsOverlayPaneSliderBar::~dtkWidgetsOverlayPaneSliderBar(void)
void dtkWidgetsOverlayPaneSliderBar::addItem(fa::icon icon)
{
dtkFontAwesome::instance()->setProperty("color", dtkWidgetsLayoutItemProxy::color);
dtkFontAwesome::instance()->setProperty("color", dtkThemesEngine::instance()->color("@fg"));
QToolButton *button = new QToolButton(this);
button->setToolButtonStyle(Qt::ToolButtonIconOnly);
......@@ -150,7 +150,7 @@ void dtkWidgetsOverlayPaneSliderViewPort::remWidget(QWidget *w)
}
// ///////////////////////////////////////////////////////////////////
// dtkWidgetsOverlayPaneSliderArea
// dtkWidgetsOverlayPaneSliderAreao
// ///////////////////////////////////////////////////////////////////
class dtkWidgetsOverlayPaneSliderArea : public QScrollArea
......
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