Skip to content

Commit

Permalink
Added Bottom Sheet demo
Browse files Browse the repository at this point in the history
  • Loading branch information
Nokse22 committed Oct 8, 2024
1 parent 13af95a commit 33898e2
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 0 deletions.
72 changes: 72 additions & 0 deletions src/Bottom Sheet/main.blp
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
using Gtk 4.0;
using Adw 1;

Adw.Bin {
Adw.BottomSheet bottom_sheet {
bottom-bar: Label {
label: "Bottom Bar";
margin-bottom: 12;
margin-end: 12;
margin-start: 12;
margin-top: 12;
};

content: Adw.StatusPage {
child: Box {
orientation: vertical;
spacing: 12;
halign: center;
LinkButton {
label: _("API Reference");
uri: "https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.BottomSheet.html";
}
Adw.Clamp {
child: Adw.PreferencesGroup {
Adw.SwitchRow {
active: bind bottom_sheet.full-width bidirectional;
title: "Full Width";
}

Adw.SwitchRow {
active: bind bottom_sheet.can-open bidirectional;
title: "Can Open";
}

Adw.SwitchRow {
active: bind bottom_sheet.open bidirectional;
title: "Open";
}
};
}
};

description: "Display content with a bottom sheet";
title: "Bottom Sheet";
};

sheet: Adw.StatusPage {
width-request: 360;

child: Adw.Clamp {
child: Adw.PreferencesGroup {
Adw.SwitchRow {
active: bind bottom_sheet.can-close bidirectional;
title: "Can Close";
}

Adw.SwitchRow {
active: bind bottom_sheet.show-drag-handle bidirectional;
title: "Show Drag Handle";
}

Adw.SwitchRow {
active: bind bottom_sheet.modal bidirectional;
title: "Modal";
}
};
};

title: "Sheet";
};
}
}
6 changes: 6 additions & 0 deletions src/Bottom Sheet/main.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"category": "layout",
"description": "Display content with a bottom sheet",
"panels": ["ui", "preview"],
"autorun": true
}

0 comments on commit 33898e2

Please sign in to comment.