ui: reword the docs that still spoke of the list drag; keep disabled signals' badge order; stamp the signal generation before the snapshot
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
ca10dfb323
commit
f315c677f3
6 files changed
+23
-12
No files matched your search
@@ -53,7 +53,7 @@
|
||||
<property name="spacing">6</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="signals_hint">
|
||||
<property name="label" translatable="yes">drag a signal onto a plot</property>
|
||||
<property name="label" translatable="yes">click a signal for its page; drag its badge onto a plot</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="hexpand">1</property>
|
||||
<property name="css-classes">dim-label</property>
|
||||
|
||||
+12
-3
@@ -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<std::string> 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<std::ptrdiff_t>(shown_count), n) ==
|
||||
order.begin() + static_cast<std::ptrdiff_t>(shown_count)) {
|
||||
order.push_back(n);
|
||||
}
|
||||
}
|
||||
app->badge_order = std::move(order);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
+4
-1
@@ -569,6 +569,9 @@ void rebuild_signal_panels(App& app) {
|
||||
// GTK calls (a use-after-free of the name strings otherwise).
|
||||
std::vector<SignalInfo> 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<std::mutex> 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) {
|
||||
|
||||
Reference in new issue
Block a user