forked from openkylin/ukui-search
Add a mainWindow switch dbus interface.
This commit is contained in:
parent
6a9ee98a84
commit
b6c9acded3
|
@ -327,6 +327,11 @@ void MainWindow::resizeHeight(int height)
|
|||
this->setFixedHeight(height);
|
||||
}
|
||||
|
||||
void MainWindow::tryHide()
|
||||
{
|
||||
this->tryHideMainwindow();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief monitorResolutionChange 监听屏幕改变
|
||||
* @param rect
|
||||
|
|
|
@ -110,6 +110,7 @@ public Q_SLOTS:
|
|||
void settingsBtnClickedSlot();
|
||||
void searchKeywordSlot(const QString&);
|
||||
void resizeHeight(int height);
|
||||
void tryHide();
|
||||
|
||||
private:
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -20,9 +20,10 @@ public:
|
|||
public Q_SLOTS:
|
||||
void showWindow();
|
||||
void searchKeyword(QString keyword);
|
||||
void mainWindowSwitch();
|
||||
|
||||
private:
|
||||
MainWindow *m_mainWindow;
|
||||
MainWindow *m_mainWindow = nullptr;
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue