ui: the Source badge, and the source panels as slide-over pages

This commit is contained in:
Martino Ferrari committed 2026-11-02 20:19:47 +01:00
1 parent 5fb479bd69
commit 31ff778e07
6 files changed
+101 -28

No files matched your search

+6 -7
View File
@@ -1957,9 +1957,7 @@ gboolean source_kinds_probe(gpointer user) {
const SourcePanelPage* page = a->source_panels.empty() ? nullptr : &a->source_panels.front();
const auto report = [&](const char* state) {
const bool present =
page != nullptr && a->side_stack != nullptr &&
adw_view_stack_get_child_by_name(ADW_VIEW_STACK(a->side_stack), page->name.c_str()) !=
nullptr;
page != nullptr && slideover_has_page(*a, page->name);
std::fprintf(stderr, "[source-kinds] panel %s: panels=%zu present=%d sensitive=%d\n", state,
a->source_panels.size(), present ? 1 : 0,
page != nullptr && gtk_widget_get_sensitive(page->content) ? 1 : 0);
@@ -2399,8 +2397,7 @@ gboolean e1608_probe(gpointer user) {
const std::string page = std::string("source-") + id;
GtkWidget* content = source_panel_content(a, page.c_str());
const bool present =
content != nullptr && a->side_stack != nullptr &&
adw_view_stack_get_child_by_name(ADW_VIEW_STACK(a->side_stack), page.c_str()) != nullptr;
content != nullptr && slideover_has_page(*a, page);
std::fprintf(stderr, "[e1608] panel %s: present=%d sensitive=%d connected=%d\n", id,
present ? 1 : 0, content != nullptr && gtk_widget_get_sensitive(content) ? 1 : 0,
up ? 1 : 0);
@@ -2445,6 +2442,7 @@ gboolean e1608_gen_probe_stopped(gpointer user) {
std::fprintf(stderr, "[e1608] generator stopped: achieved=%.1f panel='%s' ok=%d\n", hz,
sub != nullptr ? sub : "", hz == 0.0 && off ? 1 : 0);
std::fflush(stderr);
slideover_close(*a);
return G_SOURCE_REMOVE;
}
@@ -2493,8 +2491,9 @@ gboolean e1608_gen_probe(gpointer user) {
std::fflush(stderr);
return G_SOURCE_REMOVE;
}
// The panel refreshes on its frame clock, which only ticks while the page is on screen.
if (a->side_stack != nullptr) adw_view_stack_set_visible_child_name(ADW_VIEW_STACK(a->side_stack), "source-ao");
// The panel refreshes on its frame clock, which only ticks while the page is on screen; the page stays
// open for the probe's reads and `e1608_gen_probe_stopped` closes it.
slideover_open(*a, "source-ao");
adw_combo_row_set_selected(ADW_COMBO_ROW(mode), 1); // Sine
adw_switch_row_set_active(ADW_SWITCH_ROW(run), TRUE);
g_timeout_add(2500, e1608_gen_probe_report, a);