Lumiera  0.pre.03
»edit your freedom«
StaveBracketWidget Class Reference

#include "stage/timeline/stave-bracket-widget.hpp"

Description

Helper widget to handle display of the structure of track nesting in the timeline header pane.

For each TrackHeadWidget, the connected cells in the first grid column are populated with this component, indicating connectivity and layout constraints. The actual drawing is based on Cairo, and implemented in the virtual draw() function.

Definition at line 67 of file stave-bracket-widget.hpp.

Public Member Functions

void addConnector (uint offset)
 Request to draw a connector to the nested sub-Track's stave bracket. More...
 
void clearConnectors ()
 

Private Types

using _Base = Gtk::DrawingArea
 

Private Member Functions

void get_preferred_width_for_height_vfunc (int, int &, int &) const override
 The structural outline adapts flexible in vertical direction, but requires a proportional horizontal size for proper drawing. More...
 
void get_preferred_width_vfunc (int &, int &) const override
 
Gtk::SizeRequestMode get_request_mode_vfunc () const final
 indicate layout oriented towards vertical extension
 
bool on_draw (CairoC cox) override
 Custom drawing: a »stave bracket« to indicate track scope. More...
 

Private Attributes

std::vector< uint > connectors_
 

Member Function Documentation

◆ addConnector()

void addConnector ( uint  offset)
inline

Request to draw a connector to the nested sub-Track's stave bracket.

Parameters
offsetvertical location where the sub-Track starts, relative to the start of this stave bracket's start
Remarks
called from the 2nd DisplayEvaluation pass, when linking the layout
See also
TrackHeadWidget::linkSubTrackPositions

Definition at line 105 of file stave-bracket-widget.hpp.

◆ on_draw()

bool on_draw ( CairoC  cox)
overrideprivate

Custom drawing: a »stave bracket« to indicate track scope.

The layout is controlled by settings in the CSS style context

  • a base width (which is the width of the vertical double bar) is based on current font settings, with scale #BASE_WIDTH_PER_EM
  • this base width also defines the width requirement reported to GTK through get_preferred_width_for_height_vfunc
  • possible padding is picket up from CSS
  • current text colour is used for drawing

Definition at line 363 of file stave-bracket-widget.cpp.

References stage::timeline::anonymous_namespace{stave-bracket-widget.cpp}::anchorLeft(), stage::timeline::anonymous_namespace{stave-bracket-widget.cpp}::anchorLower(), stage::timeline::anonymous_namespace{stave-bracket-widget.cpp}::anchorUpper(), stage::timeline::anonymous_namespace{stave-bracket-widget.cpp}::connect(), stage::timeline::anonymous_namespace{stave-bracket-widget.cpp}::determineScale(), stage::timeline::anonymous_namespace{stave-bracket-widget.cpp}::drawBar(), and stage::timeline::anonymous_namespace{stave-bracket-widget.cpp}::drawCap().

+ Here is the call graph for this function:

◆ get_preferred_width_for_height_vfunc()

void get_preferred_width_for_height_vfunc ( int  givenHeight,
int &  minimum_width,
int &  natural_width 
) const
overrideprivate

The structural outline adapts flexible in vertical direction, but requires a proportional horizontal size for proper drawing.

The horizontal requisition is based on the font in CSS style context.

Definition at line 399 of file stave-bracket-widget.cpp.

References stage::timeline::anonymous_namespace{stave-bracket-widget.cpp}::calcDesiredWidth(), and stage::timeline::anonymous_namespace{stave-bracket-widget.cpp}::calcRequiredWidth().

+ Here is the call graph for this function:
+ Inheritance diagram for StaveBracketWidget:
+ Collaboration diagram for StaveBracketWidget:

The documentation for this class was generated from the following files: