Merge pull request #22 from F1ynn/master
Skinned scrollbars and other small improvements
Before Width: | Height: | Size: 549 B After Width: | Height: | Size: 744 B |
74
ui/chatArea/chatArea.css
Normal file
|
@ -0,0 +1,74 @@
|
|||
QScrollArea {
|
||||
background: transparent;
|
||||
border: 0 0 0 0;
|
||||
}
|
||||
|
||||
QScrollArea > QWidget > QWidget {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
QScrollBar:vertical {
|
||||
background: white;
|
||||
width: 10px;
|
||||
margin: 12px 0 12px 0;
|
||||
}
|
||||
|
||||
QScrollBar::handle:vertical {
|
||||
background: #d1d1d1;
|
||||
min-height: 20px;
|
||||
}
|
||||
|
||||
QScrollBar::handle:vertical:hover {
|
||||
background: #e3e3e3;
|
||||
}
|
||||
|
||||
QScrollBar::handle:vertical:pressed {
|
||||
background: #b1b1b1;
|
||||
}
|
||||
|
||||
QScrollBar::add-line:vertical {
|
||||
background: url("ui/chatArea/scrollBarDownArrow.png") center;
|
||||
height: 10px;
|
||||
subcontrol-position: bottom;
|
||||
subcontrol-origin: margin;
|
||||
}
|
||||
|
||||
QScrollBar::add-line:vertical:hover {
|
||||
background: url("ui/chatArea/scrollBarDownArrowHover.png") center;
|
||||
}
|
||||
|
||||
QScrollBar::add-line:vertical:pressed {
|
||||
background: url("ui/chatArea/scrollBarDownArrowPressed.png") center;
|
||||
}
|
||||
|
||||
QScrollBar::sub-line:vertical {
|
||||
background: url("ui/chatArea/scrollBarUpArrow.png") center;
|
||||
height: 10px;
|
||||
subcontrol-position: top;
|
||||
subcontrol-origin: margin;
|
||||
}
|
||||
|
||||
QScrollBar::sub-line:vertical:hover {
|
||||
background: url("ui/chatArea/scrollBarUpArrowHover.png") center;
|
||||
}
|
||||
|
||||
QScrollBar::sub-line:vertical:pressed {
|
||||
background: url("ui/chatArea/scrollBarUpArrowPressed.png") center;
|
||||
|
||||
}
|
||||
|
||||
QScrollBar:QScrollBar::down-arrow:vertical {
|
||||
width: 10;
|
||||
height: 10px;
|
||||
background: white;
|
||||
}
|
||||
|
||||
QScrollBar:QScrollBar::up-arrow:vertical {
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
background: white;
|
||||
}
|
||||
|
||||
QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical {
|
||||
background: none;
|
||||
}
|
BIN
ui/chatArea/scrollBarArrows.xcf
Normal file
BIN
ui/chatArea/scrollBarDownArrow.png
Normal file
After Width: | Height: | Size: 233 B |
BIN
ui/chatArea/scrollBarDownArrowHover.png
Normal file
After Width: | Height: | Size: 228 B |
BIN
ui/chatArea/scrollBarDownArrowPressed.png
Normal file
After Width: | Height: | Size: 228 B |
BIN
ui/chatArea/scrollBarHandle.png
Normal file
After Width: | Height: | Size: 327 B |
BIN
ui/chatArea/scrollBarUpArrow.png
Normal file
After Width: | Height: | Size: 236 B |
BIN
ui/chatArea/scrollBarUpArrowHover.png
Normal file
After Width: | Height: | Size: 217 B |
BIN
ui/chatArea/scrollBarUpArrowPressed.png
Normal file
After Width: | Height: | Size: 217 B |
|
@ -29,15 +29,38 @@ ChatForm::ChatForm(Friend* chatFriend)
|
|||
avatar->setPixmap(*chatFriend->widget->avatar.pixmap());
|
||||
|
||||
chatAreaWidget->setLayout(mainChatLayout);
|
||||
QString chatAreaStylesheet = "";
|
||||
try
|
||||
{
|
||||
QFile f("ui/chatArea/chatArea.css");
|
||||
f.open(QFile::ReadOnly | QFile::Text);
|
||||
QTextStream chatAreaStylesheetStream(&f);
|
||||
chatAreaStylesheet = chatAreaStylesheetStream.readAll();
|
||||
}
|
||||
catch (int e) {}
|
||||
chatArea->setStyleSheet(chatAreaStylesheet);
|
||||
chatArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded);
|
||||
chatArea->setWidgetResizable(true);
|
||||
chatArea->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||
chatArea->setFrameStyle(QFrame::NoFrame);
|
||||
|
||||
mainChatLayout->setColumnStretch(1,1);
|
||||
mainChatLayout->setSpacing(10);
|
||||
|
||||
footButtonsSmall->setSpacing(2);
|
||||
|
||||
QString msgEditStylesheet = "";
|
||||
try
|
||||
{
|
||||
QFile f("ui/msgEdit/msgEdit.css");
|
||||
f.open(QFile::ReadOnly | QFile::Text);
|
||||
QTextStream msgEditStylesheetStream(&f);
|
||||
msgEditStylesheet = msgEditStylesheetStream.readAll();
|
||||
}
|
||||
catch (int e) {}
|
||||
msgEdit->setStyleSheet(msgEditStylesheet);
|
||||
msgEdit->setFixedHeight(50);
|
||||
msgEdit->setFrameStyle(QFrame::NoFrame);
|
||||
|
||||
QString sendButtonStylesheet = "";
|
||||
try
|
||||
|
@ -50,10 +73,6 @@ ChatForm::ChatForm(Friend* chatFriend)
|
|||
catch (int e) {}
|
||||
sendButton->setStyleSheet(sendButtonStylesheet);
|
||||
|
||||
QPalette toxgreen;
|
||||
toxgreen.setColor(QPalette::Button, QColor(107,194,96)); // Tox Green
|
||||
|
||||
|
||||
QString fileButtonStylesheet = "";
|
||||
try
|
||||
{
|
||||
|
|
|
@ -39,9 +39,39 @@ GroupChatForm::GroupChatForm(Group* chatGroup)
|
|||
namesList->setFont(small);
|
||||
|
||||
chatAreaWidget->setLayout(mainChatLayout);
|
||||
QString chatAreaStylesheet = "";
|
||||
try
|
||||
{
|
||||
QFile f("ui/chatArea/chatArea.css");
|
||||
f.open(QFile::ReadOnly | QFile::Text);
|
||||
QTextStream chatAreaStylesheetStream(&f);
|
||||
chatAreaStylesheet = chatAreaStylesheetStream.readAll();
|
||||
}
|
||||
catch (int e) {}
|
||||
chatArea->setStyleSheet(chatAreaStylesheet);
|
||||
chatArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded);
|
||||
chatArea->setWidgetResizable(true);
|
||||
chatArea->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||
chatArea->setFrameStyle(QFrame::NoFrame);
|
||||
|
||||
mainChatLayout->setColumnStretch(1,1);
|
||||
mainChatLayout->setSpacing(10);
|
||||
|
||||
|
||||
QString msgEditStylesheet = "";
|
||||
try
|
||||
{
|
||||
QFile f("ui/msgEdit/msgEdit.css");
|
||||
f.open(QFile::ReadOnly | QFile::Text);
|
||||
QTextStream msgEditStylesheetStream(&f);
|
||||
msgEditStylesheet = msgEditStylesheetStream.readAll();
|
||||
}
|
||||
catch (int e) {}
|
||||
msgEdit->setObjectName("group");
|
||||
msgEdit->setStyleSheet(msgEditStylesheet);
|
||||
msgEdit->setFixedHeight(50);
|
||||
msgEdit->setFrameStyle(QFrame::NoFrame);
|
||||
|
||||
mainChatLayout->setColumnStretch(1,1);
|
||||
mainChatLayout->setHorizontalSpacing(10);
|
||||
|
||||
|
@ -56,7 +86,6 @@ GroupChatForm::GroupChatForm(Group* chatGroup)
|
|||
catch (int e) {}
|
||||
sendButton->setStyleSheet(sendButtonStylesheet);
|
||||
|
||||
msgEdit->setFixedHeight(50);
|
||||
sendButton->setFixedSize(50, 50);
|
||||
|
||||
main->setLayout(mainLayout);
|
||||
|
|