ui: the signal list is the signals slide-over page, opened by a + badge or g

This commit is contained in:
Martino Ferrari committed 2026-11-03 00:54:25 +01:00
1 parent e36f2a202b
commit 0dd235e41c
11 files changed
+98 -75

No files matched your search

+11 -16
View File
@@ -2864,19 +2864,13 @@ void on_right_click(GtkGestureClick* gesture, int, double x, double y, gpointer
open_row_menu(*app, row, x, y, widget);
}
/// Scrolls the dock to a section. The dock is one scroller (`App::dock_scroller`) holding the signal list,
/// the cursors and the measurements top to bottom, so "measure" is the cursors panel's offset in the
/// page, and "signals" the top. Nothing is hidden or removed: both stay in the page. An unknown name is a
/// no-op, so a key bound to a section a later version drops cannot blank anything.
/// Scrolls the dock to a section. The dock is one scroller (`App::dock_scroller`) holding the cursors and
/// the measurements top to bottom, so "measure" is the cursors panel's offset in the page. Nothing is
/// hidden or removed: both stay in the page. An unknown name (the signal list is a slide-over page now,
/// not a dock section) is a no-op, so a key bound to a section a later version drops cannot blank anything.
void dock_show_section(App& app, const char* section) {
if (app.dock_scroller == nullptr || app.dock_page == nullptr || section == nullptr) return;
GtkAdjustment* adj = gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW(app.dock_scroller));
if (std::strcmp(section, "signals") == 0) {
// The list is the first section: its own offset in the page is the page's margin, and "go to Signals"
// means the top of the dock.
gtk_adjustment_set_value(adj, 0.0);
return;
}
if (std::strcmp(section, "measure") != 0 || app.cursors_panel == nullptr) return;
graphene_point_t zero = GRAPHENE_POINT_INIT(0.f, 0.f);
graphene_point_t at;
@@ -4679,7 +4673,7 @@ void run_app_action(App& app, AppAction action) {
toggle(app.cursors_toggle);
break;
case AppAction::ShowMeasure: dock_show_section(app, "measure"); break;
case AppAction::ShowSignals: dock_show_section(app, "signals"); break;
case AppAction::ShowSignals: slideover_toggle(app, "signals"); break;
case AppAction::LayoutEditor:
toggle(app.layout_toggle);
break;
@@ -5153,9 +5147,9 @@ void on_activate(GtkApplication* application, gpointer user) {
gtk_popover_set_has_arrow(GTK_POPOVER(app->status_popover), TRUE);
}
// The right-hand side is the dock: one scroller, the signal list first (it is what is dragged onto the
// plot), then the cursors and the measurements. Every section is always there -- "go to Measure" scrolls
// to it instead of switching a tab, so the measurements are as live as the list above them.
// The right-hand side is the dock: one scroller, the cursors then the measurements. Every section is
// always there -- "go to Measure" scrolls to it instead of switching a tab, so the measurements are as
// live as the cursors above them. The signal list is a slide-over page (reached by the `+` badge).
// `side` and `dock_page`/`dock_scroller` are resolved above with the rest of the skeleton and checked
// by the null guard; assign the member here.
app->side_box = side;
@@ -5169,9 +5163,10 @@ void on_activate(GtkApplication* application, gpointer user) {
// would spread its rows (or draw its frame) over empty space under the last one.
gtk_widget_set_valign(app->trigger_panel, GTK_ALIGN_START);
slideover_add_page(*app, "trigger", "Trigger", app->trigger_panel);
// The signal list is the `signals` page, reached by the `+` badge or `g`; the panel is built here, after
// `build_slideover`, and registered once.
app->signal_panel = build_signal_panel(*app);
gtk_box_append(GTK_BOX(app->dock_page), app->signal_panel);
gtk_box_append(GTK_BOX(app->dock_page), gtk_separator_new(GTK_ORIENTATION_HORIZONTAL));
slideover_add_page(*app, "signals", "Signals", app->signal_panel);
gtk_box_append(GTK_BOX(app->dock_page), app->cursors_panel);
gtk_box_append(GTK_BOX(app->dock_page), gtk_separator_new(GTK_ORIENTATION_HORIZONTAL));
gtk_box_append(GTK_BOX(app->dock_page), measures_panel);