Fix web search UI;

This commit is contained in:
jixiaoxu 2021-08-26 20:15:32 +08:00
parent 23b9faf6c8
commit ebe8e076f7
3 changed files with 9 additions and 9 deletions

View File

@ -60,16 +60,16 @@ QString WebSearchLabel::getDefultStyleSheet()
bool WebSearchLabel::eventFilter(QObject *watched, QEvent *event)
{
if (watched == this) {
if(event->type() == QEvent::MouseButtonPress) {
this->setStyleSheet("background-color: #3790FA");//#3790FA选中颜色
if (event->type() == QEvent::MouseButtonPress) {
this->setStyleSheet("color: white; background-color: #3790FA");//#3790FA选中颜色
return true;
} else if(event->type() == QEvent::MouseButtonRelease) {
} else if (event->type() == QEvent::MouseButtonRelease) {
startSearch();
return true;
} else if(event->type() == QEvent::Enter) {
this->setStyleSheet("background-color: #87CEFA");//TODO鼠标悬浮颜色待定
} else if (event->type() == QEvent::Enter) {
this->setStyleSheet("background-color: #97bbe7");//TODO鼠标悬浮颜色
return true;
} else if(event->type() == QEvent::Leave) {
} else if (event->type() == QEvent::Leave) {
this->setStyleSheet(m_defultStyleSheet);//默认颜色
return true;
}

View File

@ -81,7 +81,7 @@ void ResultArea::pressEnter()
if (false == m_is_selected) {//未选中时默认选取bestlist第一项
int resultNum = m_bestListWidget->getResultNum();
if (0 == resultNum) {//搜索结果为空则选中网页搜索项
m_webSearchLable->setStyleSheet("background-color: #3790FA");//#3790FA选中颜色;
m_webSearchLable->setStyleSheet("color: white; background-color: #3790FA");//#3790FA选中颜色;
m_selectedPluginID = m_WebTitleLabel->text();
m_is_selected = true;
} else {//选取bestlist第一项
@ -170,7 +170,7 @@ void ResultArea::pressDown()
}
}
if (indexNum >= m_widget_list.size()) {//下一项是web search
m_webSearchLable->setStyleSheet("background-color: #3790FA");//#3790FA选中颜色;
m_webSearchLable->setStyleSheet("color: white; background-color: #3790FA");//#3790FA选中颜色;
m_selectedPluginID = m_WebTitleLabel->text();
m_is_selected = true;
this->ensureWidgetVisible(m_webSearchLable);

View File

@ -169,7 +169,7 @@ bool ResultView::isSelected()
int ResultView::showHeight()
{
int height;
int rowheight = this->rowHeight(this->model()->index(0, 0, QModelIndex())) + 1;
int rowheight = this->rowHeight(this->model()->index(0, 0, QModelIndex()));
if (this->isExpanded()) {
height = m_count * rowheight;
} else {