Showing the changes to interface/src/scripting/DesktopScriptingInterface.cpp (1 of 7 files). Show all
Unified · Split
| @@ -52,6 +52,21 @@ static const QVariantMap DOCK_AREA { · 51 unmodified lines | ||
| 52 | 52 | { "RIGHT", DockArea::RIGHT } |
| 53 | 53 | }; |
| 54 | 54 | |
| 55 | +/**jsdoc | |
| 56 | + * The possible "relative position anchors" of an <code>InteractiveWindow</code>. Used when defining the `relativePosition` property of an `InteractiveWindow`. | |
| 57 | + * @typedef {object} InteractiveWindow.RelativePositionAnchors | |
| 58 | + * @property {InteractiveWindow.RelativePositionAnchor} TOP_LEFT - Specifies that the `relativePosition` of the `InteractiveWindow` will be offset from the top left of the Interface window. | |
| 59 | + * @property {InteractiveWindow.RelativePositionAnchor} TOP_RIGHT - Specifies that the `relativePosition` of the `InteractiveWindow` will be offset from the top right of the Interface window. | |
| 60 | + * @property {InteractiveWindow.RelativePositionAnchor} BOTTOM_RIGHT - Specifies that the `relativePosition` of the `InteractiveWindow` will be offset from the bottom right of the Interface window. | |
| 61 | + * @property {InteractiveWindow.RelativePositionAnchor} BOTTOM_LEFT - Specifies that the `relativePosition` of the `InteractiveWindow` will be offset from the bottom left of the Interface window. | |
| 62 | + */ | |
| 63 | +static const QVariantMap RELATIVE_POSITION_ANCHOR { | |
| 64 | + { "TOP_LEFT", RelativePositionAnchor::TOP_LEFT }, | |
| 65 | + { "TOP_RIGHT", RelativePositionAnchor::TOP_RIGHT }, | |
| 66 | + { "BOTTOM_RIGHT", RelativePositionAnchor::BOTTOM_RIGHT }, | |
| 67 | + { "BOTTOM_LEFT", RelativePositionAnchor::BOTTOM_LEFT } | |
| 68 | +}; | |
| 69 | + | |
| 55 | 70 | DesktopScriptingInterface::DesktopScriptingInterface(QObject* parent, bool restricted) |
| 56 | 71 | : QObject(parent), _restricted(restricted) { } |
| 57 | 72 | |
| @@ -99,6 +114,10 @@ QVariantMap DesktopScriptingInterface::getDockArea() { · 41 unmodified lines | ||
| 99 | 114 | return DOCK_AREA; |
| 100 | 115 | } |
| 101 | 116 | |
| 117 | +QVariantMap DesktopScriptingInterface::getRelativePositionAnchor() { | |
| 118 | + return RELATIVE_POSITION_ANCHOR; | |
| 119 | +} | |
| 120 | + | |
| 102 | 121 | void DesktopScriptingInterface::setHUDAlpha(float alpha) { |
| 103 | 122 | qApp->getApplicationCompositor().setAlpha(alpha); |
| 104 | 123 | } |