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 "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 {
QSDOC_BASECLASS(PanelWindowInterface);
// clang-format off

View File

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