Commit 42eb0556 authored by Craig Watson's avatar Craig Watson

Removed deprecated QPlastiqueStyle. Replaced by stock Fusion style (new in...

Removed deprecated QPlastiqueStyle. Replaced by stock Fusion style (new in Qt5). Change this to keep the custom look defined in UBStyle?
parent 385ac60c
......@@ -31,6 +31,7 @@
#include <QtWebKit>
#include <QtXml>
#include <QFontDatabase>
#include <QStyleFactory>
#if defined(Q_WS_MACX)
#include <Carbon/Carbon.h>
......@@ -157,7 +158,7 @@ UBApplication::UBApplication(const QString &id, int &argc, char **argv) : QtSing
setWindowIcon(QIcon(":/images/OpenBoard.png"));
#endif
setStyle(new UBStyle()); // Style is owned and deleted by the application
setStyle("fusion");
QString css = UBFileSystemUtils::readTextFile(UBPlatformUtils::applicationResourcesDirectory() + "/etc/"+ qApp->applicationName()+".css");
if (css.length() > 0)
......@@ -650,39 +651,6 @@ void UBApplication::cleanup()
documentController = NULL;
}
void UBStyle::drawItemText(QPainter *painter, const QRect &rect, int alignment, const QPalette &pal,
bool enabled, const QString& text, QPalette::ColorRole textRole) const
{
if (text.isEmpty())
return;
QPen savedPen;
if (textRole != QPalette::NoRole)
{
savedPen = painter->pen();
painter->setPen(QPen(pal.brush(textRole), savedPen.widthF()));
}
if (!enabled)
{
QPen pen = painter->pen();
QColor half = pen.color();
half.setRed(half.red() / 2);
half.setGreen(half.green() / 2);
half.setBlue(half.blue() / 2);
painter->setPen(half);
painter->drawText(rect, alignment, text);
painter->setPen(pen);
}
painter->drawText(rect, alignment, text);
if (textRole != QPalette::NoRole)
painter->setPen(savedPen);
}
QString UBApplication::urlFromHtml(QString html)
{
QString _html;
......
......@@ -29,6 +29,8 @@
#define UBAPPLICATION_H_
#include <QtGui>
#include <QUndoStack>
#include <QToolBar>
#include "qtsingleapplication.h"
......@@ -144,29 +146,4 @@ class UBApplication : public QtSingleApplication
};
class UBStyle : public QPlastiqueStyle
{
public:
UBStyle()
: QPlastiqueStyle()
{
// NOOP
}
virtual ~UBStyle()
{
// NOOP
}
/*
* redefined to be more cocoa like on texts
*/
virtual void drawItemText(QPainter *painter, const QRect &rect, int alignment, const QPalette &pal,
bool enabled, const QString& text, QPalette::ColorRole textRole) const;
};
#endif /* UBAPPLICATION_H_ */
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