2 * Copyright (C) 2016 Robin Gareus <robin@gareus.org>
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 #ifndef _WIDGETS_ARDOUR_SPACER_H_
20 #define _WIDGETS_ARDOUR_SPACER_H_
22 #include "gtkmm2ext/cairo_widget.h"
24 #include "widgets/visibility.h"
26 namespace ArdourWidgets {
28 class LIBWIDGETS_API ArdourVSpacer : public CairoWidget
31 ArdourVSpacer (float r = 0.75f);
34 void render (Cairo::RefPtr<Cairo::Context> const& ctx, cairo_rectangle_t* r) {
35 float h = r->height * ratio;
36 float t = .5f * (r->height - h);
37 ctx->rectangle (0, t, 1, h);
38 ctx->set_source_rgb (0, 0, 0);
42 void on_size_request (Gtk::Requisition* req) {
45 CairoWidget::on_size_request (req);