Skip to content

Commit

Permalink
docs: improve button and eventbox documentation
Browse files Browse the repository at this point in the history
Co-authored-by: Julian Schuler <[email protected]>
  • Loading branch information
w-lfchen and julianschuler committed Sep 3, 2024
1 parent 8fe2f12 commit 489690f
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions crates/eww/src/widgets/widget_definitions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -518,19 +518,19 @@ fn build_gtk_input(bargs: &mut BuilderArgs) -> Result<gtk::Entry> {

const WIDGET_NAME_BUTTON: &str = "button";
/// @widget button
/// @desc A button
/// @desc A button containing any widget as it's child. Events are triggered on release.
fn build_gtk_button(bargs: &mut BuilderArgs) -> Result<gtk::Button> {
let gtk_widget = gtk::Button::new();

def_widget!(bargs, _g, gtk_widget, {
prop(
// @prop timeout - timeout of the command. Default: "200ms"
timeout: as_duration = Duration::from_millis(200),
// @prop onclick - a command that get's run when the button is clicked
// @prop onclick - command to run when the button is activated either by leftclicking or keyboard
onclick: as_string = "",
// @prop onmiddleclick - a command that get's run when the button is middleclicked
// @prop onmiddleclick - command to run when the button is middleclicked
onmiddleclick: as_string = "",
// @prop onrightclick - a command that get's run when the button is rightclicked
// @prop onrightclick - command to run when the button is rightclicked
onrightclick: as_string = ""
) {
// animate button upon right-/middleclick (if gtk theme supports it)
Expand Down Expand Up @@ -934,11 +934,11 @@ fn build_gtk_event_box(bargs: &mut BuilderArgs) -> Result<gtk::EventBox> {
prop(
// @prop timeout - timeout of the command. Default: "200ms"
timeout: as_duration = Duration::from_millis(200),
// @prop onclick - a command that get's run when the button is clicked
// @prop onclick - command to run when the widget is clicked
onclick: as_string = "",
// @prop onmiddleclick - a command that get's run when the button is middleclicked
// @prop onmiddleclick - command to run when the widget is middleclicked
onmiddleclick: as_string = "",
// @prop onrightclick - a command that get's run when the button is rightclicked
// @prop onrightclick - command to run when the widget is rightclicked
onrightclick: as_string = ""
) {
gtk_widget.add_events(gdk::EventMask::BUTTON_PRESS_MASK);
Expand Down

0 comments on commit 489690f

Please sign in to comment.