Fix some comments in overlay

This commit is contained in:
elkowar 2022-05-26 13:41:30 +02:00
parent c855ec07d5
commit a85d35d919
No known key found for this signature in database
GPG key ID: E321AD71B1D1F27F

View file

@ -518,14 +518,11 @@ fn build_gtk_box(bargs: &mut BuilderArgs) -> Result<gtk::Box> {
const WIDGET_NAME_OVERLAY: &str = "overlay"; const WIDGET_NAME_OVERLAY: &str = "overlay";
/// @widget overlay /// @widget overlay
/// @desc a widget that places its children on top of each other. The overlay widget takes the size /// @desc a widget that places its children on top of each other. The overlay widget takes the size of its first child.
/// of its first child.
fn build_gtk_overlay(bargs: &mut BuilderArgs) -> Result<gtk::Overlay> { fn build_gtk_overlay(bargs: &mut BuilderArgs) -> Result<gtk::Overlay> {
let gtk_widget = gtk::Overlay::new(); let gtk_widget = gtk::Overlay::new();
// no def_widget because this widget has no props. // no def_widget because this widget has no props.
// And this widget has no proprs because they would pretty much just be the same as boxes,
// so you might as well just use a box inside the widget to get them.
match bargs.widget_use.children.len().cmp(&1) { match bargs.widget_use.children.len().cmp(&1) {
Ordering::Less => { Ordering::Less => {
@ -541,7 +538,7 @@ fn build_gtk_overlay(bargs: &mut BuilderArgs) -> Result<gtk::Overlay> {
bargs.custom_widget_invocation.clone(), bargs.custom_widget_invocation.clone(),
) )
}); });
// we have more than one children, we can unwrap // we have more than one child, we can unwrap
let first = children.next().unwrap()?; let first = children.next().unwrap()?;
gtk_widget.add(&first); gtk_widget.add(&first);
first.show(); first.show();