forge
Explore
Log in

Don't you dare go Hollow

Reveal mix and preview controls

Browse files at this commit

4dfcd8fe7b2da73c76973d8184ccc908573e3b55Ahmet Kaan GümüşParent: 484d07d
  • fix
    • reveal mix and preview controls
Show full message
🐛 fix(ui): reveal mix and preview controls
crates/app/src/player/cards.rsmodified+4 -0
@@ -801,6 +801,10 @@ impl Player {
801801 .and_then(|lane| self.mix_lanes().iter().position(|&l| l == lane))
802802 .unwrap_or(0);
803803 self.context_menu = None;
804+ // Param cards live in the Clip tab. Route every opening door here so a
805+ // lane header never opens a card behind Sources.
806+ self.dock_src_active = false;
807+ crate::ui::dock_stance::save(false);
804808 cx.notify();
805809 }
806810
crates/app/src/tests/layout.rsmodified+1 -0
@@ -2761,6 +2761,7 @@ fn hitmap_names_every_darkroom_pointer_entry_surface() {
27612761 for needle in [
27622762 "subtitle.{group_ord}.{track}.row",
27632763 "subtitle.{group_ord}.{track}.select",
2764+ "source.{i}.preview",
27642765 "source.{i}.proxy",
27652766 "Proxy making",
27662767 ] {
crates/app/src/ui/dock_stance.rsmodified+34 -1
@@ -37,7 +37,7 @@ pub(crate) fn load() -> bool {
3737 }
3838
3939 /// Writes the pick. One word, written whole.
40-fn save(src_active: bool) {
40+pub(crate) fn save(src_active: bool) {
4141 let path = config_path();
4242 if let Some(dir) = path.parent() {
4343 let _ = std::fs::create_dir_all(dir);
@@ -262,6 +262,7 @@ fn source_row(
262262 let usage = usage_line(player, row.tint, placed);
263263 let (path, stream) = (row.path.clone(), row.stream);
264264 let dragged = (path.clone(), stream);
265+ let preview_path = path.clone();
265266 let dot_path = path.clone();
266267 let menu_path = path.clone();
267268 let add_path = path.clone();
@@ -444,6 +445,38 @@ fn source_row(
444445 .text_color(rgb(INK3()))
445446 .child(usage)
446447 })
448+ .when(usable, |d| {
449+ d.child({
450+ let style = label(type_scale::FLOOR_PX, FontWeight::MEDIUM);
451+ div()
452+ .id(("dock-preview", i))
453+ .flex_none()
454+ .px(px(4.))
455+ .py(px(2.))
456+ .rounded(px(3.))
457+ .cursor_pointer()
458+ .hover(|s| s.bg(rgb(DARK_RAISED())).text_color(rgb(INK1())))
459+ .tooltip(move |_, cx| {
460+ cx.new(|_| Tip("Preview — play this source outside the timeline".into()))
461+ .into()
462+ })
463+ .on_click(cx.listener(move |this, _: &ClickEvent, _, cx| {
464+ cx.stop_propagation();
465+ this.open_preview(&preview_path, stream, cx);
466+ }))
467+ .children(hitmap::dynamic(
468+ move || (format!("source.{i}.preview"), "Preview source".into()),
469+ true,
470+ ))
471+ .child(
472+ div()
473+ .font(style.font)
474+ .text_size(style.size)
475+ .text_color(rgb(INK2()))
476+ .child("Preview"),
477+ )
478+ })
479+ })
447480 .when(usable, |d| {
448481 d.child({
449482 let label_style = label(type_scale::FLOOR_PX, FontWeight::MEDIUM);