libgimpwidgets: Fix formatting from 8adcc0cd

Some minor code style issues remained 
that I missed in 8adcc0cd.
After further reflection, I also converted
the code to be a private/internal function.
gimp_prop_check_button_new () should
cover the majority of GtkCheckButtons,
and the function is currently only used
to fix the size of those widgets. We could
revisit it as a public function in the
future if more use cases are found.
This commit is contained in:
Alx Sa 2024-05-19 02:10:23 +00:00
parent 5a4afd39eb
commit 47dde0580a
5 changed files with 50 additions and 36 deletions

View file

@ -1279,23 +1279,3 @@ gimp_widget_set_handle_on_mapped (GtkWidget *widget,
return FALSE;
}
/* get the width of the label when it is bold */
gint
gimp_get_bold_label_width (const gchar *text)
{
GtkWidget *temp_label = gtk_label_new (NULL);
GtkRequisition natural_size;
gtk_label_set_text (GTK_LABEL (temp_label), text);
gtk_widget_set_visible (temp_label, TRUE);
gimp_label_set_attributes (GTK_LABEL (temp_label),
PANGO_ATTR_WEIGHT, PANGO_WEIGHT_BOLD,
-1);
gtk_widget_get_preferred_size (temp_label, NULL, &natural_size);
gtk_widget_destroy (temp_label);
return natural_size.width;
}