-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add layershell qt call and qml plugin log: ass layershell wrap Issue: linuxdeepin/developer-center#5808
- Loading branch information
Showing
20 changed files
with
1,270 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,5 +5,6 @@ | |
build*/ | ||
.vscode/settings.json | ||
*.user | ||
.cache/ | ||
|
||
*/utils/dbus/xml2cpp/*_interface.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
MIT "Expat" License | ||
|
||
Copyright (c) 2017 Drew DeVault | ||
|
||
Permission to use, copy, modify, distribute, and sell this | ||
software and its documentation for any purpose is hereby granted | ||
without fee, provided that the above copyright notice appear in | ||
all copies and that both that copyright notice and this permission | ||
notice appear in supporting documentation, and that the name of | ||
the copyright holders not be used in advertising or publicity | ||
pertaining to distribution of the software without specific, | ||
written prior permission. The copyright holders make no | ||
representations about the suitability of this software for any | ||
purpose. It is provided "as is" without express or implied | ||
warranty. | ||
|
||
THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS | ||
SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND | ||
FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY | ||
SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN | ||
AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, | ||
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF | ||
THIS SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. | ||
# | ||
# SPDX-License-Identifier: GPL-3.0-or-later | ||
|
||
add_executable(layershell-example main.cpp qml.qrc) | ||
target_link_libraries(layershell-example PRIVATE Qt::Gui Qt::Qml) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. | ||
// | ||
// SPDX-License-Identifier: GPL-3.0-or-later | ||
|
||
#include <QGuiApplication> | ||
#include <QtQml/QQmlApplicationEngine> | ||
|
||
int main(int argc, char* argv[]) | ||
{ | ||
QGuiApplication app(argc, argv); | ||
QQmlApplicationEngine engine; | ||
engine.addImportPath(QCoreApplication::applicationDirPath() + "/../../plugins/"); | ||
engine.load("qrc:///org/deepin/layershell/main.qml"); | ||
return app.exec(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,182 @@ | ||
// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. | ||
// | ||
// SPDX-License-Identifier: GPL-3.0-or-later | ||
|
||
import QtQuick 2.15 | ||
import QtQuick.Controls | ||
import QtQuick.Layouts | ||
import org.deepin.ds | ||
|
||
Window { | ||
id: root | ||
height: 150 | ||
width: 780 | ||
visible: true | ||
DLayerShellWindow.anchors: DLayerShellWindow.AnchorLeft | ||
DLayerShellWindow.layer: DLayerShellWindow.LayerTop | ||
DLayerShellWindow.exclusionZone: excludezone.value | ||
DLayerShellWindow.keyboardInteractivity: DLayerShellWindow.KeyboardInteractivityExclusive | ||
DLayerShellWindow.leftMargin: left.value | ||
DLayerShellWindow.rightMargin: right.value | ||
DLayerShellWindow.topMargin: top.value | ||
DLayerShellWindow.bottomMargin: bottom.value | ||
|
||
Column { | ||
id: comboBox | ||
ComboBox { | ||
id: layerCombox | ||
width: 100 | ||
textRole: "text" | ||
anchors.left: parent.left | ||
Component.onCompleted: currentIndex = root.DLayerShellWindow.layer | ||
onActivated: { | ||
root.DLayerShellWindow.layer = model.get(layerCombox.currentIndex).layer | ||
} | ||
model: ListModel { | ||
ListElement { text: "LayerBackground"; layer: DLayerShellWindow.LayerBackground } | ||
ListElement { text: "LayerButtom"; layer: DLayerShellWindow.LayerButtom } | ||
ListElement { text: "LayerTop"; layer: DLayerShellWindow.LayerTop } | ||
ListElement { text: "LayerOverlay"; layer: DLayerShellWindow.LayerOverlay } | ||
} | ||
} | ||
|
||
ComboBox { | ||
id: keyboardInteractivityCombox | ||
width: 200 | ||
textRole: "text" | ||
anchors.left: parent.left | ||
Component.onCompleted: currentIndex = root.DLayerShellWindow.keyboardInteractivity | ||
onActivated: { | ||
root.DLayerShellWindow.keyboardInteractivity = model.get(keyboardInteractivityCombox.currentIndex).keyboardInteractivity | ||
} | ||
model: ListModel { | ||
ListElement { text: "KeyboardInteractivityNone"; keyboardInteractivity: DLayerShellWindow.KeyboardInteractivityNone } | ||
ListElement { text: "KeyboardInteractivityExclusive"; keyboardInteractivity: DLayerShellWindow.KeyboardInteractivityExclusive } | ||
ListElement { text: "KeyboardInteractivityOnDemand"; keyboardInteractivity: DLayerShellWindow.KeyboardInteractivityOnDemand } | ||
} | ||
} | ||
} | ||
|
||
Item { | ||
id: steerwheel | ||
anchors.left: comboBox.right | ||
anchors.leftMargin: 20 | ||
width: 100 | ||
Column { | ||
spacing: 20 | ||
Button { | ||
id: buttonTop | ||
text: "Top" | ||
width: 40 | ||
anchors.leftMargin: 30 | ||
anchors.left: parent.left | ||
checkable: true | ||
checked: root.DLayerShellWindow.anchors & DLayerShellWindow.AnchorTop | ||
onCheckedChanged: { | ||
if (checked) | ||
root.DLayerShellWindow.anchors = root.DLayerShellWindow.anchors | DLayerShellWindow.AnchorTop | ||
else | ||
root.DLayerShellWindow.anchors = root.DLayerShellWindow.anchors ^ DLayerShellWindow.AnchorTop | ||
} | ||
} | ||
Row { | ||
spacing: 20 | ||
Button { | ||
id: buttonLeft | ||
text: "Left" | ||
width: 40 | ||
checkable: true | ||
checked: root.DLayerShellWindow.anchors & DLayerShellWindow.AnchorLeft | ||
onCheckedChanged: { | ||
if (checked) | ||
root.DLayerShellWindow.anchors = root.DLayerShellWindow.anchors | DLayerShellWindow.AnchorLeft | ||
else | ||
root.DLayerShellWindow.anchors = root.DLayerShellWindow.anchors ^ DLayerShellWindow.AnchorLeft | ||
} | ||
} | ||
Button { | ||
id: buttonRight | ||
text: "Right" | ||
width: 40 | ||
checkable: true | ||
checked: root.DLayerShellWindow.anchors & DLayerShellWindow.AnchorRight | ||
onCheckedChanged: { | ||
if (checked) | ||
root.DLayerShellWindow.anchors = root.DLayerShellWindow.anchors | DLayerShellWindow.AnchorRight | ||
else | ||
root.DLayerShellWindow.anchors = root.DLayerShellWindow.anchors ^ DLayerShellWindow.AnchorRight | ||
} | ||
} | ||
} | ||
Button { | ||
id: buttonBottom | ||
text: "Buttom" | ||
width: 40 | ||
anchors.leftMargin: 30 | ||
anchors.left: parent.left | ||
checkable: true | ||
checked: root.DLayerShellWindow.anchors & DLayerShellWindow.AnchorBottom | ||
onCheckedChanged: { | ||
if (checked) | ||
root.DLayerShellWindow.anchors = root.DLayerShellWindow.anchors | DLayerShellWindow.AnchorBottom | ||
else | ||
root.DLayerShellWindow.anchors = root.DLayerShellWindow.anchors ^ DLayerShellWindow.AnchorBottom | ||
} | ||
} | ||
} | ||
} | ||
|
||
GridLayout { | ||
id: input | ||
anchors.left: steerwheel.right | ||
anchors.leftMargin: 20 | ||
columns: 4 | ||
Text { | ||
text: "LeftMargin: " | ||
} | ||
SpinBox { | ||
id: left | ||
stepSize: 10 | ||
editable: true | ||
value: root.DLayerShellWindow.leftMargin | ||
} | ||
Text { | ||
text: "TopMargin: " | ||
} | ||
SpinBox { | ||
id: top | ||
stepSize: 10 | ||
editable: true | ||
value: root.DLayerShellWindow.topMargin | ||
} | ||
Text { | ||
text: "RightMargin: " | ||
} | ||
SpinBox { | ||
id: right | ||
stepSize: 10 | ||
editable: true | ||
value: root.DLayerShellWindow.rightMargin | ||
} | ||
Text { | ||
text: "BottomMargin: " | ||
} | ||
SpinBox { | ||
id: bottom | ||
stepSize: 10 | ||
editable: true | ||
value: root.DLayerShellWindow.bottomMargin | ||
} | ||
Text { | ||
text: "excludezone: " | ||
} | ||
|
||
SpinBox { | ||
id: excludezone | ||
editable: true | ||
from: -1 | ||
to: 1080 | ||
value: -1 | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<RCC> | ||
<qresource prefix="/org/deepin/layershell/"> | ||
<file>main.qml</file> | ||
</qresource> | ||
</RCC> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.