Add a mainWindow switch dbus interface.

This commit is contained in:
JunjieBai 2022-07-05 12:47:16 +08:00
parent 6a9ee98a84
commit b6c9acded3
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;
};
}