ui: the Source badge, and the source panels as slide-over pages
This commit is contained in:
1 parent
5fb479bd69
commit
31ff778e07
6 files changed
+101
-28
No files matched your search
+4
-9
@@ -54,7 +54,7 @@ void keep_tabs_icon_free(App& app) {
|
||||
}
|
||||
|
||||
void build_source_panels(App& app) {
|
||||
if (app.side_stack == nullptr || app.acq == nullptr || app.acq->source() == nullptr) return;
|
||||
if (app.slideover.stack == nullptr || app.acq == nullptr || app.acq->source() == nullptr) return;
|
||||
SourceKind* kind = find_kind(app.source_kind);
|
||||
if (kind == nullptr) return;
|
||||
for (const SourcePanel& p : kind->make_panels(*app.acq->source())) {
|
||||
@@ -63,15 +63,10 @@ void build_source_panels(App& app) {
|
||||
p.widget == nullptr ? "no widget" : "an empty id");
|
||||
continue;
|
||||
}
|
||||
// Each page scrolls on its own, like Measure and Signals: panels differ in height.
|
||||
GtkWidget* scroller = gtk_scrolled_window_new();
|
||||
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scroller), GTK_POLICY_NEVER,
|
||||
GTK_POLICY_AUTOMATIC);
|
||||
gtk_scrolled_window_set_child(GTK_SCROLLED_WINDOW(scroller), p.widget);
|
||||
const std::string name = "source-" + p.id;
|
||||
// The tab is its title: the sidebar's pills are words, not glyphs.
|
||||
adw_view_stack_add_titled(ADW_VIEW_STACK(app.side_stack), scroller, name.c_str(),
|
||||
p.title.c_str());
|
||||
// The panel is a slide-over page now: the slide-over wraps it in its own scroller, and with two or
|
||||
// more source pages it draws the segmented switch (the E-1608: Analog out, Digital I/O).
|
||||
if (!slideover_add_page(app, name, p.title, p.widget)) continue;
|
||||
app.source_panels.push_back({name, p.title, p.widget});
|
||||
}
|
||||
// Disconnected until the first Connected event says otherwise.
|
||||
|
||||
Reference in new issue
Block a user