gtkmm: use get_realized() instead of deprecated Gtk::Widget::is_realized()

This commit is contained in:
Mads Kiilerich 2022-01-26 21:22:00 +01:00 committed by Robin Gareus
parent a86aa31747
commit 91b08d5f45
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
9 changed files with 19 additions and 19 deletions

View File

@ -157,7 +157,7 @@ AudioClock::set_widget_name (const string& str)
set_name (str + " clock"); set_name (str + " clock");
} }
if (is_realized()) { if (get_realized()) {
set_colors (); set_colors ();
} }
} }
@ -347,7 +347,7 @@ AudioClock::set_clock_dimensions (Gtk::Requisition& req)
tmp = Pango::Layout::create (get_pango_context()); tmp = Pango::Layout::create (get_pango_context());
if (!is_realized()) { if (!get_realized()) {
font = get_font_for_style (get_name()); font = get_font_for_style (get_name());
} else { } else {
font = style->get_font(); font = style->get_font();
@ -2302,7 +2302,7 @@ AudioClock::on_style_changed (const Glib::RefPtr<Gtk::Style>& old_style)
if (_layout && (_layout->get_font_description ().gobj () == 0 || _layout->get_font_description () != new_style->get_font ())) { if (_layout && (_layout->get_font_description ().gobj () == 0 || _layout->get_font_description () != new_style->get_font ())) {
_layout->set_font_description (new_style->get_font ()); _layout->set_font_description (new_style->get_font ());
queue_resize (); queue_resize ();
} else if (is_realized ()) { } else if (get_realized ()) {
queue_resize (); queue_resize ();
} }

View File

@ -247,7 +247,7 @@ InputPortMonitor::InputScope::InputScope (samplecnt_t rate, int l, int g, Orient
void void
InputPortMonitor::InputScope::dpi_reset () InputPortMonitor::InputScope::dpi_reset ()
{ {
if (is_realized ()) { if (get_realized ()) {
queue_resize (); queue_resize ();
} }
} }
@ -453,7 +453,7 @@ InputPortMonitor::EventMeter::dpi_reset ()
_layout->get_pixel_size (_length, _extent); _layout->get_pixel_size (_length, _extent);
_extent += 2; _extent += 2;
_length += 2; _length += 2;
if (is_realized ()) { if (get_realized ()) {
queue_resize (); queue_resize ();
} }
} }
@ -562,7 +562,7 @@ InputPortMonitor::EventMonitor::dpi_reset ()
_layout->get_pixel_size (_width, _height); _layout->get_pixel_size (_width, _height);
_width += 2; _width += 2;
_height += 2; _height += 2;
if (is_realized ()) { if (get_realized ()) {
queue_resize (); queue_resize ();
} }
} }

View File

@ -140,7 +140,7 @@ MiniTimeline::dpi_changed ()
{ {
calculate_time_width (); calculate_time_width ();
if (is_realized()) { if (get_realized()) {
queue_resize (); queue_resize ();
} }
} }

View File

@ -541,7 +541,7 @@ void
GtkCanvas::use_nsglview () GtkCanvas::use_nsglview ()
{ {
assert (!_nsglview); assert (!_nsglview);
assert (!is_realized()); assert (!get_realized());
#ifdef ARDOUR_CANVAS_NSVIEW_TAG // patched gdkquartz.h #ifdef ARDOUR_CANVAS_NSVIEW_TAG // patched gdkquartz.h
_nsglview = Gtkmm2ext::nsglview_create (this); _nsglview = Gtkmm2ext::nsglview_create (this);
#endif #endif

View File

@ -88,7 +88,7 @@ CairoWidget::use_nsglview ()
{ {
assert (!_nsglview); assert (!_nsglview);
assert (!_canvas_widget); assert (!_canvas_widget);
assert (!is_realized()); assert (!get_realized());
#ifdef ARDOUR_CANVAS_NSVIEW_TAG // patched gdkquartz.h #ifdef ARDOUR_CANVAS_NSVIEW_TAG // patched gdkquartz.h
_nsglview = Gtkmm2ext::nsglview_create (this); _nsglview = Gtkmm2ext::nsglview_create (this);
#endif #endif

View File

@ -206,7 +206,7 @@ ArdourButton::set_text (const std::string& str, bool markup)
_text = str; _text = str;
_markup = markup; _markup = markup;
if (!is_realized()) { if (!get_realized()) {
return; return;
} }
ensure_layout (); ensure_layout ();
@ -1098,7 +1098,7 @@ ArdourButton::on_style_changed (const RefPtr<Gtk::Style>& style)
if (!_custom_font_set && _layout && _layout->get_font_description () != new_style->get_font ()) { if (!_custom_font_set && _layout && _layout->get_font_description () != new_style->get_font ()) {
_layout->set_font_description (new_style->get_font ()); _layout->set_font_description (new_style->get_font ());
queue_resize (); queue_resize ();
} else if (is_realized()) { } else if (get_realized()) {
queue_resize (); queue_resize ();
} }
} }
@ -1110,7 +1110,7 @@ ArdourButton::on_name_changed ()
_char_pixel_height = 0; _char_pixel_height = 0;
_diameter = 0; _diameter = 0;
_update_colors = true; _update_colors = true;
if (is_realized()) { if (get_realized()) {
queue_resize (); queue_resize ();
} }
} }
@ -1149,7 +1149,7 @@ ArdourButton::set_image (const RefPtr<Gdk::Pixbuf>& img)
{ {
_elements = (ArdourButton::Element) (_elements & ~ArdourButton::Text); _elements = (ArdourButton::Element) (_elements & ~ArdourButton::Text);
_pixbuf = img; _pixbuf = img;
if (is_realized()) { if (get_realized()) {
queue_resize (); queue_resize ();
} }
} }
@ -1274,7 +1274,7 @@ ArdourButton::set_tweaks (Tweaks t)
{ {
if (_tweaks != t) { if (_tweaks != t) {
_tweaks = t; _tweaks = t;
if (is_realized()) { if (get_realized()) {
queue_resize (); queue_resize ();
} }
} }
@ -1303,7 +1303,7 @@ ArdourButton::set_layout_ellipsize_width (int w)
if (_layout_ellipsize_width > 3 * PANGO_SCALE) { if (_layout_ellipsize_width > 3 * PANGO_SCALE) {
_layout->set_width (_layout_ellipsize_width - 3 * PANGO_SCALE); _layout->set_width (_layout_ellipsize_width - 3 * PANGO_SCALE);
} }
if (is_realized ()) { if (get_realized ()) {
queue_resize (); queue_resize ();
} }
} }
@ -1322,7 +1322,7 @@ ArdourButton::set_text_ellipsize (Pango::EllipsizeMode e)
if (_layout_ellipsize_width > 3 * PANGO_SCALE) { if (_layout_ellipsize_width > 3 * PANGO_SCALE) {
_layout->set_width (_layout_ellipsize_width - 3 * PANGO_SCALE); _layout->set_width (_layout_ellipsize_width - 3 * PANGO_SCALE);
} }
if (is_realized ()) { if (get_realized ()) {
queue_resize (); queue_resize ();
} }
} }

View File

@ -385,7 +385,7 @@ ArdourFader::on_size_allocate (Gtk::Allocation& alloc)
_span = alloc.get_width (); _span = alloc.get_width ();
} }
if (is_realized() && ((old_girth != _girth) || (old_span != _span))) { if (get_realized() && ((old_girth != _girth) || (old_span != _span))) {
/* recreate patterns in case we've changed size */ /* recreate patterns in case we've changed size */
create_patterns (); create_patterns ();
} }

View File

@ -171,7 +171,7 @@ Frame::on_style_changed (const Glib::RefPtr<Gtk::Style>& style)
if (_layout && (_layout->get_font_description ().gobj () == 0 || _layout->get_font_description () != new_style->get_font ())) { if (_layout && (_layout->get_font_description ().gobj () == 0 || _layout->get_font_description () != new_style->get_font ())) {
_layout->set_font_description (new_style->get_font ()); _layout->set_font_description (new_style->get_font ());
queue_resize (); queue_resize ();
} else if (is_realized ()) { } else if (get_realized ()) {
queue_resize (); queue_resize ();
} }
} }

View File

@ -307,7 +307,7 @@ TearOff::set_state (const XMLNode& node)
node.get_property (X_("xpos"), own_window_xpos); node.get_property (X_("xpos"), own_window_xpos);
node.get_property (X_("ypos"), own_window_ypos); node.get_property (X_("ypos"), own_window_ypos);
if (own_window.is_realized ()) { if (own_window.get_realized ()) {
own_window.set_default_size (own_window_width, own_window_height); own_window.set_default_size (own_window_width, own_window_height);
own_window.move (own_window_xpos, own_window_ypos); own_window.move (own_window_xpos, own_window_ypos);
} }