✨ feat(UI模块): 调整搜索框的显示逻辑
This commit is contained in:
parent
ed00129231
commit
3b2f9b779b
|
@ -170,8 +170,8 @@ FileManageWin::FileManageWin(QWidget *parent) : QWidget(parent)
|
|||
hLayout->addWidget(m_crumb);
|
||||
hLayout->addStretch();
|
||||
hLayout->addWidget(m_searchBtn);
|
||||
hLayout->addWidget(m_lab3);
|
||||
hLayout->addWidget(m_searchLine);
|
||||
hLayout->addWidget(m_lab3);
|
||||
hLayout->addWidget(m_editBtn);
|
||||
hLayout->addWidget(m_selectBtn);
|
||||
hLayout->addWidget(m_lab4);
|
||||
|
@ -185,7 +185,7 @@ FileManageWin::FileManageWin(QWidget *parent) : QWidget(parent)
|
|||
m_loadAnimation = new LoadAnimation(this);
|
||||
|
||||
m_stackedWin = new QStackedWidget(this);
|
||||
m_stackedWin->setContentsMargins(0, 0, 0, 0);
|
||||
m_stackedWin->setContentsMargins(0, 5, 0, 0);
|
||||
m_stackedWin->addWidget(m_loadAnimation);
|
||||
m_stackedWin->setCurrentIndex(FileManageWin::PageIndex::LoadPage);
|
||||
|
||||
|
@ -312,7 +312,9 @@ void FileManageWin::changeTabMode(FileManageWin::TabType type)
|
|||
m_forwardBtn->show();
|
||||
m_lab2->show();
|
||||
m_crumb->show();
|
||||
m_searchBtn->show();
|
||||
if (m_searchLine->isHidden()) {
|
||||
m_searchBtn->show();
|
||||
}
|
||||
m_lab3->show();
|
||||
m_editBtn->show();
|
||||
m_lab4->show();
|
||||
|
@ -326,7 +328,9 @@ void FileManageWin::changeTabMode(FileManageWin::TabType type)
|
|||
m_statusLab->setText(CrumbTag::FileList);
|
||||
m_lab1->show();
|
||||
m_statusLab->show();
|
||||
m_searchBtn->show();
|
||||
if (m_searchLine->isHidden()) {
|
||||
m_searchBtn->show();
|
||||
}
|
||||
m_lab4->show();
|
||||
} break;
|
||||
case FileManageWin::TabType::AppHomePage: {
|
||||
|
@ -335,21 +339,24 @@ void FileManageWin::changeTabMode(FileManageWin::TabType type)
|
|||
m_forwardBtn->show();
|
||||
m_lab2->show();
|
||||
m_crumb->show();
|
||||
m_searchBtn->show();
|
||||
if (m_searchLine->isHidden()) {
|
||||
m_searchBtn->show();
|
||||
}
|
||||
m_lab4->show();
|
||||
} break;
|
||||
case FileManageWin::TabType::SearchResultsPage: {
|
||||
m_statusLab->setText(tr("Search File"));
|
||||
m_retreatBtn->setEnabled(true);
|
||||
m_retreatBtn->show();
|
||||
m_statusLab->show();
|
||||
if (m_searchLine->isHidden()) {
|
||||
m_searchBtn->show();
|
||||
m_lab3->show();
|
||||
m_editBtn->show();
|
||||
m_lab4->show();
|
||||
m_verticalLine->show();
|
||||
m_lab5->show();
|
||||
}
|
||||
m_lab3->show();
|
||||
m_editBtn->show();
|
||||
m_lab4->show();
|
||||
m_verticalLine->show();
|
||||
m_lab5->show();
|
||||
m_modeBtn->show();
|
||||
m_lab6->show();
|
||||
m_refreshBtn->show();
|
||||
|
@ -360,6 +367,7 @@ void FileManageWin::changeTabMode(FileManageWin::TabType type)
|
|||
} break;
|
||||
case FileManageWin::TabType::Edit: {
|
||||
m_statusLab->show();
|
||||
m_lab3->show();
|
||||
m_selectBtn->show();
|
||||
m_lab5->show();
|
||||
m_finishBtn->show();
|
||||
|
@ -392,13 +400,12 @@ void FileManageWin::slotCrumbIndexChange(int index)
|
|||
void FileManageWin::slotKdkBtnClicked()
|
||||
{
|
||||
hideSearchLine();
|
||||
|
||||
kdk::KToolButton *btn = qobject_cast<kdk::KToolButton *>(sender());
|
||||
if (btn == m_retreatBtn) {
|
||||
load();
|
||||
if (m_isSearch) {
|
||||
m_isSearch = false;
|
||||
Q_EMIT sigBtnCliked(FileManageWin::BtnType::ReturnBtn);
|
||||
m_searchLine->clear();
|
||||
} else {
|
||||
Q_EMIT sigBtnCliked(FileManageWin::BtnType::GoBacktBtn);
|
||||
}
|
||||
|
@ -407,8 +414,6 @@ void FileManageWin::slotKdkBtnClicked()
|
|||
Q_EMIT sigBtnCliked(FileManageWin::BtnType::GoForwardBtn);
|
||||
} else if (btn == m_searchBtn) {
|
||||
m_searchBtn->hide();
|
||||
m_editBtn->hide();
|
||||
m_verticalLine->hide();
|
||||
m_searchLine->show();
|
||||
m_searchLineAnimation->setStartValue(0);
|
||||
m_searchLineAnimation->setEndValue(SEARCHLINE_WIDTH);
|
||||
|
@ -436,7 +441,6 @@ void FileManageWin::slotKdkBtnClicked()
|
|||
void FileManageWin::slotBtnClicked()
|
||||
{
|
||||
hideSearchLine();
|
||||
|
||||
ClickLabel *btn = qobject_cast<ClickLabel *>(sender());
|
||||
if (btn == m_selectBtn) {
|
||||
if (m_selectBtn->text() == tr("Select All")) {
|
||||
|
@ -477,5 +481,10 @@ void FileManageWin::slotSearchTextChanged()
|
|||
return;
|
||||
}
|
||||
load();
|
||||
if (m_searchLine->text().isEmpty()) {
|
||||
m_isSearch = false;
|
||||
Q_EMIT sigBtnCliked(FileManageWin::BtnType::ReturnBtn);
|
||||
return;
|
||||
}
|
||||
Q_EMIT sigSearchTextChanged(m_searchLine->text());
|
||||
}
|
Loading…
Reference in New Issue