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::Application; 7 use crate::Bin; 8 use crate::Buildable; 9 use crate::Container; 10 use crate::Dialog; 11 use crate::FontChooser; 12 #[cfg(any(feature = "v3_24", feature = "dox"))] 13 #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_24")))] 14 use crate::FontChooserLevel; 15 use crate::ResizeMode; 16 use crate::Widget; 17 use crate::Window; 18 use crate::WindowPosition; 19 use crate::WindowType; 20 use glib::object::Cast; 21 use glib::object::IsA; 22 use glib::translate::*; 23 use glib::StaticType; 24 use glib::ToValue; 25 use std::fmt; 26 27 glib::wrapper! { 28 #[doc(alias = "GtkFontChooserDialog")] 29 pub struct FontChooserDialog(Object<ffi::GtkFontChooserDialog, ffi::GtkFontChooserDialogClass>) @extends Dialog, Window, Bin, Container, Widget, @implements Buildable, FontChooser; 30 31 match fn { 32 type_ => || ffi::gtk_font_chooser_dialog_get_type(), 33 } 34 } 35 36 impl FontChooserDialog { 37 #[doc(alias = "gtk_font_chooser_dialog_new")] new<P: IsA<Window>>(title: Option<&str>, parent: Option<&P>) -> FontChooserDialog38 pub fn new<P: IsA<Window>>(title: Option<&str>, parent: Option<&P>) -> FontChooserDialog { 39 assert_initialized_main_thread!(); 40 unsafe { 41 Widget::from_glib_none(ffi::gtk_font_chooser_dialog_new( 42 title.to_glib_none().0, 43 parent.map(|p| p.as_ref()).to_glib_none().0, 44 )) 45 .unsafe_cast() 46 } 47 } 48 49 // rustdoc-stripper-ignore-next 50 /// Creates a new builder-pattern struct instance to construct [`FontChooserDialog`] objects. 51 /// 52 /// This method returns an instance of [`FontChooserDialogBuilder`] which can be used to create [`FontChooserDialog`] objects. builder() -> FontChooserDialogBuilder53 pub fn builder() -> FontChooserDialogBuilder { 54 FontChooserDialogBuilder::default() 55 } 56 } 57 58 #[derive(Clone, Default)] 59 // rustdoc-stripper-ignore-next 60 /// A [builder-pattern] type to construct [`FontChooserDialog`] objects. 61 /// 62 /// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html 63 pub struct FontChooserDialogBuilder { 64 use_header_bar: Option<i32>, 65 accept_focus: Option<bool>, 66 application: Option<Application>, 67 attached_to: Option<Widget>, 68 decorated: Option<bool>, 69 default_height: Option<i32>, 70 default_width: Option<i32>, 71 deletable: Option<bool>, 72 destroy_with_parent: Option<bool>, 73 focus_on_map: Option<bool>, 74 focus_visible: Option<bool>, 75 gravity: Option<gdk::Gravity>, 76 hide_titlebar_when_maximized: Option<bool>, 77 icon: Option<gdk_pixbuf::Pixbuf>, 78 icon_name: Option<String>, 79 mnemonics_visible: Option<bool>, 80 modal: Option<bool>, 81 resizable: Option<bool>, 82 role: Option<String>, 83 screen: Option<gdk::Screen>, 84 skip_pager_hint: Option<bool>, 85 skip_taskbar_hint: Option<bool>, 86 startup_id: Option<String>, 87 title: Option<String>, 88 transient_for: Option<Window>, 89 type_: Option<WindowType>, 90 type_hint: Option<gdk::WindowTypeHint>, 91 urgency_hint: Option<bool>, 92 window_position: Option<WindowPosition>, 93 border_width: Option<u32>, 94 child: Option<Widget>, 95 resize_mode: Option<ResizeMode>, 96 app_paintable: Option<bool>, 97 can_default: Option<bool>, 98 can_focus: Option<bool>, 99 events: Option<gdk::EventMask>, 100 expand: Option<bool>, 101 #[cfg(any(feature = "v3_20", feature = "dox"))] 102 #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_20")))] 103 focus_on_click: Option<bool>, 104 halign: Option<Align>, 105 has_default: Option<bool>, 106 has_focus: Option<bool>, 107 has_tooltip: Option<bool>, 108 height_request: Option<i32>, 109 hexpand: Option<bool>, 110 hexpand_set: Option<bool>, 111 is_focus: Option<bool>, 112 margin: Option<i32>, 113 margin_bottom: Option<i32>, 114 margin_end: Option<i32>, 115 margin_start: Option<i32>, 116 margin_top: Option<i32>, 117 name: Option<String>, 118 no_show_all: Option<bool>, 119 opacity: Option<f64>, 120 parent: Option<Container>, 121 receives_default: Option<bool>, 122 sensitive: Option<bool>, 123 tooltip_markup: Option<String>, 124 tooltip_text: Option<String>, 125 valign: Option<Align>, 126 vexpand: Option<bool>, 127 vexpand_set: Option<bool>, 128 visible: Option<bool>, 129 width_request: Option<i32>, 130 font: Option<String>, 131 font_desc: Option<pango::FontDescription>, 132 #[cfg(any(feature = "v3_24", feature = "dox"))] 133 #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_24")))] 134 language: Option<String>, 135 #[cfg(any(feature = "v3_24", feature = "dox"))] 136 #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_24")))] 137 level: Option<FontChooserLevel>, 138 preview_text: Option<String>, 139 show_preview_entry: Option<bool>, 140 } 141 142 impl FontChooserDialogBuilder { 143 // rustdoc-stripper-ignore-next 144 /// Create a new [`FontChooserDialogBuilder`]. new() -> Self145 pub fn new() -> Self { 146 Self::default() 147 } 148 149 // rustdoc-stripper-ignore-next 150 /// Build the [`FontChooserDialog`]. build(self) -> FontChooserDialog151 pub fn build(self) -> FontChooserDialog { 152 let mut properties: Vec<(&str, &dyn ToValue)> = vec![]; 153 if let Some(ref use_header_bar) = self.use_header_bar { 154 properties.push(("use-header-bar", use_header_bar)); 155 } 156 if let Some(ref accept_focus) = self.accept_focus { 157 properties.push(("accept-focus", accept_focus)); 158 } 159 if let Some(ref application) = self.application { 160 properties.push(("application", application)); 161 } 162 if let Some(ref attached_to) = self.attached_to { 163 properties.push(("attached-to", attached_to)); 164 } 165 if let Some(ref decorated) = self.decorated { 166 properties.push(("decorated", decorated)); 167 } 168 if let Some(ref default_height) = self.default_height { 169 properties.push(("default-height", default_height)); 170 } 171 if let Some(ref default_width) = self.default_width { 172 properties.push(("default-width", default_width)); 173 } 174 if let Some(ref deletable) = self.deletable { 175 properties.push(("deletable", deletable)); 176 } 177 if let Some(ref destroy_with_parent) = self.destroy_with_parent { 178 properties.push(("destroy-with-parent", destroy_with_parent)); 179 } 180 if let Some(ref focus_on_map) = self.focus_on_map { 181 properties.push(("focus-on-map", focus_on_map)); 182 } 183 if let Some(ref focus_visible) = self.focus_visible { 184 properties.push(("focus-visible", focus_visible)); 185 } 186 if let Some(ref gravity) = self.gravity { 187 properties.push(("gravity", gravity)); 188 } 189 if let Some(ref hide_titlebar_when_maximized) = self.hide_titlebar_when_maximized { 190 properties.push(("hide-titlebar-when-maximized", hide_titlebar_when_maximized)); 191 } 192 if let Some(ref icon) = self.icon { 193 properties.push(("icon", icon)); 194 } 195 if let Some(ref icon_name) = self.icon_name { 196 properties.push(("icon-name", icon_name)); 197 } 198 if let Some(ref mnemonics_visible) = self.mnemonics_visible { 199 properties.push(("mnemonics-visible", mnemonics_visible)); 200 } 201 if let Some(ref modal) = self.modal { 202 properties.push(("modal", modal)); 203 } 204 if let Some(ref resizable) = self.resizable { 205 properties.push(("resizable", resizable)); 206 } 207 if let Some(ref role) = self.role { 208 properties.push(("role", role)); 209 } 210 if let Some(ref screen) = self.screen { 211 properties.push(("screen", screen)); 212 } 213 if let Some(ref skip_pager_hint) = self.skip_pager_hint { 214 properties.push(("skip-pager-hint", skip_pager_hint)); 215 } 216 if let Some(ref skip_taskbar_hint) = self.skip_taskbar_hint { 217 properties.push(("skip-taskbar-hint", skip_taskbar_hint)); 218 } 219 if let Some(ref startup_id) = self.startup_id { 220 properties.push(("startup-id", startup_id)); 221 } 222 if let Some(ref title) = self.title { 223 properties.push(("title", title)); 224 } 225 if let Some(ref transient_for) = self.transient_for { 226 properties.push(("transient-for", transient_for)); 227 } 228 if let Some(ref type_) = self.type_ { 229 properties.push(("type", type_)); 230 } 231 if let Some(ref type_hint) = self.type_hint { 232 properties.push(("type-hint", type_hint)); 233 } 234 if let Some(ref urgency_hint) = self.urgency_hint { 235 properties.push(("urgency-hint", urgency_hint)); 236 } 237 if let Some(ref window_position) = self.window_position { 238 properties.push(("window-position", window_position)); 239 } 240 if let Some(ref border_width) = self.border_width { 241 properties.push(("border-width", border_width)); 242 } 243 if let Some(ref child) = self.child { 244 properties.push(("child", child)); 245 } 246 if let Some(ref resize_mode) = self.resize_mode { 247 properties.push(("resize-mode", resize_mode)); 248 } 249 if let Some(ref app_paintable) = self.app_paintable { 250 properties.push(("app-paintable", app_paintable)); 251 } 252 if let Some(ref can_default) = self.can_default { 253 properties.push(("can-default", can_default)); 254 } 255 if let Some(ref can_focus) = self.can_focus { 256 properties.push(("can-focus", can_focus)); 257 } 258 if let Some(ref events) = self.events { 259 properties.push(("events", events)); 260 } 261 if let Some(ref expand) = self.expand { 262 properties.push(("expand", expand)); 263 } 264 #[cfg(any(feature = "v3_20", feature = "dox"))] 265 if let Some(ref focus_on_click) = self.focus_on_click { 266 properties.push(("focus-on-click", focus_on_click)); 267 } 268 if let Some(ref halign) = self.halign { 269 properties.push(("halign", halign)); 270 } 271 if let Some(ref has_default) = self.has_default { 272 properties.push(("has-default", has_default)); 273 } 274 if let Some(ref has_focus) = self.has_focus { 275 properties.push(("has-focus", has_focus)); 276 } 277 if let Some(ref has_tooltip) = self.has_tooltip { 278 properties.push(("has-tooltip", has_tooltip)); 279 } 280 if let Some(ref height_request) = self.height_request { 281 properties.push(("height-request", height_request)); 282 } 283 if let Some(ref hexpand) = self.hexpand { 284 properties.push(("hexpand", hexpand)); 285 } 286 if let Some(ref hexpand_set) = self.hexpand_set { 287 properties.push(("hexpand-set", hexpand_set)); 288 } 289 if let Some(ref is_focus) = self.is_focus { 290 properties.push(("is-focus", is_focus)); 291 } 292 if let Some(ref margin) = self.margin { 293 properties.push(("margin", margin)); 294 } 295 if let Some(ref margin_bottom) = self.margin_bottom { 296 properties.push(("margin-bottom", margin_bottom)); 297 } 298 if let Some(ref margin_end) = self.margin_end { 299 properties.push(("margin-end", margin_end)); 300 } 301 if let Some(ref margin_start) = self.margin_start { 302 properties.push(("margin-start", margin_start)); 303 } 304 if let Some(ref margin_top) = self.margin_top { 305 properties.push(("margin-top", margin_top)); 306 } 307 if let Some(ref name) = self.name { 308 properties.push(("name", name)); 309 } 310 if let Some(ref no_show_all) = self.no_show_all { 311 properties.push(("no-show-all", no_show_all)); 312 } 313 if let Some(ref opacity) = self.opacity { 314 properties.push(("opacity", opacity)); 315 } 316 if let Some(ref parent) = self.parent { 317 properties.push(("parent", parent)); 318 } 319 if let Some(ref receives_default) = self.receives_default { 320 properties.push(("receives-default", receives_default)); 321 } 322 if let Some(ref sensitive) = self.sensitive { 323 properties.push(("sensitive", sensitive)); 324 } 325 if let Some(ref tooltip_markup) = self.tooltip_markup { 326 properties.push(("tooltip-markup", tooltip_markup)); 327 } 328 if let Some(ref tooltip_text) = self.tooltip_text { 329 properties.push(("tooltip-text", tooltip_text)); 330 } 331 if let Some(ref valign) = self.valign { 332 properties.push(("valign", valign)); 333 } 334 if let Some(ref vexpand) = self.vexpand { 335 properties.push(("vexpand", vexpand)); 336 } 337 if let Some(ref vexpand_set) = self.vexpand_set { 338 properties.push(("vexpand-set", vexpand_set)); 339 } 340 if let Some(ref visible) = self.visible { 341 properties.push(("visible", visible)); 342 } 343 if let Some(ref width_request) = self.width_request { 344 properties.push(("width-request", width_request)); 345 } 346 if let Some(ref font) = self.font { 347 properties.push(("font", font)); 348 } 349 if let Some(ref font_desc) = self.font_desc { 350 properties.push(("font-desc", font_desc)); 351 } 352 #[cfg(any(feature = "v3_24", feature = "dox"))] 353 if let Some(ref language) = self.language { 354 properties.push(("language", language)); 355 } 356 #[cfg(any(feature = "v3_24", feature = "dox"))] 357 if let Some(ref level) = self.level { 358 properties.push(("level", level)); 359 } 360 if let Some(ref preview_text) = self.preview_text { 361 properties.push(("preview-text", preview_text)); 362 } 363 if let Some(ref show_preview_entry) = self.show_preview_entry { 364 properties.push(("show-preview-entry", show_preview_entry)); 365 } 366 glib::Object::new::<FontChooserDialog>(&properties) 367 .expect("Failed to create an instance of FontChooserDialog") 368 } 369 use_header_bar(mut self, use_header_bar: i32) -> Self370 pub fn use_header_bar(mut self, use_header_bar: i32) -> Self { 371 self.use_header_bar = Some(use_header_bar); 372 self 373 } 374 accept_focus(mut self, accept_focus: bool) -> Self375 pub fn accept_focus(mut self, accept_focus: bool) -> Self { 376 self.accept_focus = Some(accept_focus); 377 self 378 } 379 application<P: IsA<Application>>(mut self, application: &P) -> Self380 pub fn application<P: IsA<Application>>(mut self, application: &P) -> Self { 381 self.application = Some(application.clone().upcast()); 382 self 383 } 384 attached_to<P: IsA<Widget>>(mut self, attached_to: &P) -> Self385 pub fn attached_to<P: IsA<Widget>>(mut self, attached_to: &P) -> Self { 386 self.attached_to = Some(attached_to.clone().upcast()); 387 self 388 } 389 decorated(mut self, decorated: bool) -> Self390 pub fn decorated(mut self, decorated: bool) -> Self { 391 self.decorated = Some(decorated); 392 self 393 } 394 default_height(mut self, default_height: i32) -> Self395 pub fn default_height(mut self, default_height: i32) -> Self { 396 self.default_height = Some(default_height); 397 self 398 } 399 default_width(mut self, default_width: i32) -> Self400 pub fn default_width(mut self, default_width: i32) -> Self { 401 self.default_width = Some(default_width); 402 self 403 } 404 deletable(mut self, deletable: bool) -> Self405 pub fn deletable(mut self, deletable: bool) -> Self { 406 self.deletable = Some(deletable); 407 self 408 } 409 destroy_with_parent(mut self, destroy_with_parent: bool) -> Self410 pub fn destroy_with_parent(mut self, destroy_with_parent: bool) -> Self { 411 self.destroy_with_parent = Some(destroy_with_parent); 412 self 413 } 414 focus_on_map(mut self, focus_on_map: bool) -> Self415 pub fn focus_on_map(mut self, focus_on_map: bool) -> Self { 416 self.focus_on_map = Some(focus_on_map); 417 self 418 } 419 focus_visible(mut self, focus_visible: bool) -> Self420 pub fn focus_visible(mut self, focus_visible: bool) -> Self { 421 self.focus_visible = Some(focus_visible); 422 self 423 } 424 gravity(mut self, gravity: gdk::Gravity) -> Self425 pub fn gravity(mut self, gravity: gdk::Gravity) -> Self { 426 self.gravity = Some(gravity); 427 self 428 } 429 hide_titlebar_when_maximized(mut self, hide_titlebar_when_maximized: bool) -> Self430 pub fn hide_titlebar_when_maximized(mut self, hide_titlebar_when_maximized: bool) -> Self { 431 self.hide_titlebar_when_maximized = Some(hide_titlebar_when_maximized); 432 self 433 } 434 icon(mut self, icon: &gdk_pixbuf::Pixbuf) -> Self435 pub fn icon(mut self, icon: &gdk_pixbuf::Pixbuf) -> Self { 436 self.icon = Some(icon.clone()); 437 self 438 } 439 icon_name(mut self, icon_name: &str) -> Self440 pub fn icon_name(mut self, icon_name: &str) -> Self { 441 self.icon_name = Some(icon_name.to_string()); 442 self 443 } 444 mnemonics_visible(mut self, mnemonics_visible: bool) -> Self445 pub fn mnemonics_visible(mut self, mnemonics_visible: bool) -> Self { 446 self.mnemonics_visible = Some(mnemonics_visible); 447 self 448 } 449 modal(mut self, modal: bool) -> Self450 pub fn modal(mut self, modal: bool) -> Self { 451 self.modal = Some(modal); 452 self 453 } 454 resizable(mut self, resizable: bool) -> Self455 pub fn resizable(mut self, resizable: bool) -> Self { 456 self.resizable = Some(resizable); 457 self 458 } 459 role(mut self, role: &str) -> Self460 pub fn role(mut self, role: &str) -> Self { 461 self.role = Some(role.to_string()); 462 self 463 } 464 screen(mut self, screen: &gdk::Screen) -> Self465 pub fn screen(mut self, screen: &gdk::Screen) -> Self { 466 self.screen = Some(screen.clone()); 467 self 468 } 469 skip_pager_hint(mut self, skip_pager_hint: bool) -> Self470 pub fn skip_pager_hint(mut self, skip_pager_hint: bool) -> Self { 471 self.skip_pager_hint = Some(skip_pager_hint); 472 self 473 } 474 skip_taskbar_hint(mut self, skip_taskbar_hint: bool) -> Self475 pub fn skip_taskbar_hint(mut self, skip_taskbar_hint: bool) -> Self { 476 self.skip_taskbar_hint = Some(skip_taskbar_hint); 477 self 478 } 479 startup_id(mut self, startup_id: &str) -> Self480 pub fn startup_id(mut self, startup_id: &str) -> Self { 481 self.startup_id = Some(startup_id.to_string()); 482 self 483 } 484 title(mut self, title: &str) -> Self485 pub fn title(mut self, title: &str) -> Self { 486 self.title = Some(title.to_string()); 487 self 488 } 489 transient_for<P: IsA<Window>>(mut self, transient_for: &P) -> Self490 pub fn transient_for<P: IsA<Window>>(mut self, transient_for: &P) -> Self { 491 self.transient_for = Some(transient_for.clone().upcast()); 492 self 493 } 494 type_(mut self, type_: WindowType) -> Self495 pub fn type_(mut self, type_: WindowType) -> Self { 496 self.type_ = Some(type_); 497 self 498 } 499 type_hint(mut self, type_hint: gdk::WindowTypeHint) -> Self500 pub fn type_hint(mut self, type_hint: gdk::WindowTypeHint) -> Self { 501 self.type_hint = Some(type_hint); 502 self 503 } 504 urgency_hint(mut self, urgency_hint: bool) -> Self505 pub fn urgency_hint(mut self, urgency_hint: bool) -> Self { 506 self.urgency_hint = Some(urgency_hint); 507 self 508 } 509 window_position(mut self, window_position: WindowPosition) -> Self510 pub fn window_position(mut self, window_position: WindowPosition) -> Self { 511 self.window_position = Some(window_position); 512 self 513 } 514 border_width(mut self, border_width: u32) -> Self515 pub fn border_width(mut self, border_width: u32) -> Self { 516 self.border_width = Some(border_width); 517 self 518 } 519 child<P: IsA<Widget>>(mut self, child: &P) -> Self520 pub fn child<P: IsA<Widget>>(mut self, child: &P) -> Self { 521 self.child = Some(child.clone().upcast()); 522 self 523 } 524 resize_mode(mut self, resize_mode: ResizeMode) -> Self525 pub fn resize_mode(mut self, resize_mode: ResizeMode) -> Self { 526 self.resize_mode = Some(resize_mode); 527 self 528 } 529 app_paintable(mut self, app_paintable: bool) -> Self530 pub fn app_paintable(mut self, app_paintable: bool) -> Self { 531 self.app_paintable = Some(app_paintable); 532 self 533 } 534 can_default(mut self, can_default: bool) -> Self535 pub fn can_default(mut self, can_default: bool) -> Self { 536 self.can_default = Some(can_default); 537 self 538 } 539 can_focus(mut self, can_focus: bool) -> Self540 pub fn can_focus(mut self, can_focus: bool) -> Self { 541 self.can_focus = Some(can_focus); 542 self 543 } 544 events(mut self, events: gdk::EventMask) -> Self545 pub fn events(mut self, events: gdk::EventMask) -> Self { 546 self.events = Some(events); 547 self 548 } 549 expand(mut self, expand: bool) -> Self550 pub fn expand(mut self, expand: bool) -> Self { 551 self.expand = Some(expand); 552 self 553 } 554 555 #[cfg(any(feature = "v3_20", feature = "dox"))] 556 #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_20")))] focus_on_click(mut self, focus_on_click: bool) -> Self557 pub fn focus_on_click(mut self, focus_on_click: bool) -> Self { 558 self.focus_on_click = Some(focus_on_click); 559 self 560 } 561 halign(mut self, halign: Align) -> Self562 pub fn halign(mut self, halign: Align) -> Self { 563 self.halign = Some(halign); 564 self 565 } 566 has_default(mut self, has_default: bool) -> Self567 pub fn has_default(mut self, has_default: bool) -> Self { 568 self.has_default = Some(has_default); 569 self 570 } 571 has_focus(mut self, has_focus: bool) -> Self572 pub fn has_focus(mut self, has_focus: bool) -> Self { 573 self.has_focus = Some(has_focus); 574 self 575 } 576 has_tooltip(mut self, has_tooltip: bool) -> Self577 pub fn has_tooltip(mut self, has_tooltip: bool) -> Self { 578 self.has_tooltip = Some(has_tooltip); 579 self 580 } 581 height_request(mut self, height_request: i32) -> Self582 pub fn height_request(mut self, height_request: i32) -> Self { 583 self.height_request = Some(height_request); 584 self 585 } 586 hexpand(mut self, hexpand: bool) -> Self587 pub fn hexpand(mut self, hexpand: bool) -> Self { 588 self.hexpand = Some(hexpand); 589 self 590 } 591 hexpand_set(mut self, hexpand_set: bool) -> Self592 pub fn hexpand_set(mut self, hexpand_set: bool) -> Self { 593 self.hexpand_set = Some(hexpand_set); 594 self 595 } 596 is_focus(mut self, is_focus: bool) -> Self597 pub fn is_focus(mut self, is_focus: bool) -> Self { 598 self.is_focus = Some(is_focus); 599 self 600 } 601 margin(mut self, margin: i32) -> Self602 pub fn margin(mut self, margin: i32) -> Self { 603 self.margin = Some(margin); 604 self 605 } 606 margin_bottom(mut self, margin_bottom: i32) -> Self607 pub fn margin_bottom(mut self, margin_bottom: i32) -> Self { 608 self.margin_bottom = Some(margin_bottom); 609 self 610 } 611 margin_end(mut self, margin_end: i32) -> Self612 pub fn margin_end(mut self, margin_end: i32) -> Self { 613 self.margin_end = Some(margin_end); 614 self 615 } 616 margin_start(mut self, margin_start: i32) -> Self617 pub fn margin_start(mut self, margin_start: i32) -> Self { 618 self.margin_start = Some(margin_start); 619 self 620 } 621 margin_top(mut self, margin_top: i32) -> Self622 pub fn margin_top(mut self, margin_top: i32) -> Self { 623 self.margin_top = Some(margin_top); 624 self 625 } 626 name(mut self, name: &str) -> Self627 pub fn name(mut self, name: &str) -> Self { 628 self.name = Some(name.to_string()); 629 self 630 } 631 no_show_all(mut self, no_show_all: bool) -> Self632 pub fn no_show_all(mut self, no_show_all: bool) -> Self { 633 self.no_show_all = Some(no_show_all); 634 self 635 } 636 opacity(mut self, opacity: f64) -> Self637 pub fn opacity(mut self, opacity: f64) -> Self { 638 self.opacity = Some(opacity); 639 self 640 } 641 parent<P: IsA<Container>>(mut self, parent: &P) -> Self642 pub fn parent<P: IsA<Container>>(mut self, parent: &P) -> Self { 643 self.parent = Some(parent.clone().upcast()); 644 self 645 } 646 receives_default(mut self, receives_default: bool) -> Self647 pub fn receives_default(mut self, receives_default: bool) -> Self { 648 self.receives_default = Some(receives_default); 649 self 650 } 651 sensitive(mut self, sensitive: bool) -> Self652 pub fn sensitive(mut self, sensitive: bool) -> Self { 653 self.sensitive = Some(sensitive); 654 self 655 } 656 tooltip_markup(mut self, tooltip_markup: &str) -> Self657 pub fn tooltip_markup(mut self, tooltip_markup: &str) -> Self { 658 self.tooltip_markup = Some(tooltip_markup.to_string()); 659 self 660 } 661 tooltip_text(mut self, tooltip_text: &str) -> Self662 pub fn tooltip_text(mut self, tooltip_text: &str) -> Self { 663 self.tooltip_text = Some(tooltip_text.to_string()); 664 self 665 } 666 valign(mut self, valign: Align) -> Self667 pub fn valign(mut self, valign: Align) -> Self { 668 self.valign = Some(valign); 669 self 670 } 671 vexpand(mut self, vexpand: bool) -> Self672 pub fn vexpand(mut self, vexpand: bool) -> Self { 673 self.vexpand = Some(vexpand); 674 self 675 } 676 vexpand_set(mut self, vexpand_set: bool) -> Self677 pub fn vexpand_set(mut self, vexpand_set: bool) -> Self { 678 self.vexpand_set = Some(vexpand_set); 679 self 680 } 681 visible(mut self, visible: bool) -> Self682 pub fn visible(mut self, visible: bool) -> Self { 683 self.visible = Some(visible); 684 self 685 } 686 width_request(mut self, width_request: i32) -> Self687 pub fn width_request(mut self, width_request: i32) -> Self { 688 self.width_request = Some(width_request); 689 self 690 } 691 font(mut self, font: &str) -> Self692 pub fn font(mut self, font: &str) -> Self { 693 self.font = Some(font.to_string()); 694 self 695 } 696 font_desc(mut self, font_desc: &pango::FontDescription) -> Self697 pub fn font_desc(mut self, font_desc: &pango::FontDescription) -> Self { 698 self.font_desc = Some(font_desc.clone()); 699 self 700 } 701 702 #[cfg(any(feature = "v3_24", feature = "dox"))] 703 #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_24")))] language(mut self, language: &str) -> Self704 pub fn language(mut self, language: &str) -> Self { 705 self.language = Some(language.to_string()); 706 self 707 } 708 709 #[cfg(any(feature = "v3_24", feature = "dox"))] 710 #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_24")))] level(mut self, level: FontChooserLevel) -> Self711 pub fn level(mut self, level: FontChooserLevel) -> Self { 712 self.level = Some(level); 713 self 714 } 715 preview_text(mut self, preview_text: &str) -> Self716 pub fn preview_text(mut self, preview_text: &str) -> Self { 717 self.preview_text = Some(preview_text.to_string()); 718 self 719 } 720 show_preview_entry(mut self, show_preview_entry: bool) -> Self721 pub fn show_preview_entry(mut self, show_preview_entry: bool) -> Self { 722 self.show_preview_entry = Some(show_preview_entry); 723 self 724 } 725 } 726 727 pub const NONE_FONT_CHOOSER_DIALOG: Option<&FontChooserDialog> = None; 728 729 impl fmt::Display for FontChooserDialog { fmt(&self, f: &mut fmt::Formatter) -> fmt::Result730 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { 731 f.write_str("FontChooserDialog") 732 } 733 } 734