1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

Added skinned scrollbar in chat

This commit is contained in:
Kevin Flynn 2014-06-28 13:02:19 -07:00
parent 4d7c5f71f6
commit 33e487d0dd
11 changed files with 76 additions and 0 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 549 B

After

Width:  |  Height:  |  Size: 744 B

65
ui/chatArea/chatArea.css Normal file
View File

@ -0,0 +1,65 @@
QScrollBar:vertical {
background: white;
width: 10px;
margin: 12px 0 12px 0;
}
QScrollBar::handle:vertical {
background: #d1d1d1;
min-height: 20px;
}
QScrollBar::handle:vertical:hover {
background: #e7e7e7;
}
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;
}

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 233 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 228 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 228 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 327 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 236 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 217 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 217 B

View File

@ -29,9 +29,20 @@ 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);
mainChatLayout->setColumnStretch(1,1);
mainChatLayout->setSpacing(10);