ui: a badge bar with a Trigger badge, and the trigger form in the slide-over
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
a40863fa45
commit
5fb479bd69
9 files changed
+215
-7
No files matched your search
@@ -130,6 +130,22 @@ struct SlideOver {
|
||||
};
|
||||
constexpr int kSlideOverWidth = 360;
|
||||
|
||||
/// One badge: a button with a name and a state line. `page` is the slide-over page it opens.
|
||||
struct Badge {
|
||||
GtkWidget* button = nullptr;
|
||||
GtkWidget* name = nullptr;
|
||||
GtkWidget* state = nullptr;
|
||||
std::string page;
|
||||
};
|
||||
/// The badge bar under the plot (src/ui_badges.cpp).
|
||||
struct BadgeBar {
|
||||
GtkWidget* bar = nullptr; ///< main-window.ui `badge_bar`, fixed height
|
||||
GtkWidget* signals_slot = nullptr; ///< left; empty in step 1, step 2 fills it
|
||||
GtkWidget* system_slot = nullptr; ///< right: Trigger, Source
|
||||
Badge trigger;
|
||||
Badge source; ///< task 3
|
||||
};
|
||||
|
||||
struct App {
|
||||
ScopeModel* model = nullptr;
|
||||
Acquisition* acq = nullptr;
|
||||
@@ -140,6 +156,11 @@ struct App {
|
||||
/// The `GtkOverlay` around `plot_box` (`main-window.ui`), which the slide-over panel is a child of.
|
||||
GtkWidget* plot_overlay = nullptr;
|
||||
SlideOver slideover;
|
||||
/// The badge bar under the plot (`main-window.ui` `badge_bar`, with its two slots).
|
||||
BadgeBar badges;
|
||||
GtkWidget* badge_bar = nullptr;
|
||||
GtkWidget* badge_signals = nullptr;
|
||||
GtkWidget* badge_system = nullptr;
|
||||
/// The one GL area, drawing the `RowSet`'s figure: every row is a row of that
|
||||
/// figure, so there is one widget, one context and one `::render` whatever the row
|
||||
/// count is.
|
||||
@@ -1901,6 +1922,12 @@ bool slideover_escape(App& app); // closes if open; true
|
||||
/// x, y in the overlay's coordinates; closes unless the point is inside the panel; true when it closed.
|
||||
bool slideover_click_away(App& app, double x, double y);
|
||||
gboolean slideover_probe(gpointer user); // UDPSCOPE_PROBE_SLIDEOVER_MS
|
||||
/// The badge bar (`src/ui_badges.cpp`): setup is reached by the object it configures.
|
||||
/// The Trigger badge's state word. Pure, so the probe can assert the whole table.
|
||||
const char* trigger_badge_state(bool enabled, bool armed, bool pending, bool has_event);
|
||||
void build_badge_bar(App& app); // after build_slideover and after the toolbar (it reads trigger_toggle)
|
||||
void sync_badge_bar(App& app); // per tick and on every slide-over open/close; only writes what changed
|
||||
gboolean badges_probe(gpointer user); // UDPSCOPE_PROBE_BADGES_MS
|
||||
gboolean source_kinds_probe_report(gpointer user);
|
||||
gboolean source_kinds_probe(gpointer user);
|
||||
/// MCC E-1608 end to end against `tools/mock_e1608.py`: the stream, the calibration, the panels and
|
||||
|
||||
Reference in new issue
Block a user