diff --git a/src/core/UBApplication.cpp b/src/core/UBApplication.cpp index 05a3acbc..57dad4f6 100644 --- a/src/core/UBApplication.cpp +++ b/src/core/UBApplication.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #if defined(Q_WS_MACX) #include @@ -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; diff --git a/src/core/UBApplication.h b/src/core/UBApplication.h index 49977f22..7a531d0f 100644 --- a/src/core/UBApplication.h +++ b/src/core/UBApplication.h @@ -29,6 +29,8 @@ #define UBAPPLICATION_H_ #include +#include +#include #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_ */