Expand description
Rust Handy bindings
This library contains safe Rust bindings for Handy, a library that offers building blocks for modern adaptive GNOME applications.
See also
Example
use gtk::prelude::*;
use gtk::{Application, Box, ListBox, Orientation};
use libhandy::prelude::*;
use libhandy::{ActionRow, ApplicationWindow, HeaderBar};
fn main() {
let application = Application::builder()
.application_id("com.example.FirstHandyApp")
.build();
application.connect_activate(|app| {
libhandy::init();
// ActionRows are only available in Handy
let row = ActionRow::builder()
.activatable(true)
.selectable(false)
.margin(32)
.title("Click me")
.build();
row.connect_activated(|_| {
eprintln!("Clicked!");
});
let list = ListBox::builder().child(&row).build();
// the content class makes the list look nicer
list.style_context().add_class("content");
// Combine the content in a box
let content = Box::new(Orientation::Vertical, 0);
// Handy's ApplicationWindow does not include a HeaderBar
content.add(
&HeaderBar::builder()
.show_close_button(true)
.title("First Handy Program")
.build(),
);
content.add(&list);
let window = ApplicationWindow::builder()
.default_width(350)
.default_height(70)
// add content to window
.child(&content)
.build();
window.set_application(Some(app));
window.show_all();
});
application.run();
}
Modules
Structs
- A
gtk::ListBoxRow
used to present actions. - A freeform application window.
- A widget displaying an image, with a generated fallback.
- A paginated scrolling widget.
- A dots indicator for
Carousel
. - A lines indicator for
Carousel
. - A widget constraining its child to a given size.
- A
gtk::ListBoxRow
used to choose from a list of items. - A swipeable widget showing one of the visible children at a time.
- An object representing an
GObject::EnumValue
. - A
gtk::ListBoxRow
used to reveal widgets. - Flap
v1_2
An adaptive container acting like a box or an overlay. - A title bar widget.
- An object handling composite title bars.
- A child object for
HeaderGroup
. - A keypad for dialing numbers
- An adaptive container acting like a box or a stack.
- A group of preference rows.
- A page from
PreferencesWindow
. - A
gtk::ListBoxRow
used to present preferences. - A window to present an application’s preferences.
- A toolbar to integrate a search entry with.
- A best fit container.
- StatusPage
v1_2
A page used for empty/error states and similar use-cases. - StyleManager
v1_6
A class for managing application-wide styling. - SwipeGroupDeprecatedAn object for syncing swipeable widgets.
- An interface for swipeable widgets.
- TabBar
v1_2
A tab bar forTabView
. - TabPage
v1_2
An auxiliary class used byTabView
. - TabView
v1_2
A dynamic tabbed container. - TitleBarDeprecatedA simple title bar container.
- An object representing a
glib::Value
. - An adaptive view switcher.
- A view switcher action bar.
- A view switcher title.
- A freeform window.
- A bin that acts like a titlebar.
Enums
- Describes title centering behavior of a
HeaderBar
widget. - ColorScheme
v1_6
Application color schemes forcolor-scheme
. - Describes the possible transitions in a
Deck
widget. - FlapFoldPolicy
v1_2
Describes the possible folding behavior of aFlap
widget. - Describes transitions types of a
Flap
widget. - Describes the child types handled by
HeaderGroup
. - Describes the possible transitions in a
Leaflet
widget. - Describes the direction of a swipe navigation gesture.
- Describes the possible transitions in a
Squeezer
widget. - Describes the adaptive modes of
ViewSwitcher
.
Functions
- Computes the ease out for a value.
- Checks whether animations are enabled for @widget.
- Initializes Libhandy.