Add interface for launcher
This commit is contained in:
parent
0dbc91c371
commit
d9a5064ea6
3 changed files with 43 additions and 7 deletions
|
@ -113,6 +113,16 @@ bool MainWindow::pinned(const QString &desktop)
|
||||||
return m_appModel->isDesktopPinned(desktop);
|
return m_appModel->isDesktopPinned(desktop);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QRect MainWindow::primaryGeometry() const
|
||||||
|
{
|
||||||
|
return geometry();
|
||||||
|
}
|
||||||
|
|
||||||
|
int MainWindow::direction() const
|
||||||
|
{
|
||||||
|
return DockSettings::self()->direction();
|
||||||
|
}
|
||||||
|
|
||||||
void MainWindow::setDirection(int direction)
|
void MainWindow::setDirection(int direction)
|
||||||
{
|
{
|
||||||
DockSettings::self()->setDirection(static_cast<DockSettings::Direction>(direction));
|
DockSettings::self()->setDirection(static_cast<DockSettings::Direction>(direction));
|
||||||
|
@ -337,7 +347,7 @@ void MainWindow::onPositionChanged()
|
||||||
updateViewStruts();
|
updateViewStruts();
|
||||||
}
|
}
|
||||||
|
|
||||||
emit positionChanged();
|
emit directionChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::onIconSizeChanged()
|
void MainWindow::onIconSizeChanged()
|
||||||
|
@ -350,10 +360,16 @@ void MainWindow::onIconSizeChanged()
|
||||||
|
|
||||||
void MainWindow::onVisibilityChanged()
|
void MainWindow::onVisibilityChanged()
|
||||||
{
|
{
|
||||||
|
if (m_activity->launchPad()) {
|
||||||
|
m_hideTimer->stop();
|
||||||
|
clearViewStruts();
|
||||||
|
setVisible(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Always show
|
// Always show
|
||||||
// Must remain displayed when launchpad is opened.
|
// Must remain displayed when launchpad is opened.
|
||||||
if (m_settings->visibility() == DockSettings::AlwaysShow
|
if (m_settings->visibility() == DockSettings::AlwaysShow) {
|
||||||
|| m_activity->launchPad()) {
|
|
||||||
m_hideTimer->stop();
|
m_hideTimer->stop();
|
||||||
|
|
||||||
setGeometry(windowRect());
|
setGeometry(windowRect());
|
||||||
|
@ -366,9 +382,6 @@ void MainWindow::onVisibilityChanged()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_activity->launchPad())
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (m_settings->visibility() == DockSettings::IntellHide) {
|
if (m_settings->visibility() == DockSettings::IntellHide) {
|
||||||
clearViewStruts();
|
clearViewStruts();
|
||||||
setGeometry(windowRect());
|
setGeometry(windowRect());
|
||||||
|
@ -434,3 +447,10 @@ bool MainWindow::eventFilter(QObject *obj, QEvent *e)
|
||||||
|
|
||||||
return QQuickView::eventFilter(obj, e);
|
return QQuickView::eventFilter(obj, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindow::resizeEvent(QResizeEvent *e)
|
||||||
|
{
|
||||||
|
emit primaryGeometryChanged();
|
||||||
|
|
||||||
|
QQuickView::resizeEvent(e);
|
||||||
|
}
|
||||||
|
|
|
@ -32,6 +32,8 @@
|
||||||
class MainWindow : public QQuickView
|
class MainWindow : public QQuickView
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
Q_PROPERTY(QRect primaryGeometry READ primaryGeometry NOTIFY primaryGeometryChanged)
|
||||||
|
Q_PROPERTY(int direction READ direction NOTIFY directionChanged)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit MainWindow(QQuickView *parent = nullptr);
|
explicit MainWindow(QQuickView *parent = nullptr);
|
||||||
|
@ -42,6 +44,9 @@ public:
|
||||||
void remove(const QString &desktop);
|
void remove(const QString &desktop);
|
||||||
bool pinned(const QString &desktop);
|
bool pinned(const QString &desktop);
|
||||||
|
|
||||||
|
QRect primaryGeometry() const;
|
||||||
|
int direction() const;
|
||||||
|
|
||||||
void setDirection(int direction);
|
void setDirection(int direction);
|
||||||
void setIconSize(int iconSize);
|
void setIconSize(int iconSize);
|
||||||
void setVisibility(int visibility);
|
void setVisibility(int visibility);
|
||||||
|
@ -51,7 +56,8 @@ public:
|
||||||
signals:
|
signals:
|
||||||
void resizingFished();
|
void resizingFished();
|
||||||
void iconSizeChanged();
|
void iconSizeChanged();
|
||||||
void positionChanged();
|
void directionChanged();
|
||||||
|
void primaryGeometryChanged();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QRect windowRect() const;
|
QRect windowRect() const;
|
||||||
|
@ -74,6 +80,7 @@ private slots:
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool eventFilter(QObject *obj, QEvent *e) override;
|
bool eventFilter(QObject *obj, QEvent *e) override;
|
||||||
|
void resizeEvent(QResizeEvent *) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Activity *m_activity;
|
Activity *m_activity;
|
||||||
|
|
|
@ -11,5 +11,14 @@
|
||||||
<method name="setDirection"><arg name="direction" type="i" direction="in"/></method>
|
<method name="setDirection"><arg name="direction" type="i" direction="in"/></method>
|
||||||
<method name="setIconSize"><arg name="iconSize" type="i" direction="in"/></method>
|
<method name="setIconSize"><arg name="iconSize" type="i" direction="in"/></method>
|
||||||
<method name="setVisibility"><arg name="visibility" type="i" direction="in"/></method>
|
<method name="setVisibility"><arg name="visibility" type="i" direction="in"/></method>
|
||||||
|
|
||||||
|
<property name="primaryGeometry" type="(iiii)" access="read">
|
||||||
|
<annotation name="org.qtproject.QtDBus.QtTypeName" value="QRect"/>
|
||||||
|
</property>
|
||||||
|
|
||||||
|
<property name="direction" type="i" access="read"></property>
|
||||||
|
|
||||||
|
<signal name="primaryGeometryChanged"></signal>
|
||||||
|
<signal name="directionChanged"></signal>
|
||||||
</interface>
|
</interface>
|
||||||
</node>
|
</node>
|
||||||
|
|
Loading…
Reference in a new issue