Skip to content

Commit

Permalink
Fix some comments in overlay
Browse files Browse the repository at this point in the history
  • Loading branch information
elkowar committed May 26, 2022
1 parent c855ec0 commit a85d35d
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions crates/eww/src/widgets/widget_definitions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -518,14 +518,11 @@ fn build_gtk_box(bargs: &mut BuilderArgs) -> Result<gtk::Box> {

const WIDGET_NAME_OVERLAY: &str = "overlay";
/// @widget overlay
/// @desc a widget that places its children on top of each other. The overlay widget takes the size
/// of its first child.
/// @desc a widget that places its children on top of each other. The overlay widget takes the size of its first child.
fn build_gtk_overlay(bargs: &mut BuilderArgs) -> Result<gtk::Overlay> {
let gtk_widget = gtk::Overlay::new();

// 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) {
Ordering::Less => {
Expand All @@ -541,7 +538,7 @@ fn build_gtk_overlay(bargs: &mut BuilderArgs) -> Result<gtk::Overlay> {
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()?;
gtk_widget.add(&first);
first.show();
Expand Down

0 comments on commit a85d35d

Please sign in to comment.