13
0

Prepare a boxy, no round borders, button-style

This commit is contained in:
Robin Gareus 2018-10-02 21:27:55 +02:00
parent 54f0f37c52
commit e01582dd9a
3 changed files with 12 additions and 1 deletions

View File

@ -34,6 +34,7 @@
static const char* has_cairo_widget_background_info = "has_cairo_widget_background_info";
bool CairoWidget::_flat_buttons = false;
bool CairoWidget::_boxy_buttons = false;
bool CairoWidget::_widget_prelight = true;
sigc::slot<void,Gtk::Widget*> CairoWidget::focus_handler;
@ -542,6 +543,13 @@ CairoWidget::set_flat_buttons (bool yn)
_flat_buttons = yn;
}
void
CairoWidget::set_boxy_buttons (bool yn)
{
_boxy_buttons = yn;
}
void
CairoWidget::set_widget_prelight (bool yn)
{

View File

@ -85,7 +85,9 @@ public:
uint32_t background_color ();
static void set_flat_buttons (bool yn);
static void set_boxy_buttons (bool yn);
static bool flat_buttons() { return _flat_buttons; }
static bool boxy_buttons() { return _boxy_buttons; }
static void set_widget_prelight (bool yn);
static bool widget_prelight() { return _widget_prelight; }
@ -132,6 +134,7 @@ protected:
bool _need_bg;
static bool _flat_buttons;
static bool _boxy_buttons;
static bool _widget_prelight;
bool _grabbed;

View File

@ -257,7 +257,7 @@ ArdourButton::render (Cairo::RefPtr<Cairo::Context> const& ctx, cairo_rectangle_
uint32_t text_color;
uint32_t led_color;
const float corner_radius = std::max(2.f, _corner_radius * UIConfigurationBase::instance().get_ui_scale());
const float corner_radius = _boxy_buttons ? 0 : std::max(2.f, _corner_radius * UIConfigurationBase::instance().get_ui_scale());
if (_update_colors) {
set_colors ();