gtk/auto/shortcuts_shortcut.rs
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
5use crate::{
6 Align, BaselinePosition, Box, Buildable, Container, Orientable, Orientation, ResizeMode,
7 ShortcutType, SizeGroup, TextDirection, Widget, ffi,
8};
9use glib::{
10 prelude::*,
11 signal::{SignalHandlerId, connect_raw},
12 translate::*,
13};
14use std::boxed::Box as Box_;
15
16glib::wrapper! {
17 /// A GtkShortcutsShortcut represents a single keyboard shortcut or gesture
18 /// with a short text. This widget is only meant to be used with [`ShortcutsWindow`][crate::ShortcutsWindow].
19 ///
20 /// ## Properties
21 ///
22 ///
23 /// #### `accel-size-group`
24 /// The size group for the accelerator portion of this shortcut.
25 ///
26 /// This is used internally by GTK+, and must not be modified by applications.
27 ///
28 /// Writable
29 ///
30 ///
31 /// #### `accelerator`
32 /// The accelerator(s) represented by this object. This property is used
33 /// if [`shortcut-type`][struct@crate::ShortcutsShortcut#shortcut-type] is set to [`ShortcutType::Accelerator`][crate::ShortcutType::Accelerator].
34 ///
35 /// The syntax of this property is (an extension of) the syntax understood by
36 /// [`accelerator_parse()`][crate::accelerator_parse()]. Multiple accelerators can be specified by separating
37 /// them with a space, but keep in mind that the available width is limited.
38 /// It is also possible to specify ranges of shortcuts, using `...` between the keys.
39 /// Sequences of keys can be specified using a `+` or `&` between the keys.
40 ///
41 /// Examples:
42 ///
43 /// - A single shortcut: ``<ctl>``<alt>`delete`
44 /// - Two alternative shortcuts: ``<shift>`a Home`
45 /// - A range of shortcuts: ``<alt>`1...`<alt>`9`
46 /// - Several keys pressed together: `Control_L&Control_R`
47 /// - A sequence of shortcuts or keys: ``<ctl>`c+`<ctl>`x`
48 ///
49 /// Use + instead of & when the keys may (or have to be) pressed sequentially (e.g
50 /// use t+t for 'press the t key twice').
51 ///
52 /// Note that `<`, `>` and `&` need to be escaped as <, > and & when used
53 /// in .ui files.
54 ///
55 /// Readable | Writable
56 ///
57 ///
58 /// #### `action-name`
59 /// A detailed action name. If this is set for a shortcut
60 /// of type [`ShortcutType::Accelerator`][crate::ShortcutType::Accelerator], then GTK+ will use
61 /// the accelerators that are associated with the action
62 /// via [`GtkApplicationExt::set_accels_for_action()`][crate::prelude::GtkApplicationExt::set_accels_for_action()], and setting
63 /// [`accelerator`][struct@crate::ShortcutsShortcut#accelerator] is not necessary.
64 ///
65 /// Readable | Writable
66 ///
67 ///
68 /// #### `direction`
69 /// The text direction for which this shortcut is active. If the shortcut
70 /// is used regardless of the text direction, set this property to
71 /// [`TextDirection::None`][crate::TextDirection::None].
72 ///
73 /// Readable | Writable
74 ///
75 ///
76 /// #### `icon`
77 /// An icon to represent the shortcut or gesture. This property is used if
78 /// [`shortcut-type`][struct@crate::ShortcutsShortcut#shortcut-type] is set to [`ShortcutType::Gesture`][crate::ShortcutType::Gesture].
79 /// For the other predefined gesture types, GTK+ provides an icon on its own.
80 ///
81 /// Readable | Writable
82 ///
83 ///
84 /// #### `icon-set`
85 /// [`true`] if an icon has been set.
86 ///
87 /// Readable | Writable
88 ///
89 ///
90 /// #### `shortcut-type`
91 /// The type of shortcut that is represented.
92 ///
93 /// Readable | Writable
94 ///
95 ///
96 /// #### `subtitle`
97 /// The subtitle for the shortcut or gesture.
98 ///
99 /// This is typically used for gestures and should be a short, one-line
100 /// text that describes the gesture itself. For the predefined gesture
101 /// types, GTK+ provides a subtitle on its own.
102 ///
103 /// Readable | Writable
104 ///
105 ///
106 /// #### `subtitle-set`
107 /// [`true`] if a subtitle has been set.
108 ///
109 /// Readable | Writable
110 ///
111 ///
112 /// #### `title`
113 /// The textual description for the shortcut or gesture represented by
114 /// this object. This should be a short string that can fit in a single line.
115 ///
116 /// Readable | Writable
117 ///
118 ///
119 /// #### `title-size-group`
120 /// The size group for the textual portion of this shortcut.
121 ///
122 /// This is used internally by GTK+, and must not be modified by applications.
123 ///
124 /// Writable
125 /// <details><summary><h4>Box</h4></summary>
126 ///
127 ///
128 /// #### `baseline-position`
129 /// Readable | Writable
130 ///
131 ///
132 /// #### `homogeneous`
133 /// Readable | Writable
134 ///
135 ///
136 /// #### `spacing`
137 /// Readable | Writable
138 /// </details>
139 /// <details><summary><h4>Container</h4></summary>
140 ///
141 ///
142 /// #### `border-width`
143 /// Readable | Writable
144 ///
145 ///
146 /// #### `child`
147 /// Writable
148 ///
149 ///
150 /// #### `resize-mode`
151 /// Readable | Writable
152 /// </details>
153 /// <details><summary><h4>Widget</h4></summary>
154 ///
155 ///
156 /// #### `app-paintable`
157 /// Readable | Writable
158 ///
159 ///
160 /// #### `can-default`
161 /// Readable | Writable
162 ///
163 ///
164 /// #### `can-focus`
165 /// Readable | Writable
166 ///
167 ///
168 /// #### `composite-child`
169 /// Readable
170 ///
171 ///
172 /// #### `double-buffered`
173 /// Whether the widget is double buffered.
174 ///
175 /// Readable | Writable
176 ///
177 ///
178 /// #### `events`
179 /// Readable | Writable
180 ///
181 ///
182 /// #### `expand`
183 /// Whether to expand in both directions. Setting this sets both [`hexpand`][struct@crate::Widget#hexpand] and [`vexpand`][struct@crate::Widget#vexpand]
184 ///
185 /// Readable | Writable
186 ///
187 ///
188 /// #### `focus-on-click`
189 /// Whether the widget should grab focus when it is clicked with the mouse.
190 ///
191 /// This property is only relevant for widgets that can take focus.
192 ///
193 /// Before 3.20, several widgets (GtkButton, GtkFileChooserButton,
194 /// GtkComboBox) implemented this property individually.
195 ///
196 /// Readable | Writable
197 ///
198 ///
199 /// #### `halign`
200 /// How to distribute horizontal space if widget gets extra space, see [`Align`][crate::Align]
201 ///
202 /// Readable | Writable
203 ///
204 ///
205 /// #### `has-default`
206 /// Readable | Writable
207 ///
208 ///
209 /// #### `has-focus`
210 /// Readable | Writable
211 ///
212 ///
213 /// #### `has-tooltip`
214 /// Enables or disables the emission of [`query-tooltip`][struct@crate::Widget#query-tooltip] on `widget`.
215 /// A value of [`true`] indicates that `widget` can have a tooltip, in this case
216 /// the widget will be queried using [`query-tooltip`][struct@crate::Widget#query-tooltip] to determine
217 /// whether it will provide a tooltip or not.
218 ///
219 /// Note that setting this property to [`true`] for the first time will change
220 /// the event masks of the GdkWindows of this widget to include leave-notify
221 /// and motion-notify events. This cannot and will not be undone when the
222 /// property is set to [`false`] again.
223 ///
224 /// Readable | Writable
225 ///
226 ///
227 /// #### `height-request`
228 /// Readable | Writable
229 ///
230 ///
231 /// #### `hexpand`
232 /// Whether to expand horizontally. See [`WidgetExt::set_hexpand()`][crate::prelude::WidgetExt::set_hexpand()].
233 ///
234 /// Readable | Writable
235 ///
236 ///
237 /// #### `hexpand-set`
238 /// Whether to use the [`hexpand`][struct@crate::Widget#hexpand] property. See [`WidgetExt::is_hexpand_set()`][crate::prelude::WidgetExt::is_hexpand_set()].
239 ///
240 /// Readable | Writable
241 ///
242 ///
243 /// #### `is-focus`
244 /// Readable | Writable
245 ///
246 ///
247 /// #### `margin`
248 /// Sets all four sides' margin at once. If read, returns max
249 /// margin on any side.
250 ///
251 /// Readable | Writable
252 ///
253 ///
254 /// #### `margin-bottom`
255 /// Margin on bottom side of widget.
256 ///
257 /// This property adds margin outside of the widget's normal size
258 /// request, the margin will be added in addition to the size from
259 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
260 ///
261 /// Readable | Writable
262 ///
263 ///
264 /// #### `margin-end`
265 /// Margin on end of widget, horizontally. This property supports
266 /// left-to-right and right-to-left text directions.
267 ///
268 /// This property adds margin outside of the widget's normal size
269 /// request, the margin will be added in addition to the size from
270 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
271 ///
272 /// Readable | Writable
273 ///
274 ///
275 /// #### `margin-left`
276 /// Margin on left side of widget.
277 ///
278 /// This property adds margin outside of the widget's normal size
279 /// request, the margin will be added in addition to the size from
280 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
281 ///
282 /// Readable | Writable
283 ///
284 ///
285 /// #### `margin-right`
286 /// Margin on right side of widget.
287 ///
288 /// This property adds margin outside of the widget's normal size
289 /// request, the margin will be added in addition to the size from
290 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
291 ///
292 /// Readable | Writable
293 ///
294 ///
295 /// #### `margin-start`
296 /// Margin on start of widget, horizontally. This property supports
297 /// left-to-right and right-to-left text directions.
298 ///
299 /// This property adds margin outside of the widget's normal size
300 /// request, the margin will be added in addition to the size from
301 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
302 ///
303 /// Readable | Writable
304 ///
305 ///
306 /// #### `margin-top`
307 /// Margin on top side of widget.
308 ///
309 /// This property adds margin outside of the widget's normal size
310 /// request, the margin will be added in addition to the size from
311 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
312 ///
313 /// Readable | Writable
314 ///
315 ///
316 /// #### `name`
317 /// Readable | Writable
318 ///
319 ///
320 /// #### `no-show-all`
321 /// Readable | Writable
322 ///
323 ///
324 /// #### `opacity`
325 /// The requested opacity of the widget. See [`WidgetExt::set_opacity()`][crate::prelude::WidgetExt::set_opacity()] for
326 /// more details about window opacity.
327 ///
328 /// Before 3.8 this was only available in GtkWindow
329 ///
330 /// Readable | Writable
331 ///
332 ///
333 /// #### `parent`
334 /// Readable | Writable
335 ///
336 ///
337 /// #### `receives-default`
338 /// Readable | Writable
339 ///
340 ///
341 /// #### `scale-factor`
342 /// The scale factor of the widget. See [`WidgetExt::scale_factor()`][crate::prelude::WidgetExt::scale_factor()] for
343 /// more details about widget scaling.
344 ///
345 /// Readable
346 ///
347 ///
348 /// #### `sensitive`
349 /// Readable | Writable
350 ///
351 ///
352 /// #### `style`
353 /// The style of the widget, which contains information about how it will look (colors, etc).
354 ///
355 /// Readable | Writable
356 ///
357 ///
358 /// #### `tooltip-markup`
359 /// Sets the text of tooltip to be the given string, which is marked up
360 /// with the [Pango text markup language][PangoMarkupFormat].
361 /// Also see [`Tooltip::set_markup()`][crate::Tooltip::set_markup()].
362 ///
363 /// This is a convenience property which will take care of getting the
364 /// tooltip shown if the given string is not [`None`]: [`has-tooltip`][struct@crate::Widget#has-tooltip]
365 /// will automatically be set to [`true`] and there will be taken care of
366 /// [`query-tooltip`][struct@crate::Widget#query-tooltip] in the default signal handler.
367 ///
368 /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and [`tooltip-markup`][struct@crate::Widget#tooltip-markup]
369 /// are set, the last one wins.
370 ///
371 /// Readable | Writable
372 ///
373 ///
374 /// #### `tooltip-text`
375 /// Sets the text of tooltip to be the given string.
376 ///
377 /// Also see [`Tooltip::set_text()`][crate::Tooltip::set_text()].
378 ///
379 /// This is a convenience property which will take care of getting the
380 /// tooltip shown if the given string is not [`None`]: [`has-tooltip`][struct@crate::Widget#has-tooltip]
381 /// will automatically be set to [`true`] and there will be taken care of
382 /// [`query-tooltip`][struct@crate::Widget#query-tooltip] in the default signal handler.
383 ///
384 /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and [`tooltip-markup`][struct@crate::Widget#tooltip-markup]
385 /// are set, the last one wins.
386 ///
387 /// Readable | Writable
388 ///
389 ///
390 /// #### `valign`
391 /// How to distribute vertical space if widget gets extra space, see [`Align`][crate::Align]
392 ///
393 /// Readable | Writable
394 ///
395 ///
396 /// #### `vexpand`
397 /// Whether to expand vertically. See [`WidgetExt::set_vexpand()`][crate::prelude::WidgetExt::set_vexpand()].
398 ///
399 /// Readable | Writable
400 ///
401 ///
402 /// #### `vexpand-set`
403 /// Whether to use the [`vexpand`][struct@crate::Widget#vexpand] property. See [`WidgetExt::is_vexpand_set()`][crate::prelude::WidgetExt::is_vexpand_set()].
404 ///
405 /// Readable | Writable
406 ///
407 ///
408 /// #### `visible`
409 /// Readable | Writable
410 ///
411 ///
412 /// #### `width-request`
413 /// Readable | Writable
414 ///
415 ///
416 /// #### `window`
417 /// The widget's window if it is realized, [`None`] otherwise.
418 ///
419 /// Readable
420 /// </details>
421 /// <details><summary><h4>Orientable</h4></summary>
422 ///
423 ///
424 /// #### `orientation`
425 /// The orientation of the orientable.
426 ///
427 /// Readable | Writable
428 /// </details>
429 ///
430 /// # Implements
431 ///
432 /// [`BoxExt`][trait@crate::prelude::BoxExt], [`ContainerExt`][trait@crate::prelude::ContainerExt], [`WidgetExt`][trait@crate::prelude::WidgetExt], [`trait@glib::ObjectExt`], [`BuildableExt`][trait@crate::prelude::BuildableExt], [`OrientableExt`][trait@crate::prelude::OrientableExt], [`ContainerExtManual`][trait@crate::prelude::ContainerExtManual], [`WidgetExtManual`][trait@crate::prelude::WidgetExtManual], [`BuildableExtManual`][trait@crate::prelude::BuildableExtManual]
433 #[doc(alias = "GtkShortcutsShortcut")]
434 pub struct ShortcutsShortcut(Object<ffi::GtkShortcutsShortcut, ffi::GtkShortcutsShortcutClass>) @extends Box, Container, Widget, @implements Buildable, Orientable;
435
436 match fn {
437 type_ => || ffi::gtk_shortcuts_shortcut_get_type(),
438 }
439}
440
441impl ShortcutsShortcut {
442 // rustdoc-stripper-ignore-next
443 /// Creates a new builder-pattern struct instance to construct [`ShortcutsShortcut`] objects.
444 ///
445 /// This method returns an instance of [`ShortcutsShortcutBuilder`](crate::builders::ShortcutsShortcutBuilder) which can be used to create [`ShortcutsShortcut`] objects.
446 pub fn builder() -> ShortcutsShortcutBuilder {
447 ShortcutsShortcutBuilder::new()
448 }
449
450 /// The size group for the accelerator portion of this shortcut.
451 ///
452 /// This is used internally by GTK+, and must not be modified by applications.
453 #[doc(alias = "accel-size-group")]
454 pub fn set_accel_size_group<P: IsA<SizeGroup>>(&self, accel_size_group: Option<&P>) {
455 ObjectExt::set_property(self, "accel-size-group", accel_size_group)
456 }
457
458 /// The accelerator(s) represented by this object. This property is used
459 /// if [`shortcut-type`][struct@crate::ShortcutsShortcut#shortcut-type] is set to [`ShortcutType::Accelerator`][crate::ShortcutType::Accelerator].
460 ///
461 /// The syntax of this property is (an extension of) the syntax understood by
462 /// [`accelerator_parse()`][crate::accelerator_parse()]. Multiple accelerators can be specified by separating
463 /// them with a space, but keep in mind that the available width is limited.
464 /// It is also possible to specify ranges of shortcuts, using `...` between the keys.
465 /// Sequences of keys can be specified using a `+` or `&` between the keys.
466 ///
467 /// Examples:
468 ///
469 /// - A single shortcut: ``<ctl>``<alt>`delete`
470 /// - Two alternative shortcuts: ``<shift>`a Home`
471 /// - A range of shortcuts: ``<alt>`1...`<alt>`9`
472 /// - Several keys pressed together: `Control_L&Control_R`
473 /// - A sequence of shortcuts or keys: ``<ctl>`c+`<ctl>`x`
474 ///
475 /// Use + instead of & when the keys may (or have to be) pressed sequentially (e.g
476 /// use t+t for 'press the t key twice').
477 ///
478 /// Note that `<`, `>` and `&` need to be escaped as <, > and & when used
479 /// in .ui files.
480 pub fn accelerator(&self) -> Option<glib::GString> {
481 ObjectExt::property(self, "accelerator")
482 }
483
484 /// The accelerator(s) represented by this object. This property is used
485 /// if [`shortcut-type`][struct@crate::ShortcutsShortcut#shortcut-type] is set to [`ShortcutType::Accelerator`][crate::ShortcutType::Accelerator].
486 ///
487 /// The syntax of this property is (an extension of) the syntax understood by
488 /// [`accelerator_parse()`][crate::accelerator_parse()]. Multiple accelerators can be specified by separating
489 /// them with a space, but keep in mind that the available width is limited.
490 /// It is also possible to specify ranges of shortcuts, using `...` between the keys.
491 /// Sequences of keys can be specified using a `+` or `&` between the keys.
492 ///
493 /// Examples:
494 ///
495 /// - A single shortcut: ``<ctl>``<alt>`delete`
496 /// - Two alternative shortcuts: ``<shift>`a Home`
497 /// - A range of shortcuts: ``<alt>`1...`<alt>`9`
498 /// - Several keys pressed together: `Control_L&Control_R`
499 /// - A sequence of shortcuts or keys: ``<ctl>`c+`<ctl>`x`
500 ///
501 /// Use + instead of & when the keys may (or have to be) pressed sequentially (e.g
502 /// use t+t for 'press the t key twice').
503 ///
504 /// Note that `<`, `>` and `&` need to be escaped as <, > and & when used
505 /// in .ui files.
506 pub fn set_accelerator(&self, accelerator: Option<&str>) {
507 ObjectExt::set_property(self, "accelerator", accelerator)
508 }
509
510 /// A detailed action name. If this is set for a shortcut
511 /// of type [`ShortcutType::Accelerator`][crate::ShortcutType::Accelerator], then GTK+ will use
512 /// the accelerators that are associated with the action
513 /// via [`GtkApplicationExt::set_accels_for_action()`][crate::prelude::GtkApplicationExt::set_accels_for_action()], and setting
514 /// [`accelerator`][struct@crate::ShortcutsShortcut#accelerator] is not necessary.
515 #[doc(alias = "action-name")]
516 pub fn action_name(&self) -> Option<glib::GString> {
517 ObjectExt::property(self, "action-name")
518 }
519
520 /// A detailed action name. If this is set for a shortcut
521 /// of type [`ShortcutType::Accelerator`][crate::ShortcutType::Accelerator], then GTK+ will use
522 /// the accelerators that are associated with the action
523 /// via [`GtkApplicationExt::set_accels_for_action()`][crate::prelude::GtkApplicationExt::set_accels_for_action()], and setting
524 /// [`accelerator`][struct@crate::ShortcutsShortcut#accelerator] is not necessary.
525 #[doc(alias = "action-name")]
526 pub fn set_action_name(&self, action_name: Option<&str>) {
527 ObjectExt::set_property(self, "action-name", action_name)
528 }
529
530 /// An icon to represent the shortcut or gesture. This property is used if
531 /// [`shortcut-type`][struct@crate::ShortcutsShortcut#shortcut-type] is set to [`ShortcutType::Gesture`][crate::ShortcutType::Gesture].
532 /// For the other predefined gesture types, GTK+ provides an icon on its own.
533 pub fn icon(&self) -> Option<gio::Icon> {
534 ObjectExt::property(self, "icon")
535 }
536
537 /// An icon to represent the shortcut or gesture. This property is used if
538 /// [`shortcut-type`][struct@crate::ShortcutsShortcut#shortcut-type] is set to [`ShortcutType::Gesture`][crate::ShortcutType::Gesture].
539 /// For the other predefined gesture types, GTK+ provides an icon on its own.
540 pub fn set_icon<P: IsA<gio::Icon>>(&self, icon: Option<&P>) {
541 ObjectExt::set_property(self, "icon", icon)
542 }
543
544 /// [`true`] if an icon has been set.
545 #[doc(alias = "icon-set")]
546 pub fn is_icon_set(&self) -> bool {
547 ObjectExt::property(self, "icon-set")
548 }
549
550 /// [`true`] if an icon has been set.
551 #[doc(alias = "icon-set")]
552 pub fn set_icon_set(&self, icon_set: bool) {
553 ObjectExt::set_property(self, "icon-set", icon_set)
554 }
555
556 /// The type of shortcut that is represented.
557 #[doc(alias = "shortcut-type")]
558 pub fn shortcut_type(&self) -> ShortcutType {
559 ObjectExt::property(self, "shortcut-type")
560 }
561
562 /// The type of shortcut that is represented.
563 #[doc(alias = "shortcut-type")]
564 pub fn set_shortcut_type(&self, shortcut_type: ShortcutType) {
565 ObjectExt::set_property(self, "shortcut-type", shortcut_type)
566 }
567
568 /// The subtitle for the shortcut or gesture.
569 ///
570 /// This is typically used for gestures and should be a short, one-line
571 /// text that describes the gesture itself. For the predefined gesture
572 /// types, GTK+ provides a subtitle on its own.
573 pub fn subtitle(&self) -> Option<glib::GString> {
574 ObjectExt::property(self, "subtitle")
575 }
576
577 /// The subtitle for the shortcut or gesture.
578 ///
579 /// This is typically used for gestures and should be a short, one-line
580 /// text that describes the gesture itself. For the predefined gesture
581 /// types, GTK+ provides a subtitle on its own.
582 pub fn set_subtitle(&self, subtitle: Option<&str>) {
583 ObjectExt::set_property(self, "subtitle", subtitle)
584 }
585
586 /// [`true`] if a subtitle has been set.
587 #[doc(alias = "subtitle-set")]
588 pub fn is_subtitle_set(&self) -> bool {
589 ObjectExt::property(self, "subtitle-set")
590 }
591
592 /// [`true`] if a subtitle has been set.
593 #[doc(alias = "subtitle-set")]
594 pub fn set_subtitle_set(&self, subtitle_set: bool) {
595 ObjectExt::set_property(self, "subtitle-set", subtitle_set)
596 }
597
598 /// The textual description for the shortcut or gesture represented by
599 /// this object. This should be a short string that can fit in a single line.
600 pub fn title(&self) -> Option<glib::GString> {
601 ObjectExt::property(self, "title")
602 }
603
604 /// The textual description for the shortcut or gesture represented by
605 /// this object. This should be a short string that can fit in a single line.
606 pub fn set_title(&self, title: Option<&str>) {
607 ObjectExt::set_property(self, "title", title)
608 }
609
610 /// The size group for the textual portion of this shortcut.
611 ///
612 /// This is used internally by GTK+, and must not be modified by applications.
613 #[doc(alias = "title-size-group")]
614 pub fn set_title_size_group<P: IsA<SizeGroup>>(&self, title_size_group: Option<&P>) {
615 ObjectExt::set_property(self, "title-size-group", title_size_group)
616 }
617
618 #[doc(alias = "accel-size-group")]
619 pub fn connect_accel_size_group_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
620 unsafe extern "C" fn notify_accel_size_group_trampoline<
621 F: Fn(&ShortcutsShortcut) + 'static,
622 >(
623 this: *mut ffi::GtkShortcutsShortcut,
624 _param_spec: glib::ffi::gpointer,
625 f: glib::ffi::gpointer,
626 ) {
627 unsafe {
628 let f: &F = &*(f as *const F);
629 f(&from_glib_borrow(this))
630 }
631 }
632 unsafe {
633 let f: Box_<F> = Box_::new(f);
634 connect_raw(
635 self.as_ptr() as *mut _,
636 c"notify::accel-size-group".as_ptr(),
637 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
638 notify_accel_size_group_trampoline::<F> as *const (),
639 )),
640 Box_::into_raw(f),
641 )
642 }
643 }
644
645 #[doc(alias = "accelerator")]
646 pub fn connect_accelerator_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
647 unsafe extern "C" fn notify_accelerator_trampoline<F: Fn(&ShortcutsShortcut) + 'static>(
648 this: *mut ffi::GtkShortcutsShortcut,
649 _param_spec: glib::ffi::gpointer,
650 f: glib::ffi::gpointer,
651 ) {
652 unsafe {
653 let f: &F = &*(f as *const F);
654 f(&from_glib_borrow(this))
655 }
656 }
657 unsafe {
658 let f: Box_<F> = Box_::new(f);
659 connect_raw(
660 self.as_ptr() as *mut _,
661 c"notify::accelerator".as_ptr(),
662 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
663 notify_accelerator_trampoline::<F> as *const (),
664 )),
665 Box_::into_raw(f),
666 )
667 }
668 }
669
670 #[doc(alias = "action-name")]
671 pub fn connect_action_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
672 unsafe extern "C" fn notify_action_name_trampoline<F: Fn(&ShortcutsShortcut) + 'static>(
673 this: *mut ffi::GtkShortcutsShortcut,
674 _param_spec: glib::ffi::gpointer,
675 f: glib::ffi::gpointer,
676 ) {
677 unsafe {
678 let f: &F = &*(f as *const F);
679 f(&from_glib_borrow(this))
680 }
681 }
682 unsafe {
683 let f: Box_<F> = Box_::new(f);
684 connect_raw(
685 self.as_ptr() as *mut _,
686 c"notify::action-name".as_ptr(),
687 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
688 notify_action_name_trampoline::<F> as *const (),
689 )),
690 Box_::into_raw(f),
691 )
692 }
693 }
694
695 #[doc(alias = "direction")]
696 pub fn connect_direction_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
697 unsafe extern "C" fn notify_direction_trampoline<F: Fn(&ShortcutsShortcut) + 'static>(
698 this: *mut ffi::GtkShortcutsShortcut,
699 _param_spec: glib::ffi::gpointer,
700 f: glib::ffi::gpointer,
701 ) {
702 unsafe {
703 let f: &F = &*(f as *const F);
704 f(&from_glib_borrow(this))
705 }
706 }
707 unsafe {
708 let f: Box_<F> = Box_::new(f);
709 connect_raw(
710 self.as_ptr() as *mut _,
711 c"notify::direction".as_ptr(),
712 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
713 notify_direction_trampoline::<F> as *const (),
714 )),
715 Box_::into_raw(f),
716 )
717 }
718 }
719
720 #[doc(alias = "icon")]
721 pub fn connect_icon_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
722 unsafe extern "C" fn notify_icon_trampoline<F: Fn(&ShortcutsShortcut) + 'static>(
723 this: *mut ffi::GtkShortcutsShortcut,
724 _param_spec: glib::ffi::gpointer,
725 f: glib::ffi::gpointer,
726 ) {
727 unsafe {
728 let f: &F = &*(f as *const F);
729 f(&from_glib_borrow(this))
730 }
731 }
732 unsafe {
733 let f: Box_<F> = Box_::new(f);
734 connect_raw(
735 self.as_ptr() as *mut _,
736 c"notify::icon".as_ptr(),
737 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
738 notify_icon_trampoline::<F> as *const (),
739 )),
740 Box_::into_raw(f),
741 )
742 }
743 }
744
745 #[doc(alias = "icon-set")]
746 pub fn connect_icon_set_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
747 unsafe extern "C" fn notify_icon_set_trampoline<F: Fn(&ShortcutsShortcut) + 'static>(
748 this: *mut ffi::GtkShortcutsShortcut,
749 _param_spec: glib::ffi::gpointer,
750 f: glib::ffi::gpointer,
751 ) {
752 unsafe {
753 let f: &F = &*(f as *const F);
754 f(&from_glib_borrow(this))
755 }
756 }
757 unsafe {
758 let f: Box_<F> = Box_::new(f);
759 connect_raw(
760 self.as_ptr() as *mut _,
761 c"notify::icon-set".as_ptr(),
762 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
763 notify_icon_set_trampoline::<F> as *const (),
764 )),
765 Box_::into_raw(f),
766 )
767 }
768 }
769
770 #[doc(alias = "shortcut-type")]
771 pub fn connect_shortcut_type_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
772 unsafe extern "C" fn notify_shortcut_type_trampoline<
773 F: Fn(&ShortcutsShortcut) + 'static,
774 >(
775 this: *mut ffi::GtkShortcutsShortcut,
776 _param_spec: glib::ffi::gpointer,
777 f: glib::ffi::gpointer,
778 ) {
779 unsafe {
780 let f: &F = &*(f as *const F);
781 f(&from_glib_borrow(this))
782 }
783 }
784 unsafe {
785 let f: Box_<F> = Box_::new(f);
786 connect_raw(
787 self.as_ptr() as *mut _,
788 c"notify::shortcut-type".as_ptr(),
789 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
790 notify_shortcut_type_trampoline::<F> as *const (),
791 )),
792 Box_::into_raw(f),
793 )
794 }
795 }
796
797 #[doc(alias = "subtitle")]
798 pub fn connect_subtitle_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
799 unsafe extern "C" fn notify_subtitle_trampoline<F: Fn(&ShortcutsShortcut) + 'static>(
800 this: *mut ffi::GtkShortcutsShortcut,
801 _param_spec: glib::ffi::gpointer,
802 f: glib::ffi::gpointer,
803 ) {
804 unsafe {
805 let f: &F = &*(f as *const F);
806 f(&from_glib_borrow(this))
807 }
808 }
809 unsafe {
810 let f: Box_<F> = Box_::new(f);
811 connect_raw(
812 self.as_ptr() as *mut _,
813 c"notify::subtitle".as_ptr(),
814 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
815 notify_subtitle_trampoline::<F> as *const (),
816 )),
817 Box_::into_raw(f),
818 )
819 }
820 }
821
822 #[doc(alias = "subtitle-set")]
823 pub fn connect_subtitle_set_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
824 unsafe extern "C" fn notify_subtitle_set_trampoline<F: Fn(&ShortcutsShortcut) + 'static>(
825 this: *mut ffi::GtkShortcutsShortcut,
826 _param_spec: glib::ffi::gpointer,
827 f: glib::ffi::gpointer,
828 ) {
829 unsafe {
830 let f: &F = &*(f as *const F);
831 f(&from_glib_borrow(this))
832 }
833 }
834 unsafe {
835 let f: Box_<F> = Box_::new(f);
836 connect_raw(
837 self.as_ptr() as *mut _,
838 c"notify::subtitle-set".as_ptr(),
839 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
840 notify_subtitle_set_trampoline::<F> as *const (),
841 )),
842 Box_::into_raw(f),
843 )
844 }
845 }
846
847 #[doc(alias = "title")]
848 pub fn connect_title_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
849 unsafe extern "C" fn notify_title_trampoline<F: Fn(&ShortcutsShortcut) + 'static>(
850 this: *mut ffi::GtkShortcutsShortcut,
851 _param_spec: glib::ffi::gpointer,
852 f: glib::ffi::gpointer,
853 ) {
854 unsafe {
855 let f: &F = &*(f as *const F);
856 f(&from_glib_borrow(this))
857 }
858 }
859 unsafe {
860 let f: Box_<F> = Box_::new(f);
861 connect_raw(
862 self.as_ptr() as *mut _,
863 c"notify::title".as_ptr(),
864 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
865 notify_title_trampoline::<F> as *const (),
866 )),
867 Box_::into_raw(f),
868 )
869 }
870 }
871
872 #[doc(alias = "title-size-group")]
873 pub fn connect_title_size_group_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
874 unsafe extern "C" fn notify_title_size_group_trampoline<
875 F: Fn(&ShortcutsShortcut) + 'static,
876 >(
877 this: *mut ffi::GtkShortcutsShortcut,
878 _param_spec: glib::ffi::gpointer,
879 f: glib::ffi::gpointer,
880 ) {
881 unsafe {
882 let f: &F = &*(f as *const F);
883 f(&from_glib_borrow(this))
884 }
885 }
886 unsafe {
887 let f: Box_<F> = Box_::new(f);
888 connect_raw(
889 self.as_ptr() as *mut _,
890 c"notify::title-size-group".as_ptr(),
891 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
892 notify_title_size_group_trampoline::<F> as *const (),
893 )),
894 Box_::into_raw(f),
895 )
896 }
897 }
898}
899
900// rustdoc-stripper-ignore-next
901/// A [builder-pattern] type to construct [`ShortcutsShortcut`] objects.
902///
903/// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html
904#[must_use = "The builder must be built to be used"]
905pub struct ShortcutsShortcutBuilder {
906 builder: glib::object::ObjectBuilder<'static, ShortcutsShortcut>,
907}
908
909impl ShortcutsShortcutBuilder {
910 fn new() -> Self {
911 Self {
912 builder: glib::object::Object::builder(),
913 }
914 }
915
916 /// The size group for the accelerator portion of this shortcut.
917 ///
918 /// This is used internally by GTK+, and must not be modified by applications.
919 pub fn accel_size_group(self, accel_size_group: &impl IsA<SizeGroup>) -> Self {
920 Self {
921 builder: self
922 .builder
923 .property("accel-size-group", accel_size_group.clone().upcast()),
924 }
925 }
926
927 /// The accelerator(s) represented by this object. This property is used
928 /// if [`shortcut-type`][struct@crate::ShortcutsShortcut#shortcut-type] is set to [`ShortcutType::Accelerator`][crate::ShortcutType::Accelerator].
929 ///
930 /// The syntax of this property is (an extension of) the syntax understood by
931 /// [`accelerator_parse()`][crate::accelerator_parse()]. Multiple accelerators can be specified by separating
932 /// them with a space, but keep in mind that the available width is limited.
933 /// It is also possible to specify ranges of shortcuts, using `...` between the keys.
934 /// Sequences of keys can be specified using a `+` or `&` between the keys.
935 ///
936 /// Examples:
937 ///
938 /// - A single shortcut: ``<ctl>``<alt>`delete`
939 /// - Two alternative shortcuts: ``<shift>`a Home`
940 /// - A range of shortcuts: ``<alt>`1...`<alt>`9`
941 /// - Several keys pressed together: `Control_L&Control_R`
942 /// - A sequence of shortcuts or keys: ``<ctl>`c+`<ctl>`x`
943 ///
944 /// Use + instead of & when the keys may (or have to be) pressed sequentially (e.g
945 /// use t+t for 'press the t key twice').
946 ///
947 /// Note that `<`, `>` and `&` need to be escaped as <, > and & when used
948 /// in .ui files.
949 pub fn accelerator(self, accelerator: impl Into<glib::GString>) -> Self {
950 Self {
951 builder: self.builder.property("accelerator", accelerator.into()),
952 }
953 }
954
955 /// A detailed action name. If this is set for a shortcut
956 /// of type [`ShortcutType::Accelerator`][crate::ShortcutType::Accelerator], then GTK+ will use
957 /// the accelerators that are associated with the action
958 /// via [`GtkApplicationExt::set_accels_for_action()`][crate::prelude::GtkApplicationExt::set_accels_for_action()], and setting
959 /// [`accelerator`][struct@crate::ShortcutsShortcut#accelerator] is not necessary.
960 pub fn action_name(self, action_name: impl Into<glib::GString>) -> Self {
961 Self {
962 builder: self.builder.property("action-name", action_name.into()),
963 }
964 }
965
966 /// The text direction for which this shortcut is active. If the shortcut
967 /// is used regardless of the text direction, set this property to
968 /// [`TextDirection::None`][crate::TextDirection::None].
969 pub fn direction(self, direction: TextDirection) -> Self {
970 Self {
971 builder: self.builder.property("direction", direction),
972 }
973 }
974
975 /// An icon to represent the shortcut or gesture. This property is used if
976 /// [`shortcut-type`][struct@crate::ShortcutsShortcut#shortcut-type] is set to [`ShortcutType::Gesture`][crate::ShortcutType::Gesture].
977 /// For the other predefined gesture types, GTK+ provides an icon on its own.
978 pub fn icon(self, icon: &impl IsA<gio::Icon>) -> Self {
979 Self {
980 builder: self.builder.property("icon", icon.clone().upcast()),
981 }
982 }
983
984 /// [`true`] if an icon has been set.
985 pub fn icon_set(self, icon_set: bool) -> Self {
986 Self {
987 builder: self.builder.property("icon-set", icon_set),
988 }
989 }
990
991 /// The type of shortcut that is represented.
992 pub fn shortcut_type(self, shortcut_type: ShortcutType) -> Self {
993 Self {
994 builder: self.builder.property("shortcut-type", shortcut_type),
995 }
996 }
997
998 /// The subtitle for the shortcut or gesture.
999 ///
1000 /// This is typically used for gestures and should be a short, one-line
1001 /// text that describes the gesture itself. For the predefined gesture
1002 /// types, GTK+ provides a subtitle on its own.
1003 pub fn subtitle(self, subtitle: impl Into<glib::GString>) -> Self {
1004 Self {
1005 builder: self.builder.property("subtitle", subtitle.into()),
1006 }
1007 }
1008
1009 /// [`true`] if a subtitle has been set.
1010 pub fn subtitle_set(self, subtitle_set: bool) -> Self {
1011 Self {
1012 builder: self.builder.property("subtitle-set", subtitle_set),
1013 }
1014 }
1015
1016 /// The textual description for the shortcut or gesture represented by
1017 /// this object. This should be a short string that can fit in a single line.
1018 pub fn title(self, title: impl Into<glib::GString>) -> Self {
1019 Self {
1020 builder: self.builder.property("title", title.into()),
1021 }
1022 }
1023
1024 /// The size group for the textual portion of this shortcut.
1025 ///
1026 /// This is used internally by GTK+, and must not be modified by applications.
1027 pub fn title_size_group(self, title_size_group: &impl IsA<SizeGroup>) -> Self {
1028 Self {
1029 builder: self
1030 .builder
1031 .property("title-size-group", title_size_group.clone().upcast()),
1032 }
1033 }
1034
1035 pub fn baseline_position(self, baseline_position: BaselinePosition) -> Self {
1036 Self {
1037 builder: self
1038 .builder
1039 .property("baseline-position", baseline_position),
1040 }
1041 }
1042
1043 pub fn homogeneous(self, homogeneous: bool) -> Self {
1044 Self {
1045 builder: self.builder.property("homogeneous", homogeneous),
1046 }
1047 }
1048
1049 pub fn spacing(self, spacing: i32) -> Self {
1050 Self {
1051 builder: self.builder.property("spacing", spacing),
1052 }
1053 }
1054
1055 pub fn border_width(self, border_width: u32) -> Self {
1056 Self {
1057 builder: self.builder.property("border-width", border_width),
1058 }
1059 }
1060
1061 pub fn child(self, child: &impl IsA<Widget>) -> Self {
1062 Self {
1063 builder: self.builder.property("child", child.clone().upcast()),
1064 }
1065 }
1066
1067 pub fn resize_mode(self, resize_mode: ResizeMode) -> Self {
1068 Self {
1069 builder: self.builder.property("resize-mode", resize_mode),
1070 }
1071 }
1072
1073 pub fn app_paintable(self, app_paintable: bool) -> Self {
1074 Self {
1075 builder: self.builder.property("app-paintable", app_paintable),
1076 }
1077 }
1078
1079 pub fn can_default(self, can_default: bool) -> Self {
1080 Self {
1081 builder: self.builder.property("can-default", can_default),
1082 }
1083 }
1084
1085 pub fn can_focus(self, can_focus: bool) -> Self {
1086 Self {
1087 builder: self.builder.property("can-focus", can_focus),
1088 }
1089 }
1090
1091 pub fn events(self, events: gdk::EventMask) -> Self {
1092 Self {
1093 builder: self.builder.property("events", events),
1094 }
1095 }
1096
1097 /// Whether to expand in both directions. Setting this sets both [`hexpand`][struct@crate::Widget#hexpand] and [`vexpand`][struct@crate::Widget#vexpand]
1098 pub fn expand(self, expand: bool) -> Self {
1099 Self {
1100 builder: self.builder.property("expand", expand),
1101 }
1102 }
1103
1104 /// Whether the widget should grab focus when it is clicked with the mouse.
1105 ///
1106 /// This property is only relevant for widgets that can take focus.
1107 ///
1108 /// Before 3.20, several widgets (GtkButton, GtkFileChooserButton,
1109 /// GtkComboBox) implemented this property individually.
1110 pub fn focus_on_click(self, focus_on_click: bool) -> Self {
1111 Self {
1112 builder: self.builder.property("focus-on-click", focus_on_click),
1113 }
1114 }
1115
1116 /// How to distribute horizontal space if widget gets extra space, see [`Align`][crate::Align]
1117 pub fn halign(self, halign: Align) -> Self {
1118 Self {
1119 builder: self.builder.property("halign", halign),
1120 }
1121 }
1122
1123 pub fn has_default(self, has_default: bool) -> Self {
1124 Self {
1125 builder: self.builder.property("has-default", has_default),
1126 }
1127 }
1128
1129 pub fn has_focus(self, has_focus: bool) -> Self {
1130 Self {
1131 builder: self.builder.property("has-focus", has_focus),
1132 }
1133 }
1134
1135 /// Enables or disables the emission of [`query-tooltip`][struct@crate::Widget#query-tooltip] on `widget`.
1136 /// A value of [`true`] indicates that `widget` can have a tooltip, in this case
1137 /// the widget will be queried using [`query-tooltip`][struct@crate::Widget#query-tooltip] to determine
1138 /// whether it will provide a tooltip or not.
1139 ///
1140 /// Note that setting this property to [`true`] for the first time will change
1141 /// the event masks of the GdkWindows of this widget to include leave-notify
1142 /// and motion-notify events. This cannot and will not be undone when the
1143 /// property is set to [`false`] again.
1144 pub fn has_tooltip(self, has_tooltip: bool) -> Self {
1145 Self {
1146 builder: self.builder.property("has-tooltip", has_tooltip),
1147 }
1148 }
1149
1150 pub fn height_request(self, height_request: i32) -> Self {
1151 Self {
1152 builder: self.builder.property("height-request", height_request),
1153 }
1154 }
1155
1156 /// Whether to expand horizontally. See [`WidgetExt::set_hexpand()`][crate::prelude::WidgetExt::set_hexpand()].
1157 pub fn hexpand(self, hexpand: bool) -> Self {
1158 Self {
1159 builder: self.builder.property("hexpand", hexpand),
1160 }
1161 }
1162
1163 /// Whether to use the [`hexpand`][struct@crate::Widget#hexpand] property. See [`WidgetExt::is_hexpand_set()`][crate::prelude::WidgetExt::is_hexpand_set()].
1164 pub fn hexpand_set(self, hexpand_set: bool) -> Self {
1165 Self {
1166 builder: self.builder.property("hexpand-set", hexpand_set),
1167 }
1168 }
1169
1170 pub fn is_focus(self, is_focus: bool) -> Self {
1171 Self {
1172 builder: self.builder.property("is-focus", is_focus),
1173 }
1174 }
1175
1176 /// Sets all four sides' margin at once. If read, returns max
1177 /// margin on any side.
1178 pub fn margin(self, margin: i32) -> Self {
1179 Self {
1180 builder: self.builder.property("margin", margin),
1181 }
1182 }
1183
1184 /// Margin on bottom side of widget.
1185 ///
1186 /// This property adds margin outside of the widget's normal size
1187 /// request, the margin will be added in addition to the size from
1188 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
1189 pub fn margin_bottom(self, margin_bottom: i32) -> Self {
1190 Self {
1191 builder: self.builder.property("margin-bottom", margin_bottom),
1192 }
1193 }
1194
1195 /// Margin on end of widget, horizontally. This property supports
1196 /// left-to-right and right-to-left text directions.
1197 ///
1198 /// This property adds margin outside of the widget's normal size
1199 /// request, the margin will be added in addition to the size from
1200 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
1201 pub fn margin_end(self, margin_end: i32) -> Self {
1202 Self {
1203 builder: self.builder.property("margin-end", margin_end),
1204 }
1205 }
1206
1207 /// Margin on start of widget, horizontally. This property supports
1208 /// left-to-right and right-to-left text directions.
1209 ///
1210 /// This property adds margin outside of the widget's normal size
1211 /// request, the margin will be added in addition to the size from
1212 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
1213 pub fn margin_start(self, margin_start: i32) -> Self {
1214 Self {
1215 builder: self.builder.property("margin-start", margin_start),
1216 }
1217 }
1218
1219 /// Margin on top side of widget.
1220 ///
1221 /// This property adds margin outside of the widget's normal size
1222 /// request, the margin will be added in addition to the size from
1223 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
1224 pub fn margin_top(self, margin_top: i32) -> Self {
1225 Self {
1226 builder: self.builder.property("margin-top", margin_top),
1227 }
1228 }
1229
1230 pub fn name(self, name: impl Into<glib::GString>) -> Self {
1231 Self {
1232 builder: self.builder.property("name", name.into()),
1233 }
1234 }
1235
1236 pub fn no_show_all(self, no_show_all: bool) -> Self {
1237 Self {
1238 builder: self.builder.property("no-show-all", no_show_all),
1239 }
1240 }
1241
1242 /// The requested opacity of the widget. See [`WidgetExt::set_opacity()`][crate::prelude::WidgetExt::set_opacity()] for
1243 /// more details about window opacity.
1244 ///
1245 /// Before 3.8 this was only available in GtkWindow
1246 pub fn opacity(self, opacity: f64) -> Self {
1247 Self {
1248 builder: self.builder.property("opacity", opacity),
1249 }
1250 }
1251
1252 pub fn parent(self, parent: &impl IsA<Container>) -> Self {
1253 Self {
1254 builder: self.builder.property("parent", parent.clone().upcast()),
1255 }
1256 }
1257
1258 pub fn receives_default(self, receives_default: bool) -> Self {
1259 Self {
1260 builder: self.builder.property("receives-default", receives_default),
1261 }
1262 }
1263
1264 pub fn sensitive(self, sensitive: bool) -> Self {
1265 Self {
1266 builder: self.builder.property("sensitive", sensitive),
1267 }
1268 }
1269
1270 /// Sets the text of tooltip to be the given string, which is marked up
1271 /// with the [Pango text markup language][PangoMarkupFormat].
1272 /// Also see [`Tooltip::set_markup()`][crate::Tooltip::set_markup()].
1273 ///
1274 /// This is a convenience property which will take care of getting the
1275 /// tooltip shown if the given string is not [`None`]: [`has-tooltip`][struct@crate::Widget#has-tooltip]
1276 /// will automatically be set to [`true`] and there will be taken care of
1277 /// [`query-tooltip`][struct@crate::Widget#query-tooltip] in the default signal handler.
1278 ///
1279 /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and [`tooltip-markup`][struct@crate::Widget#tooltip-markup]
1280 /// are set, the last one wins.
1281 pub fn tooltip_markup(self, tooltip_markup: impl Into<glib::GString>) -> Self {
1282 Self {
1283 builder: self
1284 .builder
1285 .property("tooltip-markup", tooltip_markup.into()),
1286 }
1287 }
1288
1289 /// Sets the text of tooltip to be the given string.
1290 ///
1291 /// Also see [`Tooltip::set_text()`][crate::Tooltip::set_text()].
1292 ///
1293 /// This is a convenience property which will take care of getting the
1294 /// tooltip shown if the given string is not [`None`]: [`has-tooltip`][struct@crate::Widget#has-tooltip]
1295 /// will automatically be set to [`true`] and there will be taken care of
1296 /// [`query-tooltip`][struct@crate::Widget#query-tooltip] in the default signal handler.
1297 ///
1298 /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and [`tooltip-markup`][struct@crate::Widget#tooltip-markup]
1299 /// are set, the last one wins.
1300 pub fn tooltip_text(self, tooltip_text: impl Into<glib::GString>) -> Self {
1301 Self {
1302 builder: self.builder.property("tooltip-text", tooltip_text.into()),
1303 }
1304 }
1305
1306 /// How to distribute vertical space if widget gets extra space, see [`Align`][crate::Align]
1307 pub fn valign(self, valign: Align) -> Self {
1308 Self {
1309 builder: self.builder.property("valign", valign),
1310 }
1311 }
1312
1313 /// Whether to expand vertically. See [`WidgetExt::set_vexpand()`][crate::prelude::WidgetExt::set_vexpand()].
1314 pub fn vexpand(self, vexpand: bool) -> Self {
1315 Self {
1316 builder: self.builder.property("vexpand", vexpand),
1317 }
1318 }
1319
1320 /// Whether to use the [`vexpand`][struct@crate::Widget#vexpand] property. See [`WidgetExt::is_vexpand_set()`][crate::prelude::WidgetExt::is_vexpand_set()].
1321 pub fn vexpand_set(self, vexpand_set: bool) -> Self {
1322 Self {
1323 builder: self.builder.property("vexpand-set", vexpand_set),
1324 }
1325 }
1326
1327 pub fn visible(self, visible: bool) -> Self {
1328 Self {
1329 builder: self.builder.property("visible", visible),
1330 }
1331 }
1332
1333 pub fn width_request(self, width_request: i32) -> Self {
1334 Self {
1335 builder: self.builder.property("width-request", width_request),
1336 }
1337 }
1338
1339 /// The orientation of the orientable.
1340 pub fn orientation(self, orientation: Orientation) -> Self {
1341 Self {
1342 builder: self.builder.property("orientation", orientation),
1343 }
1344 }
1345
1346 // rustdoc-stripper-ignore-next
1347 /// Build the [`ShortcutsShortcut`].
1348 #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
1349 pub fn build(self) -> ShortcutsShortcut {
1350 assert_initialized_main_thread!();
1351 self.builder.build()
1352 }
1353}