docs(layer): improve WlrLayershell documentation

This commit is contained in:
outfoxxed 2024-02-29 00:54:18 -08:00
parent 42ea70e04c
commit d06b67107b
Signed by untrusted user: outfoxxed
GPG key ID: 4C88A185FB89301E
2 changed files with 29 additions and 3 deletions

View file

@ -11,6 +11,32 @@
#include "../core/proxywindow.hpp" #include "../core/proxywindow.hpp"
#include "wlr_layershell/window.hpp" #include "wlr_layershell/window.hpp"
///! Wlroots layershell window
/// Decorationless window that can be attached to the screen edges using the [zwlr_layer_shell_v1] protocol.
///
/// #### Attached property
/// `WlrLayershell` works as an attached property of [PanelWindow] which you should use instead if you can,
/// as it is platform independent.
/// ```qml
/// PanelWindow {
/// // When PanelWindow is backed with WlrLayershell this will work
/// WlrLayershell.layer: Layer.Bottom
/// }
/// ```
///
/// To maintain platform compatibility you can dynamically set layershell specific properties.
/// ```qml
/// PanelWindow {
/// Component.onCompleted: {
/// if (this.WlrLayershell != null) {
/// this.WlrLayershell.layer = Layer.Bottom;
/// }
/// }
/// }
/// ```
///
/// [zwlr_layer_shell_v1]: https://wayland.app/protocols/wlr-layer-shell-unstable-v1
/// [PanelWindow]: ../../quickshell/panelwindow
class WlrLayershell: public ProxyWindowBase { class WlrLayershell: public ProxyWindowBase {
QSDOC_BASECLASS(PanelWindowInterface); QSDOC_BASECLASS(PanelWindowInterface);
// clang-format off // clang-format off

View file

@ -8,11 +8,13 @@
#include "../../core/panelinterface.hpp" #include "../../core/panelinterface.hpp"
///! WlrLayershell layer
namespace Layer { // NOLINT namespace Layer { // NOLINT
Q_NAMESPACE; Q_NAMESPACE;
QML_ELEMENT; QML_ELEMENT;
enum Enum { enum Enum {
/// Below bottom
Background = 0, Background = 0,
/// Above background, usually below windows /// Above background, usually below windows
Bottom = 1, Bottom = 1,
@ -26,9 +28,7 @@ Q_ENUM_NS(Enum);
} // namespace Layer } // namespace Layer
/// Type of keyboard focus that will be accepted by a [ShellWindow] ///! WlrLayershell keyboard focus mode
///
/// [ShellWindow]: ../shellwindow
namespace KeyboardFocus { // NOLINT namespace KeyboardFocus { // NOLINT
Q_NAMESPACE; Q_NAMESPACE;
QML_ELEMENT; QML_ELEMENT;