frame
AYFrame
Bases: StyleMixin, QFrame
Source code in client/ayon_core/ui/components/frame.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 | |
set_hovered(hovered)
Mark this frame as hovered via the row_state property.
Companion to :meth:set_selected: driven explicitly (see :class:RowHoverTracker) instead of relying on underMouse(), since an interactive QPushButton child sitting on top of the frame doesn't reliably cascade hover state to it.
Source code in client/ayon_core/ui/components/frame.py
84 85 86 87 88 89 90 91 92 93 94 95 | |
set_selected(selected)
Mark this frame as selected via the row_state property.
The frame drawer reads this to pick the current variant's selected style block (background, border, ...), so a whole frame can carry a highlight the way a single-row control would, instead of only an inner button doing so.
Source code in client/ayon_core/ui/components/frame.py
72 73 74 75 76 77 78 79 80 81 82 | |
HoverReveal
Bases: QObject
Event filter that shows widget only while its row is hovered.
Give the revealed widget a size policy with setRetainSizeWhenHidden(True) so the row keeps its width and nothing shifts as the widget appears.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
widget | QWidget | The widget to reveal/hide. | required |
parent | QObject | The watched widget (also used as the filter's parent). | required |
force_visible | Callable[[], bool] | None | Optional callable; when it returns | None |
Source code in client/ayon_core/ui/components/frame.py
98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 | |
RowHoverTracker
Bases: QObject
Keeps an :class:AYFrame hover-highlighted via set_hovered.
Install on the frame itself and on each interactive child (buttons) it contains, via :meth:watch. A QPushButton child can intercept mouse tracking in a way that prevents Qt's own Enter/Leave events from reliably reaching an ancestor frame, so this tracks hover directly instead of depending on that propagation.
On every Leave from any watched widget, it re-checks the actual cursor position against the frame's own rect rather than assuming "left a child" means "left the frame" — moving from one child to a sibling (or to the frame's own background) fires a Leave too, and naively clearing hover on that would flicker or stick off.
Source code in client/ayon_core/ui/components/frame.py
135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 | |