Lumiera 0.pre.04~rc.1
»edit your freedom«
Loading...
Searching...
No Matches
stave-bracket-widget.hpp
Go to the documentation of this file.
1/*
2 STAVE-BRACKET-WIDGET.hpp - draw connector to indicate nested track structure
3
4 Copyright (C)
5 2023, Hermann Vosseler <Ichthyostega@web.de>
6
7  **Lumiera** is free software; you can redistribute it and/or modify it
8  under the terms of the GNU General Public License as published by the
9  Free Software Foundation; either version 2 of the License, or (at your
10  option) any later version. See the file COPYING for further details.
11
12*/
13
14
37#ifndef STAGE_TIMELINE_STAVE_BRACKET_WIDGET_H
38#define STAGE_TIMELINE_STAVE_BRACKET_WIDGET_H
39
40#include "stage/gtk-base.hpp"
41
42#include <vector>
43
44
45namespace stage {
46namespace timeline {
47
48 using CairoC = PCairoContext const&;
49 using StyleC = PStyleContext const&;
50
51
59 : public Gtk::DrawingArea
60 {
61 using _Base = Gtk::DrawingArea;
62 std::vector<uint> connectors_;
63
64 public:
67
68 void clearConnectors();
69 void addConnector (uint offset);
70
71 private:/* ===== Internals ===== */
72
73 bool on_draw(CairoC cox) override;
74
75 Gtk::SizeRequestMode get_request_mode_vfunc() const final;
76 void get_preferred_width_vfunc (int&, int&) const override;
77 void get_preferred_width_for_height_vfunc (int, int&,int&) const override;
78 };
79
80
81
82 inline void
87
95 inline void
97 {
98 connectors_.emplace_back (offset);
99 }
100
101
102}}// namespace stage::timeline
103#endif /*STAGE_TIMELINE_STAVE_BRACKET_WIDGET_H*/
Helper widget to handle display of the structure of track nesting in the timeline header pane.
bool on_draw(CairoC cox) override
Custom drawing: a »stave bracket« to indicate track scope.
void get_preferred_width_vfunc(int &, int &) const override
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 ...
Gtk::SizeRequestMode get_request_mode_vfunc() const final
indicate layout oriented towards vertical extension
void addConnector(uint offset)
Request to draw a connector to the nested sub-Track's stave bracket.
A set of basic GTK includes for the UI.
unsigned int uint
Definition integral.hpp:29
PCairoContext const & CairoC
PStyleContext const & StyleC
Lumiera GTK UI implementation root.
Definition guifacade.cpp:37
Glib::RefPtr< Gtk::StyleContext > PStyleContext
Definition gtk-base.hpp:95
Cairo::RefPtr< Cairo::Context > PCairoContext
Definition gtk-base.hpp:96