Media · Capture and devices: recorder, camera, mic meter, device choice and 3D model viewer
ScreenRecorderControls holds a recording in one pill: Record, then a live dot and the time it has run beside pause or resume and stop, with mic and camera toggles. CameraPreview shows host frames in the camera's shape, or the camera off. MicLevelMeter lights segments up to the level, amber and red near the top, with tones shared from data_display. DeviceSelector picks a microphone, camera or speaker through Select, which may now be empty while shut. ModelViewer shows the host's frame for an orbit that a drag, the arrows, Command-scroll, + and - and a reset move; the orbit is seeded from the host so fast drags add up. The gallery draws a stone torus per orbit and frees each replaced frame.
This commit is contained in:
1 parent
cb6c78b90c
commit
d1b8ad395d
20 files changed
+1541
-30
No files matched your search
@@ -419,3 +419,30 @@ fn a_free_combobox_keeps_the_text_it_mounts_with(cx: &mut TestAppContext) {
|
||||
"custom label"
|
||||
);
|
||||
}
|
||||
|
||||
/// A select with nothing to pick, open or shut.
|
||||
struct Empty(bool);
|
||||
|
||||
impl Render for Empty {
|
||||
fn render(&mut self, _: &mut Window, _: &mut Context<Self>) -> impl IntoElement {
|
||||
Select::new("empty", [])
|
||||
.placeholder("Nothing yet")
|
||||
.disabled(self.0)
|
||||
}
|
||||
}
|
||||
|
||||
#[gpui::test]
|
||||
fn a_shut_select_may_be_empty(cx: &mut TestAppContext) {
|
||||
setup(cx);
|
||||
let (_, cx) = cx.add_window_view(|_, _| Empty(true));
|
||||
cx.run_until_parked();
|
||||
cx.update(|window, _| window.focus_next());
|
||||
assert!(cx.update(|window, cx| window.focused(cx).is_none()));
|
||||
}
|
||||
|
||||
#[gpui::test]
|
||||
#[should_panic(expected = "has no choices")]
|
||||
fn an_open_select_with_nothing_to_pick_fails(cx: &mut TestAppContext) {
|
||||
setup(cx);
|
||||
cx.add_window_view(|_, _| Empty(false));
|
||||
}
|
||||
Reference in new issue
Block a user