13
0

gtkmm: use size_request() function instead of deprecated Gtk::Widget::size_request(&)

This commit is contained in:
Mads Kiilerich 2022-01-26 22:00:02 +01:00 committed by Robin Gareus
parent 7f649efd42
commit cb4e10683d
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
7 changed files with 11 additions and 15 deletions

View File

@ -1138,7 +1138,7 @@ AUPluginUI::parent_cocoa_window ()
resizable = false;
if (toplevel && toplevel->is_toplevel()) {
toplevel->size_request (req);
req = toplevel->size_request ();
toplevel->set_size_request (req.width, req.height);
dynamic_cast<Gtk::Window*>(toplevel)->set_resizable (false);
}

View File

@ -48,7 +48,7 @@ BigClockWindow::BigClockWindow (AudioClock& c)
add (clock);
clock.show_all ();
clock.size_request (default_size);
default_size = clock.size_request ();
clock.signal_size_allocate().connect (sigc::mem_fun (*this, &BigClockWindow::clock_size_reallocated));
}

View File

@ -331,11 +331,11 @@ Editor::reset_controls_layout_width ()
GtkRequisition req = { 0, 0 };
gint w;
edit_controls_vbox.size_request (req);
req = edit_controls_vbox.size_request ();
w = req.width;
if (_group_tabs->get_visible()) {
_group_tabs->size_request (req);
req = _group_tabs->size_request ();
w += req.width;
}

View File

@ -1019,12 +1019,12 @@ GainMeter::get_gm_width ()
Gtk::Requisition sz;
int min_w = 0;
sz.width = 0;
meter_metric_area.size_request (sz);
sz = meter_metric_area.size_request ();
min_w += sz.width;
level_meter->size_request (sz);
sz = level_meter->size_request ();
min_w += sz.width;
fader_alignment.size_request (sz);
sz = fader_alignment.size_request ();
if (_width == Wide)
return max(sz.width * 2, min_w * 2) + 6;
else

View File

@ -127,8 +127,7 @@ Widget::compute_bounding_box () const
if (_allocation) {
_bounding_box = Rect (0, 0, _allocation.width(), _allocation.height());
} else {
GtkRequisition req = { 0, 0 };
_widget.size_request (req);
GtkRequisition req = _widget.size_request ();
_bounding_box = Rect (0., 0., req.width, req.height);
}

View File

@ -97,7 +97,7 @@ Frame::on_size_request (GtkRequisition* r)
}
if (_w) {
_w->size_request (*r);
*r = _w->size_request ();
} else {
r->width = 0;
r->height = 0;

View File

@ -101,13 +101,11 @@ Pane::on_size_request (GtkRequisition* req)
}
for (Children::iterator c = children.begin(); c != children.end(); ++c) {
GtkRequisition r;
if (!(*c)->w->get_visible ()) {
continue;
}
(*c)->w->size_request (r);
GtkRequisition r = (*c)->w->size_request ();
if (horizontal) {
largest.height = max (largest.height, r.height);
@ -300,8 +298,7 @@ Pane::reallocate (Gtk::Allocation const & alloc)
fract = (*div)->fract;
}
Gtk::Requisition cr;
(*child)->w->size_request (cr);
Gtk::Requisition cr = (*child)->w->size_request ();
if (horizontal) {
child_alloc.set_width ((gint) floor (remaining * fract));