Style the ridelist scrollbar on non-mac

.. to be less obtrusive.

.. lets see if we can improve on this ?
This commit is contained in:
Mark Liversedge
2014-05-24 13:33:30 +01:00
parent 70de48f333
commit 91eb86a8aa
2 changed files with 38 additions and 4 deletions

View File

@@ -37,6 +37,7 @@ RideNavigator::RideNavigator(Context *context, bool mainwindow) : context(contex
_sortByIndex = 2;
_sortByOrder = 0;
currentColumn = -1;
this->mainwindow = mainwindow;
_groupBy = -1;
fontHeight = QFontMetrics(QFont()).height();
ColorEngine ce(context);
@@ -155,10 +156,42 @@ RideNavigator::refresh()
// hide ride list scroll bar ?
#ifndef Q_OS_MAC
if (appsettings->value(this, GC_RIDESCROLL, true).toBool() == false)
tableView->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
else
tableView->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
if (mainwindow) {
if (appsettings->value(this, GC_RIDESCROLL, true).toBool() == false)
tableView->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
else {
tableView->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
// style that sucker
tableView->setStyleSheet(
QString::fromUtf8("QScrollBar:vertical {"
" border: 0px;"
" background:%1;"
" width:10px; "
" margin: 0px 0px 0px 0px;"
"}"
"QScrollBar::handle:vertical {"
" background: darkGray; "
" min-height: 0px;"
""
"}"
"QScrollBar::add-line:vertical {"
" background: qlineargradient(x1:0, y1:0, x2:1, y2:0,"
" stop: 0 rgb(32, 47, 130), stop: 0.5 rgb(32, 47, 130), stop:1 rgb(32, 47, 130));"
" height: px;"
" subcontrol-position: bottom;"
" subcontrol-origin: margin;"
"}"
"QScrollBar::sub-line:vertical {"
" background: qlineargradient(x1:0, y1:0, x2:1, y2:0,"
" stop: 0 rgb(32, 47, 130), stop: 0.5 rgb(32, 47, 130), stop:1 rgb(32, 47, 130));"
" height: 0px;"
" subcontrol-position: top;"
" subcontrol-origin: margin;"
"}"
"").arg(GColor(CPLOTBACKGROUND).name()));
}
}
#endif
setWidth(geometry().width());

View File

@@ -159,6 +159,7 @@ class RideNavigator : public GcWindow
private:
bool active;
bool mainwindow;
bool init;
int currentColumn;
int pwidth;