#130514,全屏菜单的滑块透明度修改

This commit is contained in:
lixueman 2022-07-20 16:45:32 +08:00
parent bd90c1b701
commit 89ad4de047
4 changed files with 36 additions and 20 deletions

View File

@ -119,13 +119,13 @@ void FullCommonUseWidget::initVerticalScrollBar()
m_verticalScrollBar->show(); m_verticalScrollBar->show();
} }
m_scrollBarStyle = QString("QScrollBar:vertical{width: %2px; background: rgba(12, 12, 12, 1); " m_scrollBarStyle = QString("QScrollBar:vertical{width: %2px; background: rgba(12, 12, 12, %4); "
"margin: 0px,0px,0px,0px; border-radius: %3px;}" "margin: 0px,0px,0px,0px; border-radius: %3px;}"
"QScrollBar::handle:vertical{width: %2px; background: rgba(255, 255, 255, 1);" "QScrollBar::handle:vertical{width: %2px; background: rgba(255, 255, 255, %5);"
"border-radius: %3px; min-height: %1;}" "border-radius: %3px; min-height: %1;}"
"QScrollBar::add-line:vertical{ height: 0px; width: 0px; subcontrol-position: bottom;}" "QScrollBar::add-line:vertical{ height: 0px; width: 0px; subcontrol-position: bottom;}"
"QScrollBar::sub-line:vertical{ height: 0px; width: 0px; subcontrol-position:top;}").arg(scrollBarSize); "QScrollBar::sub-line:vertical{ height: 0px; width: 0px; subcontrol-position:top;}").arg(scrollBarSize);
m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(4).arg(2)); m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(4).arg(2).arg(0.25).arg(0.6));
} }
void FullCommonUseWidget::on_powerOffButton_clicked() void FullCommonUseWidget::on_powerOffButton_clicked()
@ -219,11 +219,15 @@ bool FullCommonUseWidget::eventFilter(QObject *watched, QEvent *event)
if (watched == m_verticalScrollBar) { if (watched == m_verticalScrollBar) {
if (event->type() == QEvent::Enter) { if (event->type() == QEvent::Enter) {
m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(8).arg(4)); m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(8).arg(4).arg(0.25).arg(0.78));
} }
if (event->type() == QEvent::Leave) { if (event->type() == QEvent::Leave) {
m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(4).arg(2)); m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(4).arg(2).arg(0.25).arg(0.6));
}
if(event->type() == QEvent::MouseButtonPress) {
m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(8).arg(4).arg(0.25).arg(0.9));
} }
} }

View File

@ -139,13 +139,13 @@ void FullFunctionWidget::initVerticalScrollBar()
m_verticalScrollBar->show(); m_verticalScrollBar->show();
} }
m_scrollBarStyle = QString("QScrollBar:vertical{width: %2px; background: rgba(12, 12, 12, 1); " m_scrollBarStyle = QString("QScrollBar:vertical{width: %2px; background: rgba(12, 12, 12, %4); "
"margin: 0px,0px,0px,0px; border-radius: %3px;}" "margin: 0px,0px,0px,0px; border-radius: %3px;}"
"QScrollBar::handle:vertical{width: %2px; background: rgba(255, 255, 255, 1);" "QScrollBar::handle:vertical{width: %2px; background: rgba(255, 255, 255, %5);"
"border-radius: %3px; min-height: %1;}" "border-radius: %3px; min-height: %1;}"
"QScrollBar::add-line:vertical{ height: 0px; width: 0px; subcontrol-position: bottom;}" "QScrollBar::add-line:vertical{ height: 0px; width: 0px; subcontrol-position: bottom;}"
"QScrollBar::sub-line:vertical{ height: 0px; width: 0px; subcontrol-position:top;}").arg(scrollBarSize); "QScrollBar::sub-line:vertical{ height: 0px; width: 0px; subcontrol-position:top;}").arg(scrollBarSize);
m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(4).arg(2)); m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(4).arg(2).arg(0.25).arg(0.6));
} }
void FullFunctionWidget::on_powerOffButton_clicked() void FullFunctionWidget::on_powerOffButton_clicked()
@ -505,11 +505,15 @@ bool FullFunctionWidget::eventFilter(QObject *watched, QEvent *event)
if (watched == m_verticalScrollBar) { if (watched == m_verticalScrollBar) {
if (watched == m_verticalScrollBar) { if (watched == m_verticalScrollBar) {
if (event->type() == QEvent::Enter) { if (event->type() == QEvent::Enter) {
m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(8).arg(4)); m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(8).arg(4).arg(0.25).arg(0.78));
} }
if (event->type() == QEvent::Leave) { if (event->type() == QEvent::Leave) {
m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(4).arg(2)); m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(4).arg(2).arg(0.25).arg(0.6));
}
if(event->type() == QEvent::MouseButtonPress) {
m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(8).arg(4).arg(0.25).arg(0.9));
} }
} }
} else { } else {

View File

@ -133,13 +133,13 @@ void FullLetterWidget::initVerticalScrollBar()
m_verticalScrollBar->show(); m_verticalScrollBar->show();
} }
m_scrollBarStyle = QString("QScrollBar:vertical{width: %2px; background: rgba(12, 12, 12, 1); " m_scrollBarStyle = QString("QScrollBar:vertical{width: %2px; background: rgba(12, 12, 12, %4); "
"margin: 0px,0px,0px,0px; border-radius: %3px;}" "margin: 0px,0px,0px,0px; border-radius: %3px;}"
"QScrollBar::handle:vertical{width: %2px; background: rgba(255, 255, 255, 1);" "QScrollBar::handle:vertical{width: %2px; background: rgba(255, 255, 255, %5);"
"border-radius: %3px; min-height: %1;}" "border-radius: %3px; min-height: %1;}"
"QScrollBar::add-line:vertical{ height: 0px; width: 0px; subcontrol-position: bottom;}" "QScrollBar::add-line:vertical{ height: 0px; width: 0px; subcontrol-position: bottom;}"
"QScrollBar::sub-line:vertical{ height: 0px; width: 0px; subcontrol-position:top;}").arg(scrollBarSize); "QScrollBar::sub-line:vertical{ height: 0px; width: 0px; subcontrol-position:top;}").arg(scrollBarSize);
m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(4).arg(2)); m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(4).arg(2).arg(0.25).arg(0.6));
} }
void FullLetterWidget::on_powerOffButton_clicked() void FullLetterWidget::on_powerOffButton_clicked()
@ -531,11 +531,15 @@ bool FullLetterWidget::eventFilter(QObject *watched, QEvent *event)
{ {
if (watched == m_verticalScrollBar) { if (watched == m_verticalScrollBar) {
if (event->type() == QEvent::Enter) { if (event->type() == QEvent::Enter) {
m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(8).arg(4)); m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(8).arg(4).arg(0.25).arg(0.78));
} }
if (event->type() == QEvent::Leave) { if (event->type() == QEvent::Leave) {
m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(4).arg(2)); m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(4).arg(2).arg(0.25).arg(0.6));
}
if(event->type() == QEvent::MouseButtonPress) {
m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(8).arg(4).arg(0.25).arg(0.9));
} }
} else { } else {
if (event->type() == QEvent::KeyPress) { if (event->type() == QEvent::KeyPress) {

View File

@ -108,13 +108,13 @@ void FullSearchResultWidget::initVerticalScrollBar()
m_verticalScrollBar->show(); m_verticalScrollBar->show();
} }
m_scrollBarStyle = QString("QScrollBar:vertical{width: %2px; background: rgba(12, 12, 12, 1); " m_scrollBarStyle = QString("QScrollBar:vertical{width: %2px; background: rgba(12, 12, 12, %4); "
"margin: 0px,0px,0px,0px; border-radius: %3px;}" "margin: 0px,0px,0px,0px; border-radius: %3px;}"
"QScrollBar::handle:vertical{width: %2px; background: rgba(255, 255, 255, 1);" "QScrollBar::handle:vertical{width: %2px; background: rgba(255, 255, 255, %5);"
"border-radius: %3px; min-height: %1;}" "border-radius: %3px; min-height: %1;}"
"QScrollBar::add-line:vertical{ height: 0px; width: 0px; subcontrol-position: bottom;}" "QScrollBar::add-line:vertical{ height: 0px; width: 0px; subcontrol-position: bottom;}"
"QScrollBar::sub-line:vertical{ height: 0px; width: 0px; subcontrol-position:top;}").arg(scrollBarSize); "QScrollBar::sub-line:vertical{ height: 0px; width: 0px; subcontrol-position:top;}").arg(scrollBarSize);
m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(4).arg(2)); m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(4).arg(2).arg(0.25).arg(0.6));
} }
void FullSearchResultWidget::on_powerOffButton_clicked() void FullSearchResultWidget::on_powerOffButton_clicked()
@ -204,11 +204,15 @@ bool FullSearchResultWidget::eventFilter(QObject *watched, QEvent *event)
if (watched == m_verticalScrollBar) { if (watched == m_verticalScrollBar) {
if (event->type() == QEvent::Enter) { if (event->type() == QEvent::Enter) {
m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(8).arg(4)); m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(8).arg(4).arg(0.25).arg(0.78));
} }
if (event->type() == QEvent::Leave) { if (event->type() == QEvent::Leave) {
m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(4).arg(2)); m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(4).arg(2).arg(0.25).arg(0.6));
}
if(event->type() == QEvent::MouseButtonPress) {
m_verticalScrollBar->setStyleSheet(m_scrollBarStyle.arg(8).arg(4).arg(0.25).arg(0.9));
} }
} }