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 {
801 .and_then(|lane| self.mix_lanes().iter().position(|&l| l == lane))801 .and_then(|lane| self.mix_lanes().iter().position(|&l| l == lane))
802 .unwrap_or(0);802 .unwrap_or(0);
803 self.context_menu = None;803 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);
804 cx.notify();808 cx.notify();
805 }809 }
806 810
crates/app/src/tests/layout.rsmodified+1 -0
@@ -2761,6 +2761,7 @@ fn hitmap_names_every_darkroom_pointer_entry_surface() {
2761 for needle in [2761 for needle in [
2762 "subtitle.{group_ord}.{track}.row",2762 "subtitle.{group_ord}.{track}.row",
2763 "subtitle.{group_ord}.{track}.select",2763 "subtitle.{group_ord}.{track}.select",
2764+ "source.{i}.preview",
2764 "source.{i}.proxy",2765 "source.{i}.proxy",
2765 "Proxy making",2766 "Proxy making",
2766 ] {2767 ] {
crates/app/src/ui/dock_stance.rsmodified+34 -1
@@ -37,7 +37,7 @@ pub(crate) fn load() -> bool {
37 }37 }
38 38
39 /// Writes the pick. One word, written whole.39 /// Writes the pick. One word, written whole.
40-fn save(src_active: bool) {40+pub(crate) fn save(src_active: bool) {
41 let path = config_path();41 let path = config_path();
42 if let Some(dir) = path.parent() {42 if let Some(dir) = path.parent() {
43 let _ = std::fs::create_dir_all(dir);43 let _ = std::fs::create_dir_all(dir);
@@ -262,6 +262,7 @@ fn source_row(
262 let usage = usage_line(player, row.tint, placed);262 let usage = usage_line(player, row.tint, placed);
263 let (path, stream) = (row.path.clone(), row.stream);263 let (path, stream) = (row.path.clone(), row.stream);
264 let dragged = (path.clone(), stream);264 let dragged = (path.clone(), stream);
265+ let preview_path = path.clone();
265 let dot_path = path.clone();266 let dot_path = path.clone();
266 let menu_path = path.clone();267 let menu_path = path.clone();
267 let add_path = path.clone();268 let add_path = path.clone();
@@ -444,6 +445,38 @@ fn source_row(
444 .text_color(rgb(INK3()))445 .text_color(rgb(INK3()))
445 .child(usage)446 .child(usage)
446 })447 })
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+ })
447 .when(usable, |d| {480 .when(usable, |d| {
448 d.child({481 d.child({
449 let label_style = label(type_scale::FLOOR_PX, FontWeight::MEDIUM);482 let label_style = label(type_scale::FLOOR_PX, FontWeight::MEDIUM);