ArcticaProject / arctica-greeter

Arctica Greeter: Greeter Frontend for LightDM
GNU General Public License v3.0
27 stars 8 forks source link

src/shutdown-dialog.vala: keep dialog size fixed. #60

Closed Ionic closed 1 year ago

Ionic commented 1 year ago

Previously, the dialog resized whenever the timer was shown or hidden.

We want to avoid this, but unfortunately, GTK doesn't provide a way to hide a widget and retain its size in the parent (for instance, a container).

To work around this, create a new private class FakeHideLabel, subclassing Gtk.Label, that exposes a fake_hide () property. If the property is set to true, the widget is "fake hidden" by changing the draw () method to first draw normally, and then paint everything fully transparent.

The usual hide () and show () methods are not used any longer (other than at widget creation).

Additionally, a dummy text is inserted at widget creation, including setting the widget to "fake hidden", so that text line actually has a size.

While this should work fine visually, this WILL definitely create accessibility issues, which we must fix at a later time.

Fixes: https://github.com/ArcticaProject/arctica-greeter/issues/58