diff options
Diffstat (limited to 'wayland/democompositor')
-rw-r--r-- | wayland/democompositor/democompositor.qrc | 10 | ||||
-rw-r--r-- | wayland/democompositor/images/graydot.png | bin | 0 -> 211 bytes | |||
-rw-r--r-- | wayland/democompositor/images/graydots.png | bin | 0 -> 247 bytes | |||
-rw-r--r-- | wayland/democompositor/images/greendot.png | bin | 0 -> 212 bytes | |||
-rw-r--r-- | wayland/democompositor/images/greendots.png | bin | 0 -> 240 bytes | |||
-rw-r--r-- | wayland/democompositor/images/icon1.png | bin | 0 -> 1700 bytes | |||
-rw-r--r-- | wayland/democompositor/images/icon2.png | bin | 0 -> 1761 bytes | |||
-rw-r--r-- | wayland/democompositor/images/icon3.png | bin | 0 -> 1719 bytes | |||
-rw-r--r-- | wayland/democompositor/images/icon4.png | bin | 0 -> 1505 bytes | |||
-rw-r--r-- | wayland/democompositor/images/reddot.png | bin | 0 -> 219 bytes | |||
-rw-r--r-- | wayland/democompositor/main.cpp | 5 | ||||
-rw-r--r-- | wayland/democompositor/qml/Chrome.qml | 28 | ||||
-rw-r--r-- | wayland/democompositor/qml/LaunchButton.qml | 1 | ||||
-rw-r--r-- | wayland/democompositor/qml/MyButton.qml | 37 | ||||
-rw-r--r-- | wayland/democompositor/qml/Screen.qml | 195 | ||||
-rw-r--r-- | wayland/democompositor/qml/TimedButton.qml | 62 |
16 files changed, 250 insertions, 88 deletions
diff --git a/wayland/democompositor/democompositor.qrc b/wayland/democompositor/democompositor.qrc index 0e924a9..e4fcc75 100644 --- a/wayland/democompositor/democompositor.qrc +++ b/wayland/democompositor/democompositor.qrc @@ -6,5 +6,15 @@ <file>qml/MyButton.qml</file> <file>qml/LaunchButton.qml</file> <file>qml/TimedButton.qml</file> + <file>images/icon1.png</file> + <file>images/icon2.png</file> + <file>images/icon3.png</file> + <file>images/icon4.png</file> + <file>images/quit.png</file> + <file>images/greendot.png</file> + <file>images/reddot.png</file> + <file>images/graydot.png</file> + <file>images/graydots.png</file> + <file>images/greendots.png</file> </qresource> </RCC> diff --git a/wayland/democompositor/images/graydot.png b/wayland/democompositor/images/graydot.png Binary files differnew file mode 100644 index 0000000..99606e3 --- /dev/null +++ b/wayland/democompositor/images/graydot.png diff --git a/wayland/democompositor/images/graydots.png b/wayland/democompositor/images/graydots.png Binary files differnew file mode 100644 index 0000000..0f90f12 --- /dev/null +++ b/wayland/democompositor/images/graydots.png diff --git a/wayland/democompositor/images/greendot.png b/wayland/democompositor/images/greendot.png Binary files differnew file mode 100644 index 0000000..0afb08f --- /dev/null +++ b/wayland/democompositor/images/greendot.png diff --git a/wayland/democompositor/images/greendots.png b/wayland/democompositor/images/greendots.png Binary files differnew file mode 100644 index 0000000..ab1e220 --- /dev/null +++ b/wayland/democompositor/images/greendots.png diff --git a/wayland/democompositor/images/icon1.png b/wayland/democompositor/images/icon1.png Binary files differnew file mode 100644 index 0000000..08f1c0c --- /dev/null +++ b/wayland/democompositor/images/icon1.png diff --git a/wayland/democompositor/images/icon2.png b/wayland/democompositor/images/icon2.png Binary files differnew file mode 100644 index 0000000..e02dda8 --- /dev/null +++ b/wayland/democompositor/images/icon2.png diff --git a/wayland/democompositor/images/icon3.png b/wayland/democompositor/images/icon3.png Binary files differnew file mode 100644 index 0000000..9872b89 --- /dev/null +++ b/wayland/democompositor/images/icon3.png diff --git a/wayland/democompositor/images/icon4.png b/wayland/democompositor/images/icon4.png Binary files differnew file mode 100644 index 0000000..3f64825 --- /dev/null +++ b/wayland/democompositor/images/icon4.png diff --git a/wayland/democompositor/images/reddot.png b/wayland/democompositor/images/reddot.png Binary files differnew file mode 100644 index 0000000..06451be --- /dev/null +++ b/wayland/democompositor/images/reddot.png diff --git a/wayland/democompositor/main.cpp b/wayland/democompositor/main.cpp index f7a0810..c2df7a3 100644 --- a/wayland/democompositor/main.cpp +++ b/wayland/democompositor/main.cpp @@ -38,6 +38,7 @@ #include <QtCore/QDebug> #include <QtGui/QGuiApplication> +#include <QtGui/QFont> #include <QtQml/qqml.h> #include <QtQml/QQmlApplicationEngine> #include "processlauncher.h" @@ -51,8 +52,12 @@ static void registerTypes() int main(int argc, char *argv[]) { + qputenv("QT_QPA_EGLFS_HIDECURSOR", "1"); QGuiApplication app(argc, argv); + QFont f("Open Sans", 12.5); + app.setFont(f); + qputenv("QT_WAYLAND_DISABLE_WINDOWDECORATION", "1"); registerTypes(); QQmlApplicationEngine appEngine(QUrl("qrc:///qml/main.qml")); diff --git a/wayland/democompositor/qml/Chrome.qml b/wayland/democompositor/qml/Chrome.qml index 9a7132c..c07782d 100644 --- a/wayland/democompositor/qml/Chrome.qml +++ b/wayland/democompositor/qml/Chrome.qml @@ -36,12 +36,10 @@ import QtQuick 2.0 import QtWayland.Compositor 1.0 -import QtGraphicalEffects 1.0 Rectangle { - border.width: 1 - border.color: "#102080" - color: "#1337af" + border.width: 0 + color: "#1b1c1d" id: rootChrome property alias surface: surfaceItem.surface property alias valid: surfaceItem.valid @@ -51,24 +49,7 @@ Rectangle { property alias destroyAnimation : destroyAnimationImpl property int marginWidth : 5 - property int titlebarHeight : 25 - - Item { - anchors.margins: 1 - anchors.top: parent.top - anchors.left: parent.left - anchors.right: parent.right - height: titlebarHeight - LinearGradient { - anchors.fill: parent - start: Qt.point(0, 0) - end: Qt.point(0, height) - gradient: Gradient { - GradientStop { position: 0.0; color: "steelblue" } - GradientStop { position: 1.0; color: "#1337af" } - } - } - } + property int titlebarHeight : 5 function requestSize(w, h) { surfaceItem.requestSize(Qt.size(w - 2 * marginWidth, h - titlebarHeight - marginWidth)) @@ -111,7 +92,6 @@ Rectangle { } ] - WaylandQuickItem { id: surfaceItem @@ -125,7 +105,6 @@ Rectangle { property var shellSurface: ShellSurface { } - sizeFollowsSurface: false onSurfaceDestroyed: { @@ -166,7 +145,6 @@ Rectangle { y: 0 width: 0 height: 0 - //visible: false } } ] diff --git a/wayland/democompositor/qml/LaunchButton.qml b/wayland/democompositor/qml/LaunchButton.qml index a5b1fbc..cbf28e2 100644 --- a/wayland/democompositor/qml/LaunchButton.qml +++ b/wayland/democompositor/qml/LaunchButton.qml @@ -41,6 +41,7 @@ MyButton { text.text: "Uninitialized" text.elide: Text.ElideRight text.maximumLineCount: 1 + iconSize: 32 onTriggered: launcher.launch(executable) } diff --git a/wayland/democompositor/qml/MyButton.qml b/wayland/democompositor/qml/MyButton.qml index c0ac2bb..c8397a6 100644 --- a/wayland/democompositor/qml/MyButton.qml +++ b/wayland/democompositor/qml/MyButton.qml @@ -37,7 +37,6 @@ import QtQuick 2.6 Item { - //property alias color: rect.color property alias text: buttonText signal triggered() signal alternateTrigger() @@ -46,7 +45,15 @@ Item { property bool enableSlide: false property bool longPressed: false - property color buttonColor: "lightgray" + property bool sliding: enableSlide && mouser.drag.active + + property color buttonColor: "magenta" + property color pressedColor: "cyan" + property color textColor: "#ff0000" + property double iconSize: 10 + + property alias icon: iconImage + Rectangle { id: rect anchors.top: parent.top @@ -54,23 +61,36 @@ Item { anchors.left: parent.left anchors.right: parent.right - radius: 10 - color: (enableSlide && mouser.drag.active) ? "#df3f1f" : mouser.containsPress ? (longPressed ? "#3faf1f" : "steelblue") : buttonColor + color: mouser.containsPress && !mouser.drag.active ? (longPressed ? "#3faf1f" : pressedColor) : buttonColor + + Item { + id: iconRect + anchors.verticalCenter: parent.verticalCenter + anchors.left: parent.left + anchors.margins: 5 + width: iconSize + height: iconSize + Image { + anchors.centerIn: parent + id: iconImage + } + } Text { + color: textColor anchors.margins: 10 id: buttonText anchors.verticalCenter: parent.verticalCenter - anchors.left: parent.left + anchors.left: iconRect.right anchors.right: parent.right text: "[Uninitialized]" } + //opacity: (enableSlide && mouser.drag.active) ? (1.2 - (x/width)) : 1.0 } MouseArea { id: mouser anchors.fill: parent - onPressed: { if (enableSlide) { rect.anchors.left = undefined @@ -78,6 +98,8 @@ Item { } } + //onPositionChanged: console.log("Mouse move: " + mouse.x + ", " + mouse.y) + onPressAndHold: if (enableAlternate) parent.longPressed = true onReleased: { if (enableSlide && drag.active) { @@ -96,7 +118,8 @@ Item { rect.anchors.right = parent.right parent.longPressed = false } - + onEntered: console.log("Enter: " + buttonText.text) + onExited: console.log("Exit: " + buttonText.text) drag.target: rect drag.threshold: 5 drag.axis: Drag.XAxis diff --git a/wayland/democompositor/qml/Screen.qml b/wayland/democompositor/qml/Screen.qml index ca26683..2064480 100644 --- a/wayland/democompositor/qml/Screen.qml +++ b/wayland/democompositor/qml/Screen.qml @@ -47,10 +47,19 @@ WaylandOutput { property var windowList: [ ] property int hiddenWindowCount + property bool darkMode: true + + property color backgroundCol: darkMode ? "#1b1c1d" : "white" + property color pressedCol: darkMode ? "#000000" : "#eeeeee" + property color textCol: darkMode ? "#cdcdcd" : "black" + property color weakLineCol: darkMode ? "#2f3d24" : "#d6d6d6" //"#585a5c"???? + property color weakTextCol: darkMode ? "#585a5c" : "#d6d6d6" + property color strongLineCol: darkMode ? "#5caa15" : "#80c342" + window: Window { id: screen - //flags: Qt.FramelessWindowHint + flags: Qt.FramelessWindowHint property QtObject output @@ -97,7 +106,7 @@ WaylandOutput { width: sidebarWidth - color: "#6f6d75" + color: backgroundCol Column { anchors.top: parent.top @@ -105,35 +114,79 @@ WaylandOutput { anchors.right: parent.right z: 1 padding: 5 - spacing: 5 + spacing: 0 + Text { + color: weakTextCol + text: "OPEN APPS" + padding: 5 + } + + Rectangle { + height: 1 + width: sidebar.width - 10 + color: strongLineCol + } + Repeater { model: windowList - MyButton { - id: winButton - enableAlternate: true - enableSlide: true - property QtObject winItem: modelData - - height: 30 - width: sidebar.width - 10 - - buttonColor: winItem.explicitlyHidden ? "#8f8f9f" : "lightgray" - - text.maximumLineCount: 1 - text.text: modelData.shellSurface.title.length > 0 ? modelData.shellSurface.title : "Untitled" - text.elide: Text.ElideRight - onTriggered: { - winItem.toggleVisible() - } - onAlternateTrigger: { - //console.log("alt " + winItem + " : " + winItem.shellSurface.surface) - setFullscreen(winItem) + Item { + height: 36 + width: 1 + Item { + anchors.top:parent.top + anchors.left:parent.left + height: 35 + width: sidebar.width - 10 + Rectangle { + anchors.fill: parent + color: "#e41e25" + Text { + anchors.verticalCenter: parent.verticalCenter + leftPadding: 10 + text: "Terminate" + color: "white" + } + } + + MyButton { + anchors.fill: parent + id: winButton + enableAlternate: true + enableSlide: true + property QtObject winItem: modelData + + icon.source: sliding ? "qrc:/images/reddot.png" : (winItem.explicitlyHidden ? "qrc:/images/graydot.png" : "qrc:/images/greendot.png") + //icon.visible: !winItem.explicitlyHidden + + buttonColor: backgroundCol + pressedColor: pressedCol + + text.maximumLineCount: 1 + text.text: modelData.shellSurface.title.length > 0 ? modelData.shellSurface.title : "Untitled" + text.elide: Text.ElideRight + text.color: textCol + onTriggered: { + winItem.toggleVisible() + } + onAlternateTrigger: { + //console.log("alt " + winItem + " : " + winItem.shellSurface.surface) + setFullscreen(winItem) + + } + onSlideTrigger: { + //console.log("slide " + winItem + " : " + winItem.shellSurface.surface) + winItem.shellSurface.surface.client.close() + } + } + Rectangle { + anchors.top: winButton.bottom + height: 1 + width: sidebar.width - 10 + color: weakLineCol + } } - onSlideTrigger: { - //console.log("slide " + winItem + " : " + winItem.shellSurface.surface) - winItem.shellSurface.surface.client.close() - } + } } Item { @@ -143,12 +196,22 @@ WaylandOutput { MyButton { height: 50 width: sidebar.width - 10 - buttonColor: enabled ? "#6fdf7f" : "lightgray" + buttonColor: backgroundCol + pressedColor: pressedCol enabled: windowList.length > 0 && hiddenWindowCount > 0 - text.color: enabled ? "black" : "gray" + text.color: enabled ? strongLineCol : weakTextCol //"#5caa15" : "#585a5c" + //visible: enabled text.text: "Show all" + iconSize: 21 + icon.source: enabled ? "qrc:/images/greendots.png" : "qrc:/images/graydots.png" onTriggered: setFullscreen(null) } + Rectangle { + height: 1 + width: sidebar.width - 10 + color: weakLineCol + } + } @@ -157,33 +220,79 @@ WaylandOutput { anchors.right: parent.right anchors.bottom: parent.bottom padding: 5 - spacing: 5 + spacing: 0 + + Text { + padding: 5 + color: weakTextCol + text: "LAUNCHER" + } + + Rectangle { + height: 1 + width: sidebar.width - 10 + color: strongLineCol + } + Item { + height: 5 + width: 1 + } + LaunchButton { + height: 60 + width: sidebar.width - 10 + buttonColor: backgroundCol + pressedColor: pressedCol + textColor: textCol + text.text: "Clocks" + executable: "./clocks" + icon.source: "qrc:/images/icon1.png" + } LaunchButton { - height: 30 + height: 60 width: sidebar.width - 10 - text.text: "Launch wiggly" - executable: "./wiggly" + buttonColor: backgroundCol + pressedColor: pressedCol + textColor: textCol + text.text: "RSS News" + executable: "./rssnews" + icon.source: "qrc:/images/icon2.png" } LaunchButton { - height: 30 + height: 60 width: sidebar.width - 10 - text.text: "Launch analog clock" - executable: "./analogclock" + buttonColor: backgroundCol + pressedColor: pressedCol + textColor: textCol + text.text: "StoQt" + executable: "./stocqt" + icon.source: "qrc:/images/icon3.png" } LaunchButton { - height: 30 + height: 60 width: sidebar.width - 10 - text.text: "Launch digital clock" - executable: "./digitalclock" + buttonColor: backgroundCol + pressedColor: pressedCol + textColor: textCol + text.text: "Maps" + executable: "./qml_location_mapviewer" + icon.source: "qrc:/images/icon4.png" } + TimedButton { //visible: false - height: 50 + height: 60 width: sidebar.width - 10 - text: "Quit" + text: "Shut down" + + color: backgroundCol + textColor: textCol + + grooveColor: pressedCol // "black" ?? + onTriggered: quitAnimation.start() + icon.source: "qrc:/images/quit.png" } } } @@ -195,11 +304,11 @@ WaylandOutput { anchors.left: sidebar.right anchors.right: parent.right anchors.bottom: parent.bottom - enableWSCursor: true + enableWSCursor: false Rectangle { id: background anchors.fill: parent - color: "#8f8d95" + color: darkMode ? "#26282a" : "#f6f6f6" onWidthChanged: output.relayout() onHeightChanged: output.relayout() } diff --git a/wayland/democompositor/qml/TimedButton.qml b/wayland/democompositor/qml/TimedButton.qml index 2134e4d..af023c4 100644 --- a/wayland/democompositor/qml/TimedButton.qml +++ b/wayland/democompositor/qml/TimedButton.qml @@ -39,8 +39,12 @@ import QtQuick 2.6 Rectangle { id: theButton - radius: 10 - color: "lightgray" + //radius: 10 + color: "magenta" + property color grooveColor: "cyan" + property color textColor: "#777" + property alias icon: iconImage + property double iconSize: 32 property alias text: buttonText.text signal triggered() @@ -83,24 +87,56 @@ Rectangle { } ] Rectangle { - radius: 10 - color: "red" - anchors.left: parent.left + id: timeIndicator anchors.top: parent.top - anchors.bottom: parent.bottom - width: parent.width * percent / 100 - visible: percent > 0 + anchors.left: parent.left + anchors.right: parent.right + height: 10 + color: grooveColor + Rectangle { + color: "#e41e25" + anchors.left: parent.left + anchors.top: parent.top + anchors.bottom: parent.bottom + width: parent.width * percent / 100 + visible: percent > 0 + } } - Text { - id: buttonText - anchors.verticalCenter: parent.verticalCenter + Item { + anchors.top: timeIndicator.bottom + anchors.bottom: parent.bottom anchors.left: parent.left anchors.right: parent.right - anchors.margins: 10 - text: "[Uninitialized]" + Item { + id: iconRect + anchors.verticalCenter: parent.verticalCenter + anchors.left: parent.left + anchors.leftMargin: 5 + width: iconSize + height: iconSize + Image { + anchors.centerIn: parent + id: iconImage + } + } + + + Text { + id: buttonText + anchors.verticalCenter: parent.verticalCenter + anchors.left: iconRect.right + anchors.right: parent.right + anchors.leftMargin: 10 + + color: textColor + text: "[Uninitialized]" + font.bold: true + } + } + MouseArea { id: mouser anchors.fill: parent |