[virt-tools-list] [virt-manager PATCH 7/8] GtkTable

Pavel Hrdina phrdina at redhat.com
Tue May 30 11:11:07 UTC 2017


On Sun, May 28, 2017 at 05:55:25PM +0100, Radostin Stoyanov wrote:
> GtkTable was deprecated since Gtk version 3.4 and should not be used in newly-written code.
> 
> It should be replaced by GtkGrid. One major difference between GtkTable and GtkGrid are the child properties used, for GtkGrid these are only "left-attach", "top-attach", "width" and "height". Another difference is GtkGrid does not requre the number of row/columns to be specified.
> 
> https://developer.gnome.org/gtk3/stable/GtkTable.html
> https://developer.gnome.org/gtk3/stable/GtkGrid.html

This change is not that obvious.  It would be nice to mention in
the commit message how the properties of GtkTable is mapped to GtkGrid.
For example:

    - n_(row|columns) are removed because they are not required for
      GtkGrid

    - (right_attach - left_attach) > 1 is stored in new "width" property

    - (bottom_attach - top_attach) > 1 is stored in new "height"
      property

    - missing packing "(x|y)_options" property is represented as no
      "(h|v)align" object property and "(h|v)expand" object property
      set to "true"

    - packing "(x|y)_options" property set to "GTK_FILL" is represented
      as no "(h|v)expand" object property and no "(h|v)align" object
      property

    - packing "(x|y)_options" property set to "GTK_EXPAND" is
      represented as "(h|v)expand" object property set to "true" and
      "(h|v)align" object property set to "center"

    - packing "(x|y)_options" property set to nothing is represented as
      "(h|v)align" object property set to "center"

    - all "(x|y)_options" rules apply but don't change existing
      "(h|v)align" and "(h|v)expand" object properties

    - packing "x_padding" property is converted to "margin_(left|right)"
      object property

    - packing "y_padding" property is converted to "margin_(tob|bottom)"
      object property


From the review not all changes follows the rules listed above.

> ---
>  ui/addhardware.ui     |  87 +++++++----------
>  ui/choosecd.ui        |  33 ++-----
>  ui/clone.ui           | 140 +++++++++-------------------
>  ui/create.ui          | 161 ++++++++++----------------------
>  ui/createinterface.ui | 169 +++++++++------------------------
>  ui/createnet.ui       |   9 +-
>  ui/details.ui         | 251 +++++++++++---------------------------------------
>  ui/host.ui            |  81 +++++-----------
>  ui/netlist.ui         |  46 ++-------
>  9 files changed, 270 insertions(+), 707 deletions(-)
> 
> diff --git a/ui/addhardware.ui b/ui/addhardware.ui
> index 2cf387e..1ecb61a 100644
> --- a/ui/addhardware.ui
> +++ b/ui/addhardware.ui
> @@ -554,12 +554,11 @@
>                            </packing>
>                          </child>
>                          <child>
> -                          <object class="GtkTable" id="table33">
> +                          <object class="GtkGrid" id="table33">
>                              <property name="visible">True</property>
>                              <property name="can_focus">False</property>
> -                            <property name="n_columns">2</property>
> -                            <property name="column_spacing">6</property>
>                              <property name="row_spacing">6</property>
> +                            <property name="column_spacing">6</property>
>                              <child>
>                                <object class="GtkLabel" id="label395">
>                                  <property name="visible">True</property>

[1]

> @@ -570,8 +569,8 @@
>                                  <property name="mnemonic_widget">input-type</property>
>                                </object>
>                                <packing>
> -                                <property name="x_options">GTK_FILL</property>
> -                                <property name="y_options"/>

Here you remove the "y_options" but there [1] is no
<property name="valign">center</property>.

Pavel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/virt-tools-list/attachments/20170530/70009af9/attachment.sig>


More information about the virt-tools-list mailing list