X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=libs%2Fgtkmm2ext%2Futils.cc;h=8765d2b98b5baf3ec254214d5a44ff828c5c52ee;hb=5ec5bc4523e5c0fd998a6a133c6a03ab1475f063;hp=bdb44090c3041d612cfa7e46c6f1cc6f1b3aef04;hpb=7c3fd2fe794e5073760457300d24a23f23c54012;p=ardour.git diff --git a/libs/gtkmm2ext/utils.cc b/libs/gtkmm2ext/utils.cc index bdb44090c3..8765d2b98b 100644 --- a/libs/gtkmm2ext/utils.cc +++ b/libs/gtkmm2ext/utils.cc @@ -1,22 +1,26 @@ /* - Copyright (C) 1999 Paul Barton-Davis - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - - $Id$ -*/ + * Copyright (C) 1999-2016 Paul Davis + * Copyright (C) 2005-2008 Doug McLain + * Copyright (C) 2010-2012 Carl Hetherington + * Copyright (C) 2011-2015 David Robillard + * Copyright (C) 2014-2016 John Emmas + * Copyright (C) 2014-2019 Robin Gareus + * Copyright (C) 2016 Julien "_FrnchFrgg_" RIVAUD + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ #include #include @@ -800,6 +804,19 @@ Gtkmm2ext::rounded_top_right_rectangle (cairo_t* cr, double x, double y, double cairo_line_to (cr, x,y); // Line to A } +void +Gtkmm2ext::add_reflection (cairo_t* cr, double w, double h) +{ + cairo_pattern_t* convex_pattern = cairo_pattern_create_linear (0.0, 0, 0.3, h * 0.7); + cairo_pattern_add_color_stop_rgba (convex_pattern, 0.0, 1, 1, 1, 0.10); + cairo_pattern_add_color_stop_rgba (convex_pattern, 0.79, 1, 1, 1, 0.03); + cairo_pattern_add_color_stop_rgba (convex_pattern, 1.0, 1, 1, 1, 0.0); + cairo_set_source (cr, convex_pattern); + Gtkmm2ext::rounded_rectangle (cr, 2, 2, w - 4, h - 4, 4); + cairo_fill (cr); + cairo_pattern_destroy(convex_pattern); +} + Glib::RefPtr Gtkmm2ext::window_to_draw_on (Gtk::Widget& w, Gtk::Widget** parent) {