Represents a single zone within a layout. More...
#include <phosphor-zones/include/PhosphorZones/Zone.h>
Signals | |
| void | nameChanged () |
| void | geometryChanged () |
| void | relativeGeometryChanged () |
| void | zoneNumberChanged () |
| void | highlightColorChanged () |
| void | inactiveColorChanged () |
| void | borderColorChanged () |
| void | activeOpacityChanged () |
| void | inactiveOpacityChanged () |
| void | borderWidthChanged () |
| void | borderRadiusChanged () |
| void | highlightedChanged () |
| void | useCustomColorsChanged () |
| void | overlayDisplayModeChanged () |
| void | geometryModeChanged () |
| void | fixedGeometryChanged () |
Public Member Functions | |
| Zone (QObject *parent=nullptr) | |
| Zone (const QRectF &geometry, QObject *parent=nullptr) | |
| ~Zone () override=default | |
| Zone (const Zone &)=delete | |
| Zone & | operator= (const Zone &)=delete |
| Zone * | clone (QObject *parent=nullptr) const |
| Creates a copy of this zone with a new unique ID. | |
| void | copyPropertiesFrom (const Zone &other) |
| Copies properties from another zone (excluding ID) | |
| QUuid | id () const |
| QString | name () const |
| void | setName (const QString &name) |
| QRectF | geometry () const |
| void | setGeometry (const QRectF &geometry) |
| QRectF | relativeGeometry () const |
| void | setRelativeGeometry (const QRectF &relativeGeometry) |
| int | zoneNumber () const |
| void | setZoneNumber (int number) |
| QColor | highlightColor () const |
| void | setHighlightColor (const QColor &color) |
| QColor | inactiveColor () const |
| void | setInactiveColor (const QColor &color) |
| QColor | borderColor () const |
| void | setBorderColor (const QColor &color) |
| qreal | activeOpacity () const |
| void | setActiveOpacity (qreal opacity) |
| qreal | inactiveOpacity () const |
| void | setInactiveOpacity (qreal opacity) |
| int | borderWidth () const |
| void | setBorderWidth (int width) |
| int | borderRadius () const |
| void | setBorderRadius (int radius) |
| bool | isHighlighted () const |
| void | setHighlighted (bool highlighted) |
| bool | useCustomColors () const |
| void | setUseCustomColors (bool useCustom) |
| int | overlayDisplayMode () const |
| void | setOverlayDisplayMode (int mode) |
| ZoneGeometryMode | geometryMode () const |
| int | geometryModeInt () const |
| bool | isFixedGeometry () const |
| void | setGeometryMode (ZoneGeometryMode mode) |
| void | setGeometryModeInt (int mode) |
| QRectF | fixedGeometry () const |
| void | setFixedGeometry (const QRectF &geometry) |
| QRectF | normalizedGeometry (const QRectF &referenceGeometry) const |
| Returns normalized 0-1 coordinates regardless of geometry mode. | |
| bool | containsPoint (const QPointF &point) const |
| qreal | distanceToPoint (const QPointF &point) const |
| QRectF | calculateAbsoluteGeometry (const QRectF &screenGeometry) const |
| QRectF | applyPadding (int padding) const |
| QJsonObject | toJson (const QRectF &referenceGeometry=QRectF()) const |
Static Public Member Functions | |
| static QRectF | computeAbsoluteGeometry (ZoneGeometryMode mode, const QRectF &relativeGeometry, const QRectF &fixedGeometry, const QRectF &screenGeometry) |
| Pure helper shared between Zone::calculateAbsoluteGeometry and LayoutWorker (which runs off-thread and cannot touch QObjects). | |
| static Zone * | fromJson (const QJsonObject &json, QObject *parent=nullptr) |
Represents a single zone within a layout.
A zone is a rectangular area on the screen where windows can be snapped. Zones support custom colors, names, and keyboard shortcuts for ricer-friendly customization.
Note: Zone inherits from QObject and follows Qt's object model. QObjects should NOT be copied - use clone() to create duplicates.
|
explicit |
|
explicit |
|
overridedefault |
|
delete |
|
inline |
|
signal |
| QRectF PhosphorZones::Zone::applyPadding | ( | int | padding | ) | const |
|
inline |
|
signal |
|
inline |
|
signal |
|
inline |
|
signal |
| QRectF PhosphorZones::Zone::calculateAbsoluteGeometry | ( | const QRectF & | screenGeometry | ) | const |
| Zone * PhosphorZones::Zone::clone | ( | QObject * | parent = nullptr | ) | const |
Creates a copy of this zone with a new unique ID.
| parent | Parent object for the new zone |
|
static |
Pure helper shared between Zone::calculateAbsoluteGeometry and LayoutWorker (which runs off-thread and cannot touch QObjects).
Fixed mode: pixel coords relative to screen origin. Relative mode: 0..1 coords multiplied by screen dimensions.
| bool PhosphorZones::Zone::containsPoint | ( | const QPointF & | point | ) | const |
| void PhosphorZones::Zone::copyPropertiesFrom | ( | const Zone & | other | ) |
Copies properties from another zone (excluding ID)
| other | Source zone to copy from |
| qreal PhosphorZones::Zone::distanceToPoint | ( | const QPointF & | point | ) | const |
|
inline |
|
signal |
|
static |
|
inline |
|
signal |
|
inline |
|
signal |
|
inline |
|
inline |
|
signal |
|
signal |
|
inline |
|
inline |
|
signal |
|
inline |
|
signal |
|
inline |
|
inline |
|
inline |
|
signal |
| QRectF PhosphorZones::Zone::normalizedGeometry | ( | const QRectF & | referenceGeometry | ) | const |
Returns normalized 0-1 coordinates regardless of geometry mode.
| referenceGeometry | The screen geometry to normalize against |
For Relative mode: returns relativeGeometry() directly. For Fixed mode: converts fixedGeometry pixel coords to 0-1 relative to referenceGeometry dimensions.
|
inline |
|
signal |
|
inline |
|
signal |
| void PhosphorZones::Zone::setActiveOpacity | ( | qreal | opacity | ) |
| void PhosphorZones::Zone::setBorderColor | ( | const QColor & | color | ) |
| void PhosphorZones::Zone::setBorderRadius | ( | int | radius | ) |
| void PhosphorZones::Zone::setBorderWidth | ( | int | width | ) |
| void PhosphorZones::Zone::setFixedGeometry | ( | const QRectF & | geometry | ) |
| void PhosphorZones::Zone::setGeometry | ( | const QRectF & | geometry | ) |
| void PhosphorZones::Zone::setGeometryMode | ( | ZoneGeometryMode | mode | ) |
| void PhosphorZones::Zone::setGeometryModeInt | ( | int | mode | ) |
| void PhosphorZones::Zone::setHighlightColor | ( | const QColor & | color | ) |
| void PhosphorZones::Zone::setHighlighted | ( | bool | highlighted | ) |
| void PhosphorZones::Zone::setInactiveColor | ( | const QColor & | color | ) |
| void PhosphorZones::Zone::setInactiveOpacity | ( | qreal | opacity | ) |
| void PhosphorZones::Zone::setName | ( | const QString & | name | ) |
| void PhosphorZones::Zone::setOverlayDisplayMode | ( | int | mode | ) |
| void PhosphorZones::Zone::setRelativeGeometry | ( | const QRectF & | relativeGeometry | ) |
| void PhosphorZones::Zone::setUseCustomColors | ( | bool | useCustom | ) |
| void PhosphorZones::Zone::setZoneNumber | ( | int | number | ) |
| QJsonObject PhosphorZones::Zone::toJson | ( | const QRectF & | referenceGeometry = QRectF() | ) | const |
|
inline |
|
signal |
|
inline |
|
signal |