gtkplacesviewrow: stop busy_spinner from offsetting the other widgets when visible

...by putting it in a stack. The busy_spinner and eject_button are
mutually exclusive, but only the latter was coded to ensure that its
visibility did not cause the rest of the row to reflow. By putting both
widgets in a stack and setting child_visible on that, the row allocates
enough space to show one - or none - at once, avoiding any misalignment.

https://bugzilla.gnome.org/show_bug.cgi?id=772345

https://bugzilla.gnome.org/show_bug.cgi?id=772348
This commit is contained in:
djb
2016-10-02 23:16:46 +01:00
committed by Matthias Clasen
parent 19aa3a4fca
commit bfc6287910
2 changed files with 47 additions and 29 deletions

View File

@ -60,35 +60,42 @@
</packing>
</child>
<child>
<object class="GtkButton" id="eject_button">
<object class="GtkStack" id="mount_stack">
<property name="visible">1</property>
<property name="halign">end</property>
<property name="valign">center</property>
<property name="tooltip-text" translatable="yes">Unmount</property>
<property name="hhomogeneous">1</property>
<property name="vhomogeneous">1</property>
<child>
<object class="GtkImage" id="eject_icon">
<object class="GtkButton" id="eject_button">
<property name="visible">1</property>
<property name="icon-name">media-eject-symbolic</property>
<property name="icon-size">1</property>
<property name="halign">center</property>
<property name="valign">center</property>
<property name="tooltip-text" translatable="yes">Unmount</property>
<child>
<object class="GtkImage" id="eject_icon">
<property name="visible">1</property>
<property name="icon-name">media-eject-symbolic</property>
<property name="icon-size">1</property>
</object>
</child>
<style>
<class name="image-button"/>
<class name="sidebar-button"/>
</style>
</object>
</child>
<child>
<object class="GtkSpinner" id="busy_spinner">
<property name="visible">1</property>
<property name="active">1</property>
<property name="halign">center</property>
<property name="valign">center</property>
</object>
</child>
<style>
<class name="image-button"/>
<class name="sidebar-button"/>
</style>
</object>
<packing>
<property name="position">4</property>
</packing>
</child>
<child>
<object class="GtkSpinner" id="busy_spinner">
<property name="active">1</property>
</object>
<packing>
<property name="position">5</property>
</packing>
</child>
</object>
</child>
</object>