Merge branch '0705ukss' into 'ukss-dev'

Add a mainWindow switch dbus interface.

See merge request kylin-desktop/ukui-search!345
This commit is contained in:
PengfeiZhang 2022-07-06 07:11:39 +00:00
commit e4a0e257db
4 changed files with 17 additions and 1 deletions

View File

@ -327,6 +327,11 @@ void MainWindow::resizeHeight(int height)
this->setFixedHeight(height);
}
void MainWindow::tryHide()
{
this->tryHideMainwindow();
}
/**
* @brief monitorResolutionChange
* @param rect

View File

@ -110,6 +110,7 @@ public Q_SLOTS:
void settingsBtnClickedSlot();
void searchKeywordSlot(const QString&);
void resizeHeight(int height);
void tryHide();
private:

View File

@ -12,6 +12,15 @@ void UkuiSearchDbusServices::searchKeyword(QString keyword)
m_mainWindow->setText(keyword);
}
void UkuiSearchDbusServices::mainWindowSwitch()
{
if (m_mainWindow->isActiveWindow()) {
m_mainWindow->tryHide();
} else {
m_mainWindow->bootOptionsFilter("-s");
}
}
UkuiSearchDbusServices::UkuiSearchDbusServices(MainWindow *m)
{
m_mainWindow = m;

View File

@ -20,9 +20,10 @@ public:
public Q_SLOTS:
void showWindow();
void searchKeyword(QString keyword);
void mainWindowSwitch();
private:
MainWindow *m_mainWindow;
MainWindow *m_mainWindow = nullptr;
};
}