Commit 0861d949 authored by Carsten Fuhrmann's avatar Carsten Fuhrmann
Browse files

using stylesheet files,

adjust style of treewidget
parent 7e3f39d6
......@@ -2,6 +2,7 @@
#include <QMouseEvent>
#include <Windows.h>
#include <qboxlayout.h>
#include <QFile>
ChannelTree::ChannelTree(ChannelListWidget * widget, QWidget *parent)
: QTreeWidget(parent)
......@@ -10,9 +11,13 @@ ChannelTree::ChannelTree(ChannelListWidget * widget, QWidget *parent)
setHeaderHidden(true);
setExpandsOnDoubleClick(false);
setStyleSheet("QTreeWidget{border-style:none; background-color:rgba(0,0,0,0); color:rgb(255,255,255);} QTreeWidget::item:selected{border-style:none; color:rgba(0,0,0,0);}");
setSizeAdjustPolicy(QAbstractScrollArea::AdjustToContents);
QFile styleSheet("plugins\\qtTsOverlay\\tree.styl");
styleSheet.open(QIODevice::ReadOnly);
setStyleSheet(styleSheet.readAll());
styleSheet.close();
setSizeAdjustPolicy(QAbstractScrollArea::AdjustToContents);
}
ChannelTree::~ChannelTree()
......@@ -56,7 +61,10 @@ ChannelListWidget::ChannelListWidget(QWidget *parent)
move(320, 200);
m_background = new QLabel(this);
m_background->setStyleSheet("padding:2px;border-radius:5px;border-style:solid;border-width:1px;border-color:rgb(100,100,100); background-color:rgba(50,50,50,150);");
QFile styleSheet("plugins\\qtTsOverlay\\background.styl");
styleSheet.open(QIODevice::ReadOnly);
m_background->setStyleSheet(styleSheet.readAll());
styleSheet.close();
QVBoxLayout* layout = new QVBoxLayout(this);
layout->setMargin(0);
......
padding:2px;
border-radius:5px;
border-style:solid;
border-width:1px;
border-color:rgb(100,100,100);
background-color:rgba(50,50,50,150);
padding:2px;
border-radius:5px;
border-style:solid;
border-width:1px;
border-color:rgb(100,100,100);
font:bold;
font-size:15px;
background-color:rgba(50,50,50,150);
color:rgb(255,255,255);
QTreeWidget {
border-style:none;
background-color:rgba(0,0,0,0);
color:rgb(255,255,255);
selection-background-color:transparent;
}
QTreeWidget::item:hover,QTreeWidget::item:hover:selected {
border-radius:5px;
border-style:none;
border-width:1px;
border-color:rgb(100,100,100);
background-color:rgba(255,255,255,100);
}
QTreeWidget::item:selected {
background-color:rgba(255,255,255,0);
border-style:none;
}
......@@ -5,6 +5,7 @@
#include <qdebug.h>
#include "teamspeak\public_errors.h"
#include <QRegExp>
#include <QFile>
//#ifndef _DEBUG
......@@ -26,6 +27,11 @@ OverlayController::OverlayController(const struct TS3Functions funcs, quint64 se
m_channelIcon.addFile("plugins\\qtTsOverlay\\channel.png");
m_clientIcon.addFile("plugins\\qtTsOverlay\\client.png");
QFile styleSheet("plugins\\qtTsOverlay\\label.styl");
styleSheet.open(QIODevice::ReadOnly);
m_stylesheet = styleSheet.readAll();
styleSheet.close();
m_screenHeight = desktop.screenGeometry().height();
m_screenWidth = desktop.screenGeometry().width();
......@@ -107,7 +113,7 @@ void OverlayController::addChatLine(QString message)
w->setWindowFlags(Qt::WindowStaysOnTopHint | Qt::FramelessWindowHint | Qt::WindowTransparentForInput | Qt::SplashScreen);
newChatLine->setText(message);
newChatLine->setStyleSheet("padding:2px;border-radius:5px;border-style:solid;border-width:1px;border-color:rgb(100,100,100);font:bold; font-size:15px;background-color:rgba(50,50,50,150); color:rgb(255,255,255);");
newChatLine->setStyleSheet(m_stylesheet);
newChatLine->adjustSize();
newChatLine->setAttribute(Qt::WA_ShowWithoutActivating);
......@@ -151,7 +157,7 @@ void OverlayController::addSpeaker(QString name)
w->setObjectName(name);
newSpeaker->setText(name);
newSpeaker->setStyleSheet("padding:2px;border-radius:5px;border-style:solid;border-width:1px;border-color:rgb(100,100,100);font:bold; font-size:15px;background-color:rgba(50,50,50,150); color:rgb(255,255,255);");
newSpeaker->setStyleSheet(m_stylesheet);
newSpeaker->adjustSize();
newSpeaker->setAttribute(Qt::WA_ShowWithoutActivating);
......
......@@ -43,6 +43,7 @@ private:
QIcon m_channelIcon;
QIcon m_clientIcon;
QString m_stylesheet;
QLabel* m_debugWindow;
QVector<QWidget*> m_speakers;
......
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