mirror of
https://gitee.com/spark-store-project/spark-store
synced 2025-09-11 05:42:20 +08:00
feat: 改进搜索动画
This commit is contained in:
parent
9c80179493
commit
b9121c13ab
@ -745,9 +745,15 @@ void Widget::searchApp(QString text)
|
||||
// 禁止同时进行多次搜索
|
||||
if (!mutex.tryLock())
|
||||
{
|
||||
qDebug() << "Do not repeat searches!";
|
||||
sendNotification(tr("Do not repeat searches!"));
|
||||
return;
|
||||
}
|
||||
|
||||
//加载动画
|
||||
spinner->show();
|
||||
spinner->start();
|
||||
|
||||
// 关键字搜索处理
|
||||
httpClient->get("https://search.deepinos.org.cn/appinfo/search")
|
||||
.header("content-type", "application/json")
|
||||
@ -760,8 +766,14 @@ void Widget::searchApp(QString text)
|
||||
qDebug() << "相关应用未找到!";
|
||||
sendNotification(tr("Relative apps Not Found!"));
|
||||
mutex.unlock();
|
||||
clearSearchApp();
|
||||
spinner->stop();
|
||||
spinner->hide();
|
||||
ui->stackedWidget->setCurrentIndex(0);
|
||||
ui->webEngineView->setUrl(QUrl("https://wayou.github.io/t-rex-runner"));
|
||||
return;
|
||||
}
|
||||
clearSearchApp();
|
||||
displaySearchApp(json); })
|
||||
.onError([this](QString errorStr)
|
||||
{
|
||||
@ -781,9 +793,9 @@ void Widget::closeEvent(QCloseEvent *event)
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 展示搜索的APP信息
|
||||
* @brief 清除搜索的APP信息
|
||||
*/
|
||||
void Widget::displaySearchApp(QJsonArray array)
|
||||
void Widget::clearSearchApp()
|
||||
{
|
||||
ui->stackedWidget->setCurrentIndex(4);
|
||||
|
||||
@ -798,8 +810,14 @@ void Widget::displaySearchApp(QJsonArray array)
|
||||
}
|
||||
|
||||
main->removeItem(applist_grid);
|
||||
spinner->show();
|
||||
spinner->start();
|
||||
}
|
||||
/**
|
||||
* @brief 展示搜索的APP信息
|
||||
*/
|
||||
void Widget::displaySearchApp(QJsonArray array)
|
||||
{
|
||||
|
||||
|
||||
|
||||
for(int i = 0; i < array.size(); i++)
|
||||
{
|
||||
|
@ -82,6 +82,7 @@ private slots:
|
||||
void sltAppinfoScreenshot(QPixmap *picture, int index);
|
||||
void sltAppinfoFinish();
|
||||
|
||||
void clearSearchApp(); // 清除搜索的APP信息
|
||||
void displaySearchApp(QJsonArray array); // 展示搜索的APP信息
|
||||
void downloadIconsFinished(int arraysize); // 当前搜索列表图标是否下载完成
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user