libgimpwidgets: kill the last remaining occurencces of GtkTable

This commit is contained in:
Simon Budig 2018-05-11 13:20:09 +02:00 committed by Michael Natterer
parent 6d6d92d88e
commit f01a978627
4 changed files with 8 additions and 251 deletions

View file

@ -41,7 +41,7 @@ static gboolean gimp_scale_entry_log_to_linear (GBinding *binding,
gpointer user_data);
static GtkAdjustment * gimp_scale_entry_new_internal (gboolean color_scale,
GtkWidget *grid,
GtkGrid *grid,
gint column,
gint row,
const gchar *text,
@ -104,7 +104,7 @@ gimp_scale_entry_log_to_linear (GBinding *binding,
static GtkAdjustment *
gimp_scale_entry_new_internal (gboolean color_scale,
GtkWidget *parent,
GtkGrid *grid,
gint column,
gint row,
const gchar *text,
@ -188,32 +188,11 @@ gimp_scale_entry_new_internal (gboolean color_scale,
gtk_widget_set_size_request (scale, scale_width, -1);
gtk_widget_show (scale);
if (GTK_IS_GRID (parent))
{
GtkGrid *grid = GTK_GRID (parent);
gtk_widget_set_hexpand (scale, TRUE);
gtk_widget_set_hexpand (scale, TRUE);
gtk_grid_attach (grid, label, column, row, 1, 1);
gtk_grid_attach (grid, scale, column + 1, row, 1, 1);
gtk_grid_attach (grid, spinbutton, column + 2, row, 1, 1);
}
else
{
GtkTable *table = GTK_TABLE (parent);
gtk_table_attach (table, label,
column, column + 1, row, row + 1,
GTK_FILL, GTK_FILL, 0, 0);
gtk_table_attach (table, scale,
column + 1, column + 2, row, row + 1,
GTK_FILL | GTK_EXPAND, GTK_FILL, 0, 0);
gtk_table_attach (table, spinbutton,
column + 2, column + 3, row, row + 1,
GTK_FILL | GTK_SHRINK, GTK_SHRINK, 0, 0);
}
gtk_grid_attach (grid, label, column, row, 1, 1);
gtk_grid_attach (grid, scale, column + 1, row, 1, 1);
gtk_grid_attach (grid, spinbutton, column + 2, row, 1, 1);
if (tooltip || help_id)
{
@ -230,66 +209,6 @@ gimp_scale_entry_new_internal (gboolean color_scale,
return spin_adjustment;
}
/**
* gimp_scale_entry_new:
* @table: The #GtkTable the widgets will be attached to.
* @column: The column to start with.
* @row: The row to attach the widgets.
* @text: The text for the #GtkLabel which will appear
* left of the #GtkHScale.
* @scale_width: The minimum horizontal size of the #GtkHScale.
* @spinbutton_width: The minimum horizontal size of the #GtkSpinButton.
* @value: The initial value.
* @lower: The lower boundary.
* @upper: The upper boundary.
* @step_increment: The step increment.
* @page_increment: The page increment.
* @digits: The number of decimal digits.
* @constrain: %TRUE if the range of possible values of the
* #GtkSpinButton should be the same as of the #GtkHScale.
* @unconstrained_lower: The spinbutton's lower boundary
* if @constrain == %FALSE.
* @unconstrained_upper: The spinbutton's upper boundary
* if @constrain == %FALSE.
* @tooltip: A tooltip message for the scale and the spinbutton.
* @help_id: The widgets' help_id (see gimp_help_set_help_data()).
*
* This function creates a #GtkLabel, a #GtkHScale and a #GtkSpinButton and
* attaches them to a 3-column #GtkTable.
*
* Returns: The #GtkSpinButton's #GtkAdjustment.
**/
GtkAdjustment *
gimp_scale_entry_new (GtkTable *table,
gint column,
gint row,
const gchar *text,
gint scale_width,
gint spinbutton_width,
gdouble value,
gdouble lower,
gdouble upper,
gdouble step_increment,
gdouble page_increment,
guint digits,
gboolean constrain,
gdouble unconstrained_lower,
gdouble unconstrained_upper,
const gchar *tooltip,
const gchar *help_id)
{
return gimp_scale_entry_new_internal (FALSE,
GTK_WIDGET (table), column, row,
text, scale_width, spinbutton_width,
value, lower, upper,
step_increment, page_increment,
digits,
constrain,
unconstrained_lower,
unconstrained_upper,
tooltip, help_id);
}
/**
* gimp_scale_entry_new_grid:
* @grid: The #GtkGrid the widgets will be attached to.
@ -339,7 +258,7 @@ gimp_scale_entry_new_grid (GtkGrid *grid,
const gchar *help_id)
{
return gimp_scale_entry_new_internal (FALSE,
GTK_WIDGET (grid), column, row,
grid, column, row,
text, scale_width, spinbutton_width,
value, lower, upper,
step_increment, page_increment,
@ -350,55 +269,6 @@ gimp_scale_entry_new_grid (GtkGrid *grid,
tooltip, help_id);
}
/**
* gimp_color_scale_entry_new:
* @table: The #GtkTable the widgets will be attached to.
* @column: The column to start with.
* @row: The row to attach the widgets.
* @text: The text for the #GtkLabel which will appear
* left of the #GtkHScale.
* @scale_width: The minimum horizontal size of the #GtkHScale.
* @spinbutton_width: The minimum horizontal size of the #GtkSpinButton.
* @value: The initial value.
* @lower: The lower boundary.
* @upper: The upper boundary.
* @step_increment: The step increment.
* @page_increment: The page increment.
* @digits: The number of decimal digits.
* @tooltip: A tooltip message for the scale and the spinbutton.
* @help_id: The widgets' help_id (see gimp_help_set_help_data()).
*
* This function creates a #GtkLabel, a #GimpColorScale and a
* #GtkSpinButton and attaches them to a 3-column #GtkTable.
*
* Returns: The #GtkSpinButton's #GtkAdjustment.
**/
GtkAdjustment *
gimp_color_scale_entry_new (GtkTable *table,
gint column,
gint row,
const gchar *text,
gint scale_width,
gint spinbutton_width,
gdouble value,
gdouble lower,
gdouble upper,
gdouble step_increment,
gdouble page_increment,
guint digits,
const gchar *tooltip,
const gchar *help_id)
{
return gimp_scale_entry_new_internal (TRUE,
GTK_WIDGET (table), column, row,
text, scale_width, spinbutton_width,
value, lower, upper,
step_increment, page_increment,
digits,
TRUE, 0.0, 0.0,
tooltip, help_id);
}
/**
* gimp_color_scale_entry_new_grid:
* @grid: The #GtkGrid the widgets will be attached to.
@ -439,7 +309,7 @@ gimp_color_scale_entry_new_grid (GtkGrid *grid,
const gchar *help_id)
{
return gimp_scale_entry_new_internal (TRUE,
GTK_WIDGET (grid), column, row,
grid, column, row,
text, scale_width, spinbutton_width,
value, lower, upper,
step_increment, page_increment,

View file

@ -78,24 +78,6 @@ G_BEGIN_DECLS
(GTK_SPIN_BUTTON (g_object_get_data (G_OBJECT (adj), "spinbutton")))
GtkAdjustment * gimp_scale_entry_new (GtkTable *table,
gint column,
gint row,
const gchar *text,
gint scale_width,
gint spinbutton_width,
gdouble value,
gdouble lower,
gdouble upper,
gdouble step_increment,
gdouble page_increment,
guint digits,
gboolean constrain,
gdouble unconstrained_lower,
gdouble unconstrained_upper,
const gchar *tooltip,
const gchar *help_id);
GtkAdjustment * gimp_scale_entry_new_grid (GtkGrid *grid,
gint column,
gint row,
@ -114,21 +96,6 @@ GtkAdjustment * gimp_scale_entry_new_grid (GtkGrid *grid,
const gchar *tooltip,
const gchar *help_id);
GtkAdjustment * gimp_color_scale_entry_new (GtkTable *table,
gint column,
gint row,
const gchar *text,
gint scale_width,
gint spinbutton_width,
gdouble value,
gdouble lower,
gdouble upper,
gdouble step_increment,
gdouble page_increment,
guint digits,
const gchar *tooltip,
const gchar *help_id);
GtkAdjustment * gimp_color_scale_entry_new_grid (GtkGrid *grid,
gint column,
gint row,

View file

@ -103,77 +103,6 @@ find_mnemonic_widget (GtkWidget *widget,
return NULL;
}
/**
* gimp_table_attach_aligned:
* @table: The #GtkTable the widgets will be attached to.
* @column: The column to start with.
* @row: The row to attach the widgets.
* @label_text: The text for the #GtkLabel which will be attached left of
* the widget.
* @xalign: The horizontal alignment of the #GtkLabel.
* @yalign: The vertical alignment of the #GtkLabel.
* @widget: The #GtkWidget to attach right of the label.
* @colspan: The number of columns the widget will use.
* @left_align: %TRUE if the widget should be left-aligned.
*
* Note that the @label_text can be %NULL and that the widget will be
* attached starting at (@column + 1) in this case, too.
*
* Returns: The created #GtkLabel.
**/
GtkWidget *
gimp_table_attach_aligned (GtkTable *table,
gint column,
gint row,
const gchar *label_text,
gfloat xalign,
gfloat yalign,
GtkWidget *widget,
gint colspan,
gboolean left_align)
{
GtkWidget *label = NULL;
if (label_text)
{
GtkWidget *mnemonic_widget;
label = gtk_label_new_with_mnemonic (label_text);
gtk_label_set_xalign (GTK_LABEL (label), xalign);
gtk_label_set_yalign (GTK_LABEL (label), yalign);
gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
gtk_table_attach (table, label,
column, column + 1,
row, row + 1,
GTK_FILL, GTK_FILL, 0, 0);
gtk_widget_show (label);
mnemonic_widget = find_mnemonic_widget (widget, 0);
if (mnemonic_widget)
gtk_label_set_mnemonic_widget (GTK_LABEL (label), mnemonic_widget);
}
if (left_align)
{
GtkWidget *hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_box_pack_start (GTK_BOX (hbox), widget, FALSE, FALSE, 0);
gtk_widget_show (widget);
widget = hbox;
}
gtk_table_attach (table, widget,
column + 1, column + 1 + colspan,
row, row + 1,
GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
gtk_widget_show (widget);
return label;
}
/**
* gimp_grid_attach_aligned:
* @grid: The #GtkGrid the widgets will be attached to.

View file

@ -30,15 +30,6 @@ G_BEGIN_DECLS
/* For information look into the C source or the html documentation */
GtkWidget * gimp_table_attach_aligned (GtkTable *table,
gint column,
gint row,
const gchar *label_text,
gfloat xalign,
gfloat yalign,
GtkWidget *widget,
gint colspan,
gboolean left_align);
GtkWidget * gimp_grid_attach_aligned (GtkGrid *grid,
gint left,
gint top,