diff --git a/README.md b/README.md index d05ad08..32ffef5 100644 --- a/README.md +++ b/README.md @@ -2931,11 +2931,10 @@ now — they are listed so they are not mistaken for anything else: controls** are pages of the slide-over, reached from the badge bar. Both panes also have a **locked** mode, which is what a returning user gets: the trigger pane shows one line saying what it is set to, the signal list shows only the signals that are on, and neither offers a control that changes the configuration -- each heading has an `[edit]` button - to switch to the full pane, and back. Dragging a signal onto a plot still works while locked -- filling - plots is what the list is for, not configuration -- and a locked row can be dragged from anywhere on it, - the colour chip included. In a window too narrow to show both, where the dock is *overlaid on* the - plot, the dock steps aside for the length of the drag so there is something under the pointer to drop - onto. A **first run** (no session file for that source) comes up + to switch to the full pane, and back. Dragging a signal's badge onto a plot still works while locked -- + filling plots is not configuration. A signal's badge is dragged onto a plot, or onto another badge to + reorder the badges (the order is kept for the session only); the slide-over closes for the length of the + drag so there is something under the pointer to drop onto. A **first run** (no session file for that source) comes up unlocked, because configuring the host is what a first run is for. Each pane's heading also carries its **own switch**, the same control as the header bar's button -- clicking either moves both -- because a pane that is *disabled* while its feature is off is a pane whose controls you would otherwise have to leave to turn it back on. With the math diff --git a/help/C/org.udpscope.app/layout.page b/help/C/org.udpscope.app/layout.page index f5183c3..d6f6663 100644 --- a/help/C/org.udpscope.app/layout.page +++ b/help/C/org.udpscope.app/layout.page @@ -24,7 +24,7 @@ How to reach it -

Drag a signal's chip out of the side panel (s) and drop it on a row to +

Drag a signal's badge from the badge bar onto a row to add a trace.

diff --git a/help/C/org.udpscope.app/overview.page b/help/C/org.udpscope.app/overview.page index 43c2d4d..fd605c2 100644 --- a/help/C/org.udpscope.app/overview.page +++ b/help/C/org.udpscope.app/overview.page @@ -92,7 +92,7 @@ derived from it; Signals holds the trigger and the channel list, where a math channel is a row of that one list under a MATH heading whose + creates one. One row per channel: its colour, an enable switch, its name - and its unit. Channels are dragged from here onto a plot row.

+ and its unit. A channel's badge in the badge bar is dragged onto a plot row.

The plot diff --git a/src/ui/signals-panel.ui b/src/ui/signals-panel.ui index b79a8f8..66fc09a 100644 --- a/src/ui/signals-panel.ui +++ b/src/ui/signals-panel.ui @@ -53,7 +53,7 @@ 6 - drag a signal onto a plot + click a signal for its page; drag its badge onto a plot start 1 dim-label diff --git a/src/ui_badges.cpp b/src/ui_badges.cpp index f53072f..0e36e4c 100644 --- a/src/ui_badges.cpp +++ b/src/ui_badges.cpp @@ -102,14 +102,23 @@ gboolean on_badge_drop(GtkDropTarget*, const GValue* value, double, double, gpoi if (prev != moved->button) { // already directly in front: nothing to move gtk_box_reorder_child_after(GTK_BOX(app->badges.signals_row), moved->button, prev); } - // The order, as the widgets now stand. - app->badge_order.clear(); + // The order, as the widgets now stand; the names that are not shown (signals switched off) keep their old + // relative order after the visible ones, so switching one back on finds it where it was remembered. + std::vector order; for (GtkWidget* c = gtk_widget_get_first_child(app->badges.signals_row); c != nullptr; c = gtk_widget_get_next_sibling(c)) { for (auto& b : app->badges.signal_badges) { - if (b->button == c) app->badge_order.push_back(b->signal_name); + if (b->button == c) order.push_back(b->signal_name); } } + const std::size_t shown_count = order.size(); + for (const std::string& n : app->badge_order) { + if (std::find(order.begin(), order.begin() + static_cast(shown_count), n) == + order.begin() + static_cast(shown_count)) { + order.push_back(n); + } + } + app->badge_order = std::move(order); return TRUE; } diff --git a/src/ui_signals.cpp b/src/ui_signals.cpp index b2f36bc..0a1cc28 100644 --- a/src/ui_signals.cpp +++ b/src/ui_signals.cpp @@ -569,6 +569,9 @@ void rebuild_signal_panels(App& app) { // GTK calls (a use-after-free of the name strings otherwise). std::vector signals; bool have_signals = false; + // The generation this build answers to is read *before* the snapshot: a CONFIG landing between the two + // would otherwise be stamped as seen without having been, and the tick would never rebuild for it. + const unsigned generation = app.model->generation(); { std::lock_guard lock(app.model->mutex()); signals = app.model->signals(); @@ -585,7 +588,7 @@ void rebuild_signal_panels(App& app) { } signal_pages_sync(app); sync_signal_badges(app); - app.signal_generation = app.model->generation(); + app.signal_generation = generation; } GtkWidget* build_signal_panel(App& app) {