same for chat. changed the paths to: css/qt.css css/chat.css
authorsheepluva
Sat, 22 Oct 2011 01:53:14 +0200
changeset 6177 5eba8970e8ae
parent 6176 19ef039a8474
child 6178 affa860f2983
same for chat. changed the paths to: css/qt.css css/chat.css note: display:none is not supported by QTextBrowser, I might pimp it up to do so
QTfrontend/main.cpp
QTfrontend/ui/widget/chatwidget.cpp
--- a/QTfrontend/main.cpp	Sat Oct 22 01:00:21 2011 +0200
+++ b/QTfrontend/main.cpp	Sat Oct 22 01:53:14 2011 +0200
@@ -483,7 +483,7 @@
 #endif
     // load external stylesheet if there is any
     QFile * file =
-        new QFile(HWDataManager::instance().findFileForRead("misc/qt_style.css"));
+        new QFile(HWDataManager::instance().findFileForRead("css/qt.css"));
 
     if (file->exists() && file->open(QIODevice::ReadOnly | QIODevice::Text))
     {
--- a/QTfrontend/ui/widget/chatwidget.cpp	Sat Oct 22 01:00:21 2011 +0200
+++ b/QTfrontend/ui/widget/chatwidget.cpp	Sat Oct 22 01:53:14 2011 +0200
@@ -140,7 +140,26 @@
     mainLayout.addWidget(chatEditLine, 2, 0);
 
     chatText = new QTextBrowser(this);
-    chatText->document()->setDefaultStyleSheet(STYLE);
+
+    // load external stylesheet if there is any
+    QFile * file =
+        new QFile(HWDataManager::instance().findFileForRead("css/chat.css"));
+
+    if (file->exists() && file->open(QIODevice::ReadOnly | QIODevice::Text))
+    {
+        QString style = "";
+        QTextStream in(file);
+        while (!in.atEnd())
+        {
+            QString line = in.readLine();
+            if(!line.isEmpty())
+                style.append(line);
+        }
+        chatText->document()->setDefaultStyleSheet(style);
+    }
+    else
+        chatText->document()->setDefaultStyleSheet(STYLE);
+
     chatText->setMinimumHeight(20);
     chatText->setMinimumWidth(10);
     chatText->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);