mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-06 05:35:47 +01:00
Add spacer widget to maintain size with GUI scaling
This is intended for the (Mixbus) Group Bar
This commit is contained in:
parent
41fc50898e
commit
ccf3addf5a
2 changed files with 31 additions and 0 deletions
|
|
@ -29,6 +29,29 @@
|
|||
|
||||
namespace ArdourWidgets {
|
||||
|
||||
class LIBWIDGETS_API ArdourScalingSpacer : public CairoWidget
|
||||
{
|
||||
public:
|
||||
ArdourScalingSpacer (int natural_width = 16, int natural_height = 16);
|
||||
|
||||
protected:
|
||||
void render (Cairo::RefPtr<Cairo::Context> const& ctx, cairo_rectangle_t*) {}
|
||||
|
||||
void on_size_request (Gtk::Requisition* req) {
|
||||
if (_natural_width > 0) {
|
||||
req->width = _natural_width * UIConfigurationBase::instance().get_ui_scale ();
|
||||
}
|
||||
if (_natural_height > 0) {
|
||||
req->height = _natural_height * UIConfigurationBase::instance().get_ui_scale ();
|
||||
}
|
||||
CairoWidget::on_size_request (req);
|
||||
}
|
||||
|
||||
private:
|
||||
int _natural_width;
|
||||
int _natural_height;
|
||||
};
|
||||
|
||||
class LIBWIDGETS_API ArdourVSpacer : public CairoWidget
|
||||
{
|
||||
public:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue