summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
Diffstat (limited to 'libs')
-rw-r--r--libs/widgets/ardour_spacer.cc6
-rw-r--r--libs/widgets/widgets/ardour_spacer.h23
2 files changed, 29 insertions, 0 deletions
diff --git a/libs/widgets/ardour_spacer.cc b/libs/widgets/ardour_spacer.cc
index 4155a17ee4..712792a710 100644
--- a/libs/widgets/ardour_spacer.cc
+++ b/libs/widgets/ardour_spacer.cc
@@ -25,3 +25,9 @@ ArdourVSpacer::ArdourVSpacer (float r)
, ratio (r)
{
}
+
+ArdourDropShadow::ArdourDropShadow (float a)
+ : CairoWidget ()
+ , alpha (a)
+{
+}
diff --git a/libs/widgets/widgets/ardour_spacer.h b/libs/widgets/widgets/ardour_spacer.h
index b2668f19d7..e9f6ad1448 100644
--- a/libs/widgets/widgets/ardour_spacer.h
+++ b/libs/widgets/widgets/ardour_spacer.h
@@ -51,6 +51,29 @@ protected:
float ratio;
};
+class LIBWIDGETS_API ArdourDropShadow : public CairoWidget
+{
+public:
+ ArdourDropShadow (float a = 0.75f);
+
+protected:
+ void render (Cairo::RefPtr<Cairo::Context> const& ctx, cairo_rectangle_t*) {
+ float width = get_width();
+ float height = get_height();
+
+ Cairo::RefPtr<Cairo::LinearGradient> _gradient = Cairo::LinearGradient::create (0, 0, 0, height);
+ _gradient->add_color_stop_rgba (0, 0, 0, 0, alpha);
+ _gradient->add_color_stop_rgba (1, 0, 0, 0, 0);
+
+ ctx->set_source (_gradient);
+
+ ctx->rectangle (0, 0, width, height);
+ ctx->fill ();
+ }
+
+ float alpha;
+};
+
} /* end namespace */
#endif