#3451: a width-capped applet (e.g. Antenna Genius, max 260) should have its cap lifted while floating so it fills the window instead of hugging the left edge, and have the cap restored when it docks back into the panel strip.
| 140 | // cap lifted while floating so it fills the window instead of hugging the left |
| 141 | // edge, and have the cap restored when it docks back into the panel strip. |
| 142 | void testFloatingWidthPolicy() |
| 143 | { |
| 144 | ContainerWidget c("id", "T"); |
| 145 | auto* body = new QLabel("payload"); |
| 146 | body->setMaximumWidth(260); // mimic a width-capped applet |
| 147 | c.setContent(body); |
| 148 | |
| 149 | report("docked content keeps its width cap", |
| 150 | body->maximumWidth() == 260); |
| 151 | |
| 152 | FloatingContainerWindow win; |
| 153 | win.takeContainer(&c); |
| 154 | report("floating content cap is lifted to fill the window", |
| 155 | body->maximumWidth() == QWIDGETSIZE_MAX); |
| 156 | |
| 157 | win.releaseContainer(); |
| 158 | report("docked-again content cap is restored", |
| 159 | body->maximumWidth() == 260); |
| 160 | |
| 161 | // An uncapped applet (e.g. the Amplifier) stays uncapped throughout. |
| 162 | ContainerWidget c2("id2", "T2"); |
| 163 | auto* body2 = new QLabel("uncapped"); |
| 164 | c2.setContent(body2); |
| 165 | FloatingContainerWindow win2; |
| 166 | win2.takeContainer(&c2); |
| 167 | report("uncapped content stays uncapped while floating", |
| 168 | body2->maximumWidth() == QWIDGETSIZE_MAX); |
| 169 | win2.releaseContainer(); |
| 170 | report("uncapped content stays uncapped after docking", |
| 171 | body2->maximumWidth() == QWIDGETSIZE_MAX); |
| 172 | } |
| 173 | |
| 174 | void testCloseSignal() |
| 175 | { |
no test coverage detected