Aurore
A Switch-like interface for your app, on every screen
Loading...
Searching...
No Matches
tab_badge.hpp
Go to the documentation of this file.
1// TabBadge — the number of entries to do of a tab, at the right of its name
2// in the main screen's sidebar: an amber disc, as a notification bell's, so
3// what needs the user shows where it is fixed (PlayGuard's notices). The
4// same in the tab, on the row where they are fixed, at its right end. Gone
5// while there is nothing to do: the name keeps the whole row. With the rail
6// on its icons (ui::Prefs::rail), a smaller disc on the icon's corner
7// instead (dock).
8// Copyright (C) 2026 JigSawFr. GPLv3-or-later (see LICENSE.GPL).
9#pragma once
10
11#include <aurore.hpp>
12
15class TabBadge : public aurore::View
16{
17 public:
19
20 void set_count(int count);
24 void dock(float open, bool floating);
25
26 void draw(NVGcontext* vg, float x, float y, float width, float height, aurore::Style style,
27 aurore::FrameContext* ctx) override;
28
35
36 private:
37 int count = 0;
38 aurore::Time pop_since = 0;
39 float open = 1.0f;
40 bool floating = false;
41};
Definition tab_badge.hpp:16
void set_count(int count)
static TabBadge * find(aurore::SidebarItem *item)
Its badge if it has one yet, else nullptr.
void draw(NVGcontext *vg, float x, float y, float width, float height, aurore::Style style, aurore::FrameContext *ctx) override
void dock(float open, bool floating)
static TabBadge * on_row(aurore::Box *row)
A row's (a DetailCell: its title, then its value): after the value.
static TabBadge * of(aurore::SidebarItem *item)
The sidebar item's badge, added the first time it is asked for.
Generic FlexBox layout.
Definition box.hpp:74
Definition frame_context.hpp:30
Definition sidebar.hpp:51
Simple wrapper around StyleValues for the array operator.
Definition style.hpp:115
Definition view.hpp:232
retro_time_t Time
Definition time.hpp:31