13
0

add unrounded rectangle methods to Gtkmm2ext for use in truly boxy buttons

This commit is contained in:
Paul Davis 2024-03-20 06:23:15 -06:00
parent 354e60d657
commit 46fa056da6
2 changed files with 14 additions and 0 deletions

View File

@ -117,6 +117,7 @@ namespace Gtkmm2ext {
/* C++ API for rounded rectangles */
LIBGTKMM2EXT_API void rectangle (Cairo::RefPtr<Cairo::Context> context, double x, double y, double w, double h, double r=10);
LIBGTKMM2EXT_API void rounded_rectangle (Cairo::RefPtr<Cairo::Context> context, double x, double y, double w, double h, double r=10);
LIBGTKMM2EXT_API void rounded_top_rectangle (Cairo::RefPtr<Cairo::Context> context, double x, double y, double w, double h, double r=10);
LIBGTKMM2EXT_API void rounded_top_left_rectangle (Cairo::RefPtr<Cairo::Context> context, double x, double y, double w, double h, double r=10);
@ -128,6 +129,7 @@ namespace Gtkmm2ext {
/* C API for rounded rectangles */
LIBGTKMM2EXT_API void rectangle (cairo_t*, double x, double y, double w, double h, double r=10);
LIBGTKMM2EXT_API void rounded_rectangle (cairo_t*, double x, double y, double w, double h, double r=10);
LIBGTKMM2EXT_API void rounded_top_rectangle (cairo_t*, double x, double y, double w, double h, double r=10);
LIBGTKMM2EXT_API void rounded_top_left_rectangle (cairo_t*, double x, double y, double w, double h, double r=10);

View File

@ -588,6 +588,12 @@ Gtkmm2ext::container_clear (Gtk::Container& c, bool and_delete)
}
}
void
Gtkmm2ext::rectangle (Cairo::RefPtr<Cairo::Context> context, double x, double y, double w, double h, double /*r*/)
{
cairo_rectangle (context->cobj(), x, y, w, h);
}
void
Gtkmm2ext::rounded_rectangle (Cairo::RefPtr<Cairo::Context> context, double x, double y, double w, double h, double r)
{
@ -631,6 +637,12 @@ Gtkmm2ext::rounded_right_half_rectangle (Cairo::RefPtr<Cairo::Context> context,
rounded_right_half_rectangle (context->cobj(), x, y, w, h, r);
}
void
Gtkmm2ext::rectangle (cairo_t* cr, double x, double y, double w, double h, double /*r*/)
{
cairo_rectangle (cr, x, y, w, h);
}
void
Gtkmm2ext::rounded_rectangle (cairo_t* cr, double x, double y, double w, double h, double r)
{