Struct vte4::builders::TerminalBuilder
source · pub struct TerminalBuilder { /* private fields */ }
Expand description
A builder-pattern type to construct Terminal
objects.
Implementations§
source§impl TerminalBuilder
impl TerminalBuilder
sourcepub fn allow_hyperlink(self, allow_hyperlink: bool) -> Self
pub fn allow_hyperlink(self, allow_hyperlink: bool) -> Self
Controls whether or not hyperlinks (OSC 8 escape sequence) are recognized and displayed.
sourcepub fn audible_bell(self, audible_bell: bool) -> Self
pub fn audible_bell(self, audible_bell: bool) -> Self
Controls whether or not the terminal will beep when the child outputs the “bl” sequence.
sourcepub fn backspace_binding(self, backspace_binding: EraseBinding) -> Self
pub fn backspace_binding(self, backspace_binding: EraseBinding) -> Self
Controls what string or control sequence the terminal sends to its child when the user presses the backspace key.
sourcepub fn bold_is_bright(self, bold_is_bright: bool) -> Self
pub fn bold_is_bright(self, bold_is_bright: bool) -> Self
Whether the SGR 1 attribute also switches to the bright counterpart of the first 8 palette colors, in addition to making them bold (legacy behavior) or if SGR 1 only enables bold and leaves the color intact.
sourcepub fn cell_height_scale(self, cell_height_scale: f64) -> Self
pub fn cell_height_scale(self, cell_height_scale: f64) -> Self
Scale factor for the cell height, to increase line spacing. (The font’s height is not affected.)
sourcepub fn cell_width_scale(self, cell_width_scale: f64) -> Self
pub fn cell_width_scale(self, cell_width_scale: f64) -> Self
Scale factor for the cell width, to increase letter spacing. (The font’s width is not affected.)
sourcepub fn cjk_ambiguous_width(self, cjk_ambiguous_width: i32) -> Self
pub fn cjk_ambiguous_width(self, cjk_ambiguous_width: i32) -> Self
This setting controls whether ambiguous-width characters are narrow or wide. (Note that when using a non-UTF-8 encoding set via vte_terminal_set_encoding(), the width of ambiguous-width characters is fixed and determined by the encoding itself.)
This setting only takes effect the next time the terminal is reset, either via escape sequence or with vte_terminal_reset().
Available on crate feature v0_76
only.
v0_76
only.The menu used for context menus. Note that context menu model set with the #VteTerminal::context-menu-model property or vte_terminal_set_context_menu_model() takes precedence over this.
Available on crate feature v0_76
only.
v0_76
only.The menu model used for context menus. If non-None
, the context menu is
generated from this model, and overrides a context menu set with the
#VteTerminal::context-menu property or vte_terminal_set_context_menu().
sourcepub fn cursor_blink_mode(self, cursor_blink_mode: CursorBlinkMode) -> Self
pub fn cursor_blink_mode(self, cursor_blink_mode: CursorBlinkMode) -> Self
Sets whether or not the cursor will blink. Using CursorBlinkMode::System
will use the #GtkSettings:gtk-cursor-blink setting.
sourcepub fn cursor_shape(self, cursor_shape: CursorShape) -> Self
pub fn cursor_shape(self, cursor_shape: CursorShape) -> Self
Controls the shape of the cursor.
sourcepub fn delete_binding(self, delete_binding: EraseBinding) -> Self
pub fn delete_binding(self, delete_binding: EraseBinding) -> Self
Controls what string or control sequence the terminal sends to its child when the user presses the delete key.
sourcepub fn enable_a11y(self, enable_a11y: bool) -> Self
Available on crate feature v0_78
only.
pub fn enable_a11y(self, enable_a11y: bool) -> Self
v0_78
only.Controls whether or not a11y is enabled for the widget.
sourcepub fn enable_bidi(self, enable_bidi: bool) -> Self
pub fn enable_bidi(self, enable_bidi: bool) -> Self
Controls whether or not the terminal will perform bidirectional text rendering.
pub fn enable_fallback_scrolling(self, enable_fallback_scrolling: bool) -> Self
sourcepub fn enable_shaping(self, enable_shaping: bool) -> Self
pub fn enable_shaping(self, enable_shaping: bool) -> Self
Controls whether or not the terminal will shape Arabic text.
sourcepub fn enable_sixel(self, enable_sixel: bool) -> Self
pub fn enable_sixel(self, enable_sixel: bool) -> Self
Controls whether SIXEL image support is enabled.
sourcepub fn font_desc(self, font_desc: &FontDescription) -> Self
pub fn font_desc(self, font_desc: &FontDescription) -> Self
Specifies the font used for rendering all text displayed by the terminal, overriding any fonts set using gtk_widget_modify_font(). The terminal will immediately attempt to load the desired font, retrieve its metrics, and attempt to resize itself to keep the same number of rows and columns.
sourcepub fn font_options(self, font_options: &FontOptions) -> Self
Available on crate feature v0_74
only.
pub fn font_options(self, font_options: &FontOptions) -> Self
v0_74
only.The terminal’s font options, or None
to use the default font options.
Note that on GTK4, the terminal by default uses font options
with CAIRO_HINT_METRICS_ON
set; to override that, use this
function to set a #cairo_font_options_t that has
CAIRO_HINT_METRICS_OFF
set.
sourcepub fn font_scale(self, font_scale: f64) -> Self
pub fn font_scale(self, font_scale: f64) -> Self
The terminal’s font scale.
sourcepub fn input_enabled(self, input_enabled: bool) -> Self
pub fn input_enabled(self, input_enabled: bool) -> Self
Controls whether the terminal allows user input. When user input is disabled, key press and mouse button press and motion events are not sent to the terminal’s child.
sourcepub fn pointer_autohide(self, pointer_autohide: bool) -> Self
pub fn pointer_autohide(self, pointer_autohide: bool) -> Self
Controls the value of the terminal’s mouse autohide setting. When autohiding is enabled, the mouse cursor will be hidden when the user presses a key and shown when the user moves the mouse.
sourcepub fn scroll_on_insert(self, scroll_on_insert: bool) -> Self
Available on crate feature v0_76
only.
pub fn scroll_on_insert(self, scroll_on_insert: bool) -> Self
v0_76
only.Controls whether or not the terminal will forcibly scroll to the bottom of the viewable history when the text is inserted (e.g. by a paste).
sourcepub fn scroll_on_keystroke(self, scroll_on_keystroke: bool) -> Self
pub fn scroll_on_keystroke(self, scroll_on_keystroke: bool) -> Self
Controls whether or not the terminal will forcibly scroll to the bottom of the viewable history when the user presses a key. Modifier keys do not trigger this behavior.
sourcepub fn scroll_on_output(self, scroll_on_output: bool) -> Self
pub fn scroll_on_output(self, scroll_on_output: bool) -> Self
Controls whether or not the terminal will forcibly scroll to the bottom of the viewable history when the new data is received from the child.
sourcepub fn scroll_unit_is_pixels(self, scroll_unit_is_pixels: bool) -> Self
pub fn scroll_unit_is_pixels(self, scroll_unit_is_pixels: bool) -> Self
Controls whether the terminal’s GtkAdjustment values unit is lines or pixels. This can be enabled when the terminal is the child of a GtkScrolledWindow to fix some bugs with its kinetic scrolling.
sourcepub fn scrollback_lines(self, scrollback_lines: u32) -> Self
pub fn scrollback_lines(self, scrollback_lines: u32) -> Self
The length of the scrollback buffer used by the terminal. The size of the scrollback buffer will be set to the larger of this value and the number of visible rows the widget can display, so 0 can safely be used to disable scrollback. Note that this setting only affects the normal screen buffer. For terminal types which have an alternate screen buffer, no scrollback is allowed on the alternate screen buffer.
sourcepub fn text_blink_mode(self, text_blink_mode: TextBlinkMode) -> Self
pub fn text_blink_mode(self, text_blink_mode: TextBlinkMode) -> Self
Controls whether or not the terminal will allow blinking text.
sourcepub fn xalign(self, xalign: Align) -> Self
Available on crate feature v0_76
only.
pub fn xalign(self, xalign: Align) -> Self
v0_76
only.The horizontal alignment of @terminal within its allocation.
sourcepub fn xfill(self, xfill: bool) -> Self
Available on crate feature v0_76
only.
pub fn xfill(self, xfill: bool) -> Self
v0_76
only.The horizontal fillment of @terminal within its allocation.
sourcepub fn yalign(self, yalign: Align) -> Self
Available on crate feature v0_76
only.
pub fn yalign(self, yalign: Align) -> Self
v0_76
only.The vertical alignment of @terminal within its allocation
sourcepub fn yfill(self, yfill: bool) -> Self
Available on crate feature v0_76
only.
pub fn yfill(self, yfill: bool) -> Self
v0_76
only.The vertical fillment of @terminal within its allocation.
Note that #VteTerminal:yfill=true
is only supported with
#VteTerminal:yalign=Align::Start
, and is ignored for
all other yalign values.
sourcepub fn can_focus(self, can_focus: bool) -> Self
pub fn can_focus(self, can_focus: bool) -> Self
Whether the widget or any of its descendents can accept the input focus.
This property is meant to be set by widget implementations, typically in their instance init function.
sourcepub fn can_target(self, can_target: bool) -> Self
pub fn can_target(self, can_target: bool) -> Self
Whether the widget can receive pointer events.
sourcepub fn css_classes(self, css_classes: impl Into<StrV>) -> Self
pub fn css_classes(self, css_classes: impl Into<StrV>) -> Self
A list of css classes applied to this widget.
sourcepub fn css_name(self, css_name: impl Into<GString>) -> Self
pub fn css_name(self, css_name: impl Into<GString>) -> Self
The name of this widget in the CSS tree.
This property is meant to be set by widget implementations, typically in their instance init function.
sourcepub fn focus_on_click(self, focus_on_click: bool) -> Self
pub fn focus_on_click(self, focus_on_click: bool) -> Self
Whether the widget should grab focus when it is clicked with the mouse.
This property is only relevant for widgets that can take focus.
sourcepub fn focusable(self, focusable: bool) -> Self
pub fn focusable(self, focusable: bool) -> Self
Whether this widget itself will accept the input focus.
sourcepub fn has_tooltip(self, has_tooltip: bool) -> Self
pub fn has_tooltip(self, has_tooltip: bool) -> Self
Enables or disables the emission of the ::query-tooltip signal on @widget.
A value of true
indicates that @widget can have a tooltip, in this case
the widget will be queried using query-tooltip
to
determine whether it will provide a tooltip or not.
sourcepub fn height_request(self, height_request: i32) -> Self
pub fn height_request(self, height_request: i32) -> Self
Override for height request of the widget.
If this is -1, the natural request will be used.
sourcepub fn hexpand_set(self, hexpand_set: bool) -> Self
pub fn hexpand_set(self, hexpand_set: bool) -> Self
Whether to use the hexpand
property.
sourcepub fn margin_bottom(self, margin_bottom: i32) -> Self
pub fn margin_bottom(self, margin_bottom: i32) -> Self
Margin on bottom side of widget.
This property adds margin outside of the widget’s normal size
request, the margin will be added in addition to the size from
[WidgetExtManual::set_size_request()
][crate::gtk::prelude::WidgetExtManual::set_size_request()] for example.
sourcepub fn margin_end(self, margin_end: i32) -> Self
pub fn margin_end(self, margin_end: i32) -> Self
Margin on end of widget, horizontally.
This property supports left-to-right and right-to-left text directions.
This property adds margin outside of the widget’s normal size
request, the margin will be added in addition to the size from
[WidgetExtManual::set_size_request()
][crate::gtk::prelude::WidgetExtManual::set_size_request()] for example.
sourcepub fn margin_start(self, margin_start: i32) -> Self
pub fn margin_start(self, margin_start: i32) -> Self
Margin on start of widget, horizontally.
This property supports left-to-right and right-to-left text directions.
This property adds margin outside of the widget’s normal size
request, the margin will be added in addition to the size from
[WidgetExtManual::set_size_request()
][crate::gtk::prelude::WidgetExtManual::set_size_request()] for example.
sourcepub fn margin_top(self, margin_top: i32) -> Self
pub fn margin_top(self, margin_top: i32) -> Self
Margin on top side of widget.
This property adds margin outside of the widget’s normal size
request, the margin will be added in addition to the size from
[WidgetExtManual::set_size_request()
][crate::gtk::prelude::WidgetExtManual::set_size_request()] for example.
sourcepub fn receives_default(self, receives_default: bool) -> Self
pub fn receives_default(self, receives_default: bool) -> Self
Whether the widget will receive the default action when it is focused.
sourcepub fn tooltip_markup(self, tooltip_markup: impl Into<GString>) -> Self
pub fn tooltip_markup(self, tooltip_markup: impl Into<GString>) -> Self
Sets the text of tooltip to be the given string, which is marked up with Pango markup.
Also see Gtk::Tooltip::set_markup()
.
This is a convenience property which will take care of getting the
tooltip shown if the given string is not None
:
has-tooltip
will automatically be set to true
and there will be taken care of query-tooltip
in
the default signal handler.
Note that if both tooltip-text
and
tooltip-markup
are set, the last one wins.
sourcepub fn tooltip_text(self, tooltip_text: impl Into<GString>) -> Self
pub fn tooltip_text(self, tooltip_text: impl Into<GString>) -> Self
Sets the text of tooltip to be the given string.
Also see Gtk::Tooltip::set_text()
.
This is a convenience property which will take care of getting the
tooltip shown if the given string is not None
:
has-tooltip
will automatically be set to true
and there will be taken care of query-tooltip
in
the default signal handler.
Note that if both tooltip-text
and
tooltip-markup
are set, the last one wins.
sourcepub fn vexpand_set(self, vexpand_set: bool) -> Self
pub fn vexpand_set(self, vexpand_set: bool) -> Self
Whether to use the vexpand
property.
sourcepub fn width_request(self, width_request: i32) -> Self
pub fn width_request(self, width_request: i32) -> Self
Override for width request of the widget.
If this is -1, the natural request will be used.