Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Bottom Sheet demo #210

Merged
merged 3 commits into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 74 additions & 0 deletions src/Bottom Sheet/main.blp
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
using Gtk 4.0;
using Adw 1;

Adw.Bin {
Adw.BottomSheet bottom_sheet {
bottom-bar: Label {
label: "Bottom Bar";
Nokse22 marked this conversation as resolved.
Show resolved Hide resolved
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";
}
Nokse22 marked this conversation as resolved.
Show resolved Hide resolved

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";
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add a switch for https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/property.BottomSheet.reveal-bottom-bar.html ?

I believe opening the sheet programmatically without a handle is going to be a common use case.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This property will be added in 1.7 so it can't land in 47. Maybe I can say somewhere that the bottom bar is optional

};
}
};

description: "Display content with a bottom sheet";
title: "Bottom Sheet";
Nokse22 marked this conversation as resolved.
Show resolved Hide resolved
};

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";
Nokse22 marked this conversation as resolved.
Show resolved Hide resolved
};
}
}
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
}
Loading