forked from openkylin/ukui-search
Merge branch '0720-newfrontend' into 'new-fronted'
Update UI. See merge request kylin-desktop/ukui-search!68
This commit is contained in:
commit
85f032637c
|
@ -68,6 +68,7 @@ SearchLineEdit::SearchLineEdit(QWidget *parent) : QLineEdit(parent) {
|
|||
if(text == "") {
|
||||
m_isEmpty = true;
|
||||
m_timer->stop();
|
||||
Q_EMIT this->requestSearchKeyword(text);
|
||||
return;
|
||||
}
|
||||
m_timer->start(0.1 * 1000);
|
||||
|
|
|
@ -99,8 +99,6 @@ void ResultArea::initUi()
|
|||
void ResultArea::setupConnectionsForWidget(ResultWidget *widget)
|
||||
{
|
||||
connect(this, &ResultArea::startSearch, widget, &ResultWidget::startSearch);
|
||||
connect(this, &ResultArea::startSearch, [=](){
|
||||
});
|
||||
|
||||
connect(this, &ResultArea::stopSearch, widget, &ResultWidget::stopSearch);
|
||||
connect(widget, &ResultWidget::sizeChanged, this, &ResultArea::onWidgetSizeChanged);
|
||||
|
|
|
@ -89,7 +89,7 @@ MainWindow::~MainWindow() {
|
|||
if(m_settingsWidget) {
|
||||
delete m_settingsWidget;
|
||||
m_settingsWidget = NULL;
|
||||
}
|
||||
|
||||
#endif
|
||||
if(m_askDialog) {
|
||||
delete m_askDialog;
|
||||
|
@ -109,22 +109,25 @@ MainWindow::~MainWindow() {
|
|||
* @brief initUi 初始化主界面主要ui控件
|
||||
*/
|
||||
void MainWindow::initUi() {
|
||||
this->setFixedSize(WINDOW_WIDTH, WINDOW_HEIGHT);
|
||||
this->setFixedSize(WINDOW_WIDTH, 68);
|
||||
// this->setStyleSheet("QMainWindow{border:2px solid red;}");
|
||||
|
||||
m_widget = new QWidget(this);
|
||||
// m_widget = new QWidget(this);
|
||||
|
||||
this->setCentralWidget(m_widget);
|
||||
m_widget->setFixedSize(this->size());
|
||||
// this->setCentralWidget(m_widget);
|
||||
// m_widget->setFixedSize(this->size());
|
||||
// QVBoxLayout * mainlayout = new QVBoxLayout(m_frame);
|
||||
// mainlayout->setContentsMargins(MAIN_MARGINS);
|
||||
// m_frame->setLayout(mainlayout);
|
||||
|
||||
// m_stackedWidget = new StackedWidget(m_frame);//内容栏
|
||||
m_searchBarWidget = new SeachBarWidget(m_widget);
|
||||
m_searchBarWidget->move(m_widget->rect().topLeft());
|
||||
m_searchBarWidget = new SeachBarWidget(this);
|
||||
m_searchBarWidget->move(this->rect().topLeft());
|
||||
m_searchBarWidget->show();
|
||||
m_searchResultPage = new SearchResultPage(m_widget);
|
||||
m_searchResultPage = new SearchResultPage(this);
|
||||
m_searchResultPage->hide();
|
||||
m_searchResultPage->move(0, 58);
|
||||
// m_searchResultPage->show();
|
||||
// m_searchWidget = new SeachBarWidget(this);
|
||||
// m_searchLayout = new SearchBarHLayout(this);
|
||||
// m_searchWidget->setLayout(m_searchLayout);
|
||||
|
@ -290,6 +293,9 @@ void MainWindow::searchKeywordSlot(const QString &keyword)
|
|||
// m_stackedWidget->setPage(int(StackedPage::HomePage));
|
||||
m_askTimer->stop();
|
||||
Q_EMIT m_searchResultPage->stopSearch();
|
||||
m_searchResultPage->hide();
|
||||
this->resizeHeight(68);
|
||||
|
||||
} else {
|
||||
// m_stackedWidget->setPage(int(StackedPage::SearchPage));
|
||||
QTimer::singleShot(10, this, [ = ]() {
|
||||
|
@ -297,11 +303,20 @@ void MainWindow::searchKeywordSlot(const QString &keyword)
|
|||
if(GlobalSettings::getInstance()->getValue(ENABLE_CREATE_INDEX_ASK_DIALOG).toString() != "false" && !m_currentSearchAsked && FileUtils::searchMethod == FileUtils::SearchMethod::DIRECTSEARCH)
|
||||
m_askTimer->start();
|
||||
Q_EMIT m_searchResultPage->startSearch(keyword);
|
||||
this->resizeHeight(610);
|
||||
|
||||
m_searchResultPage->move(0, 58);
|
||||
m_searchResultPage->show();
|
||||
});
|
||||
}
|
||||
m_researchTimer->stop(); //如果搜索内容发生改变,则停止建索引后重新搜索的倒计时
|
||||
}
|
||||
|
||||
void MainWindow::resizeHeight(int height)
|
||||
{
|
||||
this->setFixedHeight(height);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief monitorResolutionChange 监听屏幕改变
|
||||
* @param rect
|
||||
|
|
|
@ -105,6 +105,7 @@ public Q_SLOTS:
|
|||
void trayIconActivatedSlot(QSystemTrayIcon::ActivationReason reason);
|
||||
void settingsBtnClickedSlot();
|
||||
void searchKeywordSlot(const QString&);
|
||||
void resizeHeight(int height);
|
||||
|
||||
private:
|
||||
|
||||
|
|
|
@ -80,7 +80,6 @@ void ResultWidget::initConnections()
|
|||
{
|
||||
connect(this, &ResultWidget::startSearch, m_resultView, &ResultView::startSearch);
|
||||
connect(this, &ResultWidget::startSearch, this, [ = ]() {
|
||||
qDebug() << "==========start search!";
|
||||
m_showMoreLabel->resetLabel();
|
||||
});
|
||||
connect(this, &ResultWidget::stopSearch, m_resultView, &ResultView::stopSearch);
|
||||
|
|
Loading…
Reference in New Issue