MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ hover_text_row()

void MayaFlux::Portal::Forma::internal::hover_text_row ( Surface &  surface,
uint32_t  id,
const std::shared_ptr< Element > &  row,
std::string_view  label,
const std::shared_ptr< glm::uvec2 > &  dims 
)

Highlight a row's background while the cursor is over it.

Parameters
dimsPixel size read on every enter and leave, so a resize that updates it is picked up.

Definition at line 49 of file TextRow.cpp.

55{
56 const std::string caption = row_caption(label);
57
58 surface.ctx().on_enter(id, [row, caption, dims](uint32_t) {
59 row->set_text(caption, row_press_params(*dims, row_hover_color()));
60 });
61 surface.ctx().on_leave(id, [row, caption, dims](uint32_t) {
62 row->set_text(caption, row_press_params(*dims, row_idle_color()));
63 });
64}
uint32_t label
Definition Contours.cpp:16
void on_enter(uint32_t id, EnterFn fn)
Called once when the cursor enters an element's region.
Definition Context.cpp:58
void on_leave(uint32_t id, LeaveFn fn)
Called once when the cursor leaves an element's region.
Definition Context.cpp:63
Context & ctx() noexcept
Access the event router.
Definition Surface.hpp:170
Text::PressParams row_press_params(glm::uvec2 dims, glm::vec4 background)
White text over background, laid out at dims pixels.
Definition TextRow.cpp:18
std::string row_caption(std::string_view label)
Caption drawn for a row labelled label.
Definition TextRow.cpp:13

References MayaFlux::Portal::Forma::Surface::ctx(), hover_text_row(), label, MayaFlux::Portal::Forma::Context::on_enter(), MayaFlux::Portal::Forma::Context::on_leave(), row_caption(), row_hover_color(), row_idle_color(), and row_press_params().

Referenced by hover_text_row().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: