1 // This file was generated by gir (https://github.com/gtk-rs/gir) 2 // from gir-files (https://github.com/gtk-rs/gir-files) 3 // DO NOT EDIT 4 5 use crate::Align; 6 use crate::BaselinePosition; 7 use crate::Box; 8 use crate::Buildable; 9 use crate::Container; 10 use crate::Orientable; 11 use crate::Orientation; 12 use crate::ResizeMode; 13 use crate::Widget; 14 use glib::object::Cast; 15 use glib::object::IsA; 16 use glib::object::ObjectExt; 17 use glib::object::ObjectType as ObjectType_; 18 use glib::signal::connect_raw; 19 use glib::signal::SignalHandlerId; 20 use glib::translate::*; 21 use glib::StaticType; 22 use glib::ToValue; 23 use std::boxed::Box as Box_; 24 use std::fmt; 25 use std::mem::transmute; 26 27 glib::wrapper! { 28 #[doc(alias = "GtkShortcutsSection")] 29 pub struct ShortcutsSection(Object<ffi::GtkShortcutsSection, ffi::GtkShortcutsSectionClass>) @extends Box, Container, Widget, @implements Buildable, Orientable; 30 31 match fn { 32 type_ => || ffi::gtk_shortcuts_section_get_type(), 33 } 34 } 35 36 impl ShortcutsSection { 37 // rustdoc-stripper-ignore-next 38 /// Creates a new builder-pattern struct instance to construct [`ShortcutsSection`] objects. 39 /// 40 /// This method returns an instance of [`ShortcutsSectionBuilder`] which can be used to create [`ShortcutsSection`] objects. builder() -> ShortcutsSectionBuilder41 pub fn builder() -> ShortcutsSectionBuilder { 42 ShortcutsSectionBuilder::default() 43 } 44 45 #[doc(alias = "max-height")] max_height(&self) -> u3246 pub fn max_height(&self) -> u32 { 47 unsafe { 48 let mut value = glib::Value::from_type(<u32 as StaticType>::static_type()); 49 glib::gobject_ffi::g_object_get_property( 50 self.as_ptr() as *mut glib::gobject_ffi::GObject, 51 b"max-height\0".as_ptr() as *const _, 52 value.to_glib_none_mut().0, 53 ); 54 value 55 .get() 56 .expect("Return Value for property `max-height` getter") 57 } 58 } 59 60 #[doc(alias = "max-height")] set_max_height(&self, max_height: u32)61 pub fn set_max_height(&self, max_height: u32) { 62 unsafe { 63 glib::gobject_ffi::g_object_set_property( 64 self.as_ptr() as *mut glib::gobject_ffi::GObject, 65 b"max-height\0".as_ptr() as *const _, 66 max_height.to_value().to_glib_none().0, 67 ); 68 } 69 } 70 71 #[doc(alias = "section-name")] section_name(&self) -> Option<glib::GString>72 pub fn section_name(&self) -> Option<glib::GString> { 73 unsafe { 74 let mut value = glib::Value::from_type(<glib::GString as StaticType>::static_type()); 75 glib::gobject_ffi::g_object_get_property( 76 self.as_ptr() as *mut glib::gobject_ffi::GObject, 77 b"section-name\0".as_ptr() as *const _, 78 value.to_glib_none_mut().0, 79 ); 80 value 81 .get() 82 .expect("Return Value for property `section-name` getter") 83 } 84 } 85 86 #[doc(alias = "section-name")] set_section_name(&self, section_name: Option<&str>)87 pub fn set_section_name(&self, section_name: Option<&str>) { 88 unsafe { 89 glib::gobject_ffi::g_object_set_property( 90 self.as_ptr() as *mut glib::gobject_ffi::GObject, 91 b"section-name\0".as_ptr() as *const _, 92 section_name.to_value().to_glib_none().0, 93 ); 94 } 95 } 96 title(&self) -> Option<glib::GString>97 pub fn title(&self) -> Option<glib::GString> { 98 unsafe { 99 let mut value = glib::Value::from_type(<glib::GString as StaticType>::static_type()); 100 glib::gobject_ffi::g_object_get_property( 101 self.as_ptr() as *mut glib::gobject_ffi::GObject, 102 b"title\0".as_ptr() as *const _, 103 value.to_glib_none_mut().0, 104 ); 105 value 106 .get() 107 .expect("Return Value for property `title` getter") 108 } 109 } 110 set_title(&self, title: Option<&str>)111 pub fn set_title(&self, title: Option<&str>) { 112 unsafe { 113 glib::gobject_ffi::g_object_set_property( 114 self.as_ptr() as *mut glib::gobject_ffi::GObject, 115 b"title\0".as_ptr() as *const _, 116 title.to_value().to_glib_none().0, 117 ); 118 } 119 } 120 121 #[doc(alias = "view-name")] view_name(&self) -> Option<glib::GString>122 pub fn view_name(&self) -> Option<glib::GString> { 123 unsafe { 124 let mut value = glib::Value::from_type(<glib::GString as StaticType>::static_type()); 125 glib::gobject_ffi::g_object_get_property( 126 self.as_ptr() as *mut glib::gobject_ffi::GObject, 127 b"view-name\0".as_ptr() as *const _, 128 value.to_glib_none_mut().0, 129 ); 130 value 131 .get() 132 .expect("Return Value for property `view-name` getter") 133 } 134 } 135 136 #[doc(alias = "view-name")] set_view_name(&self, view_name: Option<&str>)137 pub fn set_view_name(&self, view_name: Option<&str>) { 138 unsafe { 139 glib::gobject_ffi::g_object_set_property( 140 self.as_ptr() as *mut glib::gobject_ffi::GObject, 141 b"view-name\0".as_ptr() as *const _, 142 view_name.to_value().to_glib_none().0, 143 ); 144 } 145 } 146 147 #[doc(alias = "change-current-page")] connect_change_current_page<F: Fn(&Self, i32) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId148 pub fn connect_change_current_page<F: Fn(&Self, i32) -> bool + 'static>( 149 &self, 150 f: F, 151 ) -> SignalHandlerId { 152 unsafe extern "C" fn change_current_page_trampoline< 153 F: Fn(&ShortcutsSection, i32) -> bool + 'static, 154 >( 155 this: *mut ffi::GtkShortcutsSection, 156 object: libc::c_int, 157 f: glib::ffi::gpointer, 158 ) -> glib::ffi::gboolean { 159 let f: &F = &*(f as *const F); 160 f(&from_glib_borrow(this), object).into_glib() 161 } 162 unsafe { 163 let f: Box_<F> = Box_::new(f); 164 connect_raw( 165 self.as_ptr() as *mut _, 166 b"change-current-page\0".as_ptr() as *const _, 167 Some(transmute::<_, unsafe extern "C" fn()>( 168 change_current_page_trampoline::<F> as *const (), 169 )), 170 Box_::into_raw(f), 171 ) 172 } 173 } 174 emit_change_current_page(&self, object: i32) -> bool175 pub fn emit_change_current_page(&self, object: i32) -> bool { 176 let res = unsafe { 177 glib::Object::from_glib_borrow(self.as_ptr() as *mut glib::gobject_ffi::GObject) 178 .emit_by_name("change-current-page", &[&object]) 179 .unwrap() 180 }; 181 res.unwrap() 182 .get() 183 .expect("Return Value for `emit_change_current_page`") 184 } 185 186 #[doc(alias = "max-height")] connect_max_height_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId187 pub fn connect_max_height_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 188 unsafe extern "C" fn notify_max_height_trampoline<F: Fn(&ShortcutsSection) + 'static>( 189 this: *mut ffi::GtkShortcutsSection, 190 _param_spec: glib::ffi::gpointer, 191 f: glib::ffi::gpointer, 192 ) { 193 let f: &F = &*(f as *const F); 194 f(&from_glib_borrow(this)) 195 } 196 unsafe { 197 let f: Box_<F> = Box_::new(f); 198 connect_raw( 199 self.as_ptr() as *mut _, 200 b"notify::max-height\0".as_ptr() as *const _, 201 Some(transmute::<_, unsafe extern "C" fn()>( 202 notify_max_height_trampoline::<F> as *const (), 203 )), 204 Box_::into_raw(f), 205 ) 206 } 207 } 208 209 #[doc(alias = "section-name")] connect_section_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId210 pub fn connect_section_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 211 unsafe extern "C" fn notify_section_name_trampoline<F: Fn(&ShortcutsSection) + 'static>( 212 this: *mut ffi::GtkShortcutsSection, 213 _param_spec: glib::ffi::gpointer, 214 f: glib::ffi::gpointer, 215 ) { 216 let f: &F = &*(f as *const F); 217 f(&from_glib_borrow(this)) 218 } 219 unsafe { 220 let f: Box_<F> = Box_::new(f); 221 connect_raw( 222 self.as_ptr() as *mut _, 223 b"notify::section-name\0".as_ptr() as *const _, 224 Some(transmute::<_, unsafe extern "C" fn()>( 225 notify_section_name_trampoline::<F> as *const (), 226 )), 227 Box_::into_raw(f), 228 ) 229 } 230 } 231 232 #[doc(alias = "title")] connect_title_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId233 pub fn connect_title_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 234 unsafe extern "C" fn notify_title_trampoline<F: Fn(&ShortcutsSection) + 'static>( 235 this: *mut ffi::GtkShortcutsSection, 236 _param_spec: glib::ffi::gpointer, 237 f: glib::ffi::gpointer, 238 ) { 239 let f: &F = &*(f as *const F); 240 f(&from_glib_borrow(this)) 241 } 242 unsafe { 243 let f: Box_<F> = Box_::new(f); 244 connect_raw( 245 self.as_ptr() as *mut _, 246 b"notify::title\0".as_ptr() as *const _, 247 Some(transmute::<_, unsafe extern "C" fn()>( 248 notify_title_trampoline::<F> as *const (), 249 )), 250 Box_::into_raw(f), 251 ) 252 } 253 } 254 255 #[doc(alias = "view-name")] connect_view_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId256 pub fn connect_view_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 257 unsafe extern "C" fn notify_view_name_trampoline<F: Fn(&ShortcutsSection) + 'static>( 258 this: *mut ffi::GtkShortcutsSection, 259 _param_spec: glib::ffi::gpointer, 260 f: glib::ffi::gpointer, 261 ) { 262 let f: &F = &*(f as *const F); 263 f(&from_glib_borrow(this)) 264 } 265 unsafe { 266 let f: Box_<F> = Box_::new(f); 267 connect_raw( 268 self.as_ptr() as *mut _, 269 b"notify::view-name\0".as_ptr() as *const _, 270 Some(transmute::<_, unsafe extern "C" fn()>( 271 notify_view_name_trampoline::<F> as *const (), 272 )), 273 Box_::into_raw(f), 274 ) 275 } 276 } 277 } 278 279 #[derive(Clone, Default)] 280 // rustdoc-stripper-ignore-next 281 /// A [builder-pattern] type to construct [`ShortcutsSection`] objects. 282 /// 283 /// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html 284 pub struct ShortcutsSectionBuilder { 285 max_height: Option<u32>, 286 section_name: Option<String>, 287 title: Option<String>, 288 view_name: Option<String>, 289 baseline_position: Option<BaselinePosition>, 290 homogeneous: Option<bool>, 291 spacing: Option<i32>, 292 border_width: Option<u32>, 293 child: Option<Widget>, 294 resize_mode: Option<ResizeMode>, 295 app_paintable: Option<bool>, 296 can_default: Option<bool>, 297 can_focus: Option<bool>, 298 events: Option<gdk::EventMask>, 299 expand: Option<bool>, 300 #[cfg(any(feature = "v3_20", feature = "dox"))] 301 #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_20")))] 302 focus_on_click: Option<bool>, 303 halign: Option<Align>, 304 has_default: Option<bool>, 305 has_focus: Option<bool>, 306 has_tooltip: Option<bool>, 307 height_request: Option<i32>, 308 hexpand: Option<bool>, 309 hexpand_set: Option<bool>, 310 is_focus: Option<bool>, 311 margin: Option<i32>, 312 margin_bottom: Option<i32>, 313 margin_end: Option<i32>, 314 margin_start: Option<i32>, 315 margin_top: Option<i32>, 316 name: Option<String>, 317 no_show_all: Option<bool>, 318 opacity: Option<f64>, 319 parent: Option<Container>, 320 receives_default: Option<bool>, 321 sensitive: Option<bool>, 322 tooltip_markup: Option<String>, 323 tooltip_text: Option<String>, 324 valign: Option<Align>, 325 vexpand: Option<bool>, 326 vexpand_set: Option<bool>, 327 visible: Option<bool>, 328 width_request: Option<i32>, 329 orientation: Option<Orientation>, 330 } 331 332 impl ShortcutsSectionBuilder { 333 // rustdoc-stripper-ignore-next 334 /// Create a new [`ShortcutsSectionBuilder`]. new() -> Self335 pub fn new() -> Self { 336 Self::default() 337 } 338 339 // rustdoc-stripper-ignore-next 340 /// Build the [`ShortcutsSection`]. build(self) -> ShortcutsSection341 pub fn build(self) -> ShortcutsSection { 342 let mut properties: Vec<(&str, &dyn ToValue)> = vec![]; 343 if let Some(ref max_height) = self.max_height { 344 properties.push(("max-height", max_height)); 345 } 346 if let Some(ref section_name) = self.section_name { 347 properties.push(("section-name", section_name)); 348 } 349 if let Some(ref title) = self.title { 350 properties.push(("title", title)); 351 } 352 if let Some(ref view_name) = self.view_name { 353 properties.push(("view-name", view_name)); 354 } 355 if let Some(ref baseline_position) = self.baseline_position { 356 properties.push(("baseline-position", baseline_position)); 357 } 358 if let Some(ref homogeneous) = self.homogeneous { 359 properties.push(("homogeneous", homogeneous)); 360 } 361 if let Some(ref spacing) = self.spacing { 362 properties.push(("spacing", spacing)); 363 } 364 if let Some(ref border_width) = self.border_width { 365 properties.push(("border-width", border_width)); 366 } 367 if let Some(ref child) = self.child { 368 properties.push(("child", child)); 369 } 370 if let Some(ref resize_mode) = self.resize_mode { 371 properties.push(("resize-mode", resize_mode)); 372 } 373 if let Some(ref app_paintable) = self.app_paintable { 374 properties.push(("app-paintable", app_paintable)); 375 } 376 if let Some(ref can_default) = self.can_default { 377 properties.push(("can-default", can_default)); 378 } 379 if let Some(ref can_focus) = self.can_focus { 380 properties.push(("can-focus", can_focus)); 381 } 382 if let Some(ref events) = self.events { 383 properties.push(("events", events)); 384 } 385 if let Some(ref expand) = self.expand { 386 properties.push(("expand", expand)); 387 } 388 #[cfg(any(feature = "v3_20", feature = "dox"))] 389 if let Some(ref focus_on_click) = self.focus_on_click { 390 properties.push(("focus-on-click", focus_on_click)); 391 } 392 if let Some(ref halign) = self.halign { 393 properties.push(("halign", halign)); 394 } 395 if let Some(ref has_default) = self.has_default { 396 properties.push(("has-default", has_default)); 397 } 398 if let Some(ref has_focus) = self.has_focus { 399 properties.push(("has-focus", has_focus)); 400 } 401 if let Some(ref has_tooltip) = self.has_tooltip { 402 properties.push(("has-tooltip", has_tooltip)); 403 } 404 if let Some(ref height_request) = self.height_request { 405 properties.push(("height-request", height_request)); 406 } 407 if let Some(ref hexpand) = self.hexpand { 408 properties.push(("hexpand", hexpand)); 409 } 410 if let Some(ref hexpand_set) = self.hexpand_set { 411 properties.push(("hexpand-set", hexpand_set)); 412 } 413 if let Some(ref is_focus) = self.is_focus { 414 properties.push(("is-focus", is_focus)); 415 } 416 if let Some(ref margin) = self.margin { 417 properties.push(("margin", margin)); 418 } 419 if let Some(ref margin_bottom) = self.margin_bottom { 420 properties.push(("margin-bottom", margin_bottom)); 421 } 422 if let Some(ref margin_end) = self.margin_end { 423 properties.push(("margin-end", margin_end)); 424 } 425 if let Some(ref margin_start) = self.margin_start { 426 properties.push(("margin-start", margin_start)); 427 } 428 if let Some(ref margin_top) = self.margin_top { 429 properties.push(("margin-top", margin_top)); 430 } 431 if let Some(ref name) = self.name { 432 properties.push(("name", name)); 433 } 434 if let Some(ref no_show_all) = self.no_show_all { 435 properties.push(("no-show-all", no_show_all)); 436 } 437 if let Some(ref opacity) = self.opacity { 438 properties.push(("opacity", opacity)); 439 } 440 if let Some(ref parent) = self.parent { 441 properties.push(("parent", parent)); 442 } 443 if let Some(ref receives_default) = self.receives_default { 444 properties.push(("receives-default", receives_default)); 445 } 446 if let Some(ref sensitive) = self.sensitive { 447 properties.push(("sensitive", sensitive)); 448 } 449 if let Some(ref tooltip_markup) = self.tooltip_markup { 450 properties.push(("tooltip-markup", tooltip_markup)); 451 } 452 if let Some(ref tooltip_text) = self.tooltip_text { 453 properties.push(("tooltip-text", tooltip_text)); 454 } 455 if let Some(ref valign) = self.valign { 456 properties.push(("valign", valign)); 457 } 458 if let Some(ref vexpand) = self.vexpand { 459 properties.push(("vexpand", vexpand)); 460 } 461 if let Some(ref vexpand_set) = self.vexpand_set { 462 properties.push(("vexpand-set", vexpand_set)); 463 } 464 if let Some(ref visible) = self.visible { 465 properties.push(("visible", visible)); 466 } 467 if let Some(ref width_request) = self.width_request { 468 properties.push(("width-request", width_request)); 469 } 470 if let Some(ref orientation) = self.orientation { 471 properties.push(("orientation", orientation)); 472 } 473 glib::Object::new::<ShortcutsSection>(&properties) 474 .expect("Failed to create an instance of ShortcutsSection") 475 } 476 max_height(mut self, max_height: u32) -> Self477 pub fn max_height(mut self, max_height: u32) -> Self { 478 self.max_height = Some(max_height); 479 self 480 } 481 section_name(mut self, section_name: &str) -> Self482 pub fn section_name(mut self, section_name: &str) -> Self { 483 self.section_name = Some(section_name.to_string()); 484 self 485 } 486 title(mut self, title: &str) -> Self487 pub fn title(mut self, title: &str) -> Self { 488 self.title = Some(title.to_string()); 489 self 490 } 491 view_name(mut self, view_name: &str) -> Self492 pub fn view_name(mut self, view_name: &str) -> Self { 493 self.view_name = Some(view_name.to_string()); 494 self 495 } 496 baseline_position(mut self, baseline_position: BaselinePosition) -> Self497 pub fn baseline_position(mut self, baseline_position: BaselinePosition) -> Self { 498 self.baseline_position = Some(baseline_position); 499 self 500 } 501 homogeneous(mut self, homogeneous: bool) -> Self502 pub fn homogeneous(mut self, homogeneous: bool) -> Self { 503 self.homogeneous = Some(homogeneous); 504 self 505 } 506 spacing(mut self, spacing: i32) -> Self507 pub fn spacing(mut self, spacing: i32) -> Self { 508 self.spacing = Some(spacing); 509 self 510 } 511 border_width(mut self, border_width: u32) -> Self512 pub fn border_width(mut self, border_width: u32) -> Self { 513 self.border_width = Some(border_width); 514 self 515 } 516 child<P: IsA<Widget>>(mut self, child: &P) -> Self517 pub fn child<P: IsA<Widget>>(mut self, child: &P) -> Self { 518 self.child = Some(child.clone().upcast()); 519 self 520 } 521 resize_mode(mut self, resize_mode: ResizeMode) -> Self522 pub fn resize_mode(mut self, resize_mode: ResizeMode) -> Self { 523 self.resize_mode = Some(resize_mode); 524 self 525 } 526 app_paintable(mut self, app_paintable: bool) -> Self527 pub fn app_paintable(mut self, app_paintable: bool) -> Self { 528 self.app_paintable = Some(app_paintable); 529 self 530 } 531 can_default(mut self, can_default: bool) -> Self532 pub fn can_default(mut self, can_default: bool) -> Self { 533 self.can_default = Some(can_default); 534 self 535 } 536 can_focus(mut self, can_focus: bool) -> Self537 pub fn can_focus(mut self, can_focus: bool) -> Self { 538 self.can_focus = Some(can_focus); 539 self 540 } 541 events(mut self, events: gdk::EventMask) -> Self542 pub fn events(mut self, events: gdk::EventMask) -> Self { 543 self.events = Some(events); 544 self 545 } 546 expand(mut self, expand: bool) -> Self547 pub fn expand(mut self, expand: bool) -> Self { 548 self.expand = Some(expand); 549 self 550 } 551 552 #[cfg(any(feature = "v3_20", feature = "dox"))] 553 #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_20")))] focus_on_click(mut self, focus_on_click: bool) -> Self554 pub fn focus_on_click(mut self, focus_on_click: bool) -> Self { 555 self.focus_on_click = Some(focus_on_click); 556 self 557 } 558 halign(mut self, halign: Align) -> Self559 pub fn halign(mut self, halign: Align) -> Self { 560 self.halign = Some(halign); 561 self 562 } 563 has_default(mut self, has_default: bool) -> Self564 pub fn has_default(mut self, has_default: bool) -> Self { 565 self.has_default = Some(has_default); 566 self 567 } 568 has_focus(mut self, has_focus: bool) -> Self569 pub fn has_focus(mut self, has_focus: bool) -> Self { 570 self.has_focus = Some(has_focus); 571 self 572 } 573 has_tooltip(mut self, has_tooltip: bool) -> Self574 pub fn has_tooltip(mut self, has_tooltip: bool) -> Self { 575 self.has_tooltip = Some(has_tooltip); 576 self 577 } 578 height_request(mut self, height_request: i32) -> Self579 pub fn height_request(mut self, height_request: i32) -> Self { 580 self.height_request = Some(height_request); 581 self 582 } 583 hexpand(mut self, hexpand: bool) -> Self584 pub fn hexpand(mut self, hexpand: bool) -> Self { 585 self.hexpand = Some(hexpand); 586 self 587 } 588 hexpand_set(mut self, hexpand_set: bool) -> Self589 pub fn hexpand_set(mut self, hexpand_set: bool) -> Self { 590 self.hexpand_set = Some(hexpand_set); 591 self 592 } 593 is_focus(mut self, is_focus: bool) -> Self594 pub fn is_focus(mut self, is_focus: bool) -> Self { 595 self.is_focus = Some(is_focus); 596 self 597 } 598 margin(mut self, margin: i32) -> Self599 pub fn margin(mut self, margin: i32) -> Self { 600 self.margin = Some(margin); 601 self 602 } 603 margin_bottom(mut self, margin_bottom: i32) -> Self604 pub fn margin_bottom(mut self, margin_bottom: i32) -> Self { 605 self.margin_bottom = Some(margin_bottom); 606 self 607 } 608 margin_end(mut self, margin_end: i32) -> Self609 pub fn margin_end(mut self, margin_end: i32) -> Self { 610 self.margin_end = Some(margin_end); 611 self 612 } 613 margin_start(mut self, margin_start: i32) -> Self614 pub fn margin_start(mut self, margin_start: i32) -> Self { 615 self.margin_start = Some(margin_start); 616 self 617 } 618 margin_top(mut self, margin_top: i32) -> Self619 pub fn margin_top(mut self, margin_top: i32) -> Self { 620 self.margin_top = Some(margin_top); 621 self 622 } 623 name(mut self, name: &str) -> Self624 pub fn name(mut self, name: &str) -> Self { 625 self.name = Some(name.to_string()); 626 self 627 } 628 no_show_all(mut self, no_show_all: bool) -> Self629 pub fn no_show_all(mut self, no_show_all: bool) -> Self { 630 self.no_show_all = Some(no_show_all); 631 self 632 } 633 opacity(mut self, opacity: f64) -> Self634 pub fn opacity(mut self, opacity: f64) -> Self { 635 self.opacity = Some(opacity); 636 self 637 } 638 parent<P: IsA<Container>>(mut self, parent: &P) -> Self639 pub fn parent<P: IsA<Container>>(mut self, parent: &P) -> Self { 640 self.parent = Some(parent.clone().upcast()); 641 self 642 } 643 receives_default(mut self, receives_default: bool) -> Self644 pub fn receives_default(mut self, receives_default: bool) -> Self { 645 self.receives_default = Some(receives_default); 646 self 647 } 648 sensitive(mut self, sensitive: bool) -> Self649 pub fn sensitive(mut self, sensitive: bool) -> Self { 650 self.sensitive = Some(sensitive); 651 self 652 } 653 tooltip_markup(mut self, tooltip_markup: &str) -> Self654 pub fn tooltip_markup(mut self, tooltip_markup: &str) -> Self { 655 self.tooltip_markup = Some(tooltip_markup.to_string()); 656 self 657 } 658 tooltip_text(mut self, tooltip_text: &str) -> Self659 pub fn tooltip_text(mut self, tooltip_text: &str) -> Self { 660 self.tooltip_text = Some(tooltip_text.to_string()); 661 self 662 } 663 valign(mut self, valign: Align) -> Self664 pub fn valign(mut self, valign: Align) -> Self { 665 self.valign = Some(valign); 666 self 667 } 668 vexpand(mut self, vexpand: bool) -> Self669 pub fn vexpand(mut self, vexpand: bool) -> Self { 670 self.vexpand = Some(vexpand); 671 self 672 } 673 vexpand_set(mut self, vexpand_set: bool) -> Self674 pub fn vexpand_set(mut self, vexpand_set: bool) -> Self { 675 self.vexpand_set = Some(vexpand_set); 676 self 677 } 678 visible(mut self, visible: bool) -> Self679 pub fn visible(mut self, visible: bool) -> Self { 680 self.visible = Some(visible); 681 self 682 } 683 width_request(mut self, width_request: i32) -> Self684 pub fn width_request(mut self, width_request: i32) -> Self { 685 self.width_request = Some(width_request); 686 self 687 } 688 orientation(mut self, orientation: Orientation) -> Self689 pub fn orientation(mut self, orientation: Orientation) -> Self { 690 self.orientation = Some(orientation); 691 self 692 } 693 } 694 695 impl fmt::Display for ShortcutsSection { fmt(&self, f: &mut fmt::Formatter) -> fmt::Result696 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { 697 f.write_str("ShortcutsSection") 698 } 699 } 700