Add visibility interface
This commit is contained in:
parent
2065a08b17
commit
616e8ec83f
4 changed files with 17 additions and 0 deletions
|
@ -199,6 +199,10 @@ bool ApplicationModel::openNewInstance(const QString &appId)
|
|||
return false;
|
||||
|
||||
QProcess process;
|
||||
|
||||
if (appId == "cutefish-launcher")
|
||||
process.setArguments(QStringList() << "--show");
|
||||
|
||||
if (!item->exec.isEmpty()) {
|
||||
QStringList args = item->exec.split(" ");
|
||||
process.setProgram(args.first());
|
||||
|
|
|
@ -123,6 +123,11 @@ int MainWindow::direction() const
|
|||
return DockSettings::self()->direction();
|
||||
}
|
||||
|
||||
int MainWindow::visibility() const
|
||||
{
|
||||
return DockSettings::self()->visibility();
|
||||
}
|
||||
|
||||
void MainWindow::setDirection(int direction)
|
||||
{
|
||||
DockSettings::self()->setDirection(static_cast<DockSettings::Direction>(direction));
|
||||
|
@ -351,6 +356,8 @@ void MainWindow::onIconSizeChanged()
|
|||
|
||||
void MainWindow::onVisibilityChanged()
|
||||
{
|
||||
emit visibilityChanged();
|
||||
|
||||
if (m_activity->launchPad()) {
|
||||
m_hideTimer->stop();
|
||||
clearViewStruts();
|
||||
|
|
|
@ -34,6 +34,7 @@ class MainWindow : public QQuickView
|
|||
Q_OBJECT
|
||||
Q_PROPERTY(QRect primaryGeometry READ primaryGeometry NOTIFY primaryGeometryChanged)
|
||||
Q_PROPERTY(int direction READ direction NOTIFY directionChanged)
|
||||
Q_PROPERTY(int visibility READ visibility NOTIFY visibilityChanged)
|
||||
|
||||
public:
|
||||
explicit MainWindow(QQuickView *parent = nullptr);
|
||||
|
@ -47,6 +48,8 @@ public:
|
|||
QRect primaryGeometry() const;
|
||||
int direction() const;
|
||||
|
||||
int visibility() const;
|
||||
|
||||
void setDirection(int direction);
|
||||
void setIconSize(int iconSize);
|
||||
void setVisibility(int visibility);
|
||||
|
@ -58,6 +61,7 @@ signals:
|
|||
void iconSizeChanged();
|
||||
void directionChanged();
|
||||
void primaryGeometryChanged();
|
||||
void visibilityChanged();
|
||||
|
||||
private:
|
||||
QRect windowRect() const;
|
||||
|
|
|
@ -17,8 +17,10 @@
|
|||
</property>
|
||||
|
||||
<property name="direction" type="i" access="read"></property>
|
||||
<property name="visibility" type="i" access="read"></property>
|
||||
|
||||
<signal name="primaryGeometryChanged"></signal>
|
||||
<signal name="directionChanged"></signal>
|
||||
<signal name="visibilityChanged"></signal>
|
||||
</interface>
|
||||
</node>
|
||||
|
|
Loading…
Reference in a new issue