Struct vte4::builders::TerminalBuilder

source ·
pub struct TerminalBuilder { /* private fields */ }
Expand description

A builder-pattern type to construct Terminal objects.

Implementations§

source§

impl TerminalBuilder

Controls whether or not hyperlinks (OSC 8 escape sequence) are recognized and displayed.

source

pub fn audible_bell(self, audible_bell: bool) -> Self

Controls whether or not the terminal will beep when the child outputs the “bl” sequence.

source

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.

source

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.

source

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.)

source

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.)

source

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().

source

pub fn context_menu(self, context_menu: &impl IsA<Popover>) -> Self

Available on crate feature 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.

source

pub fn context_menu_model( self, context_menu_model: &impl IsA<MenuModel>, ) -> Self

Available on crate feature 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().

Sets whether or not the cursor will blink. Using CursorBlinkMode::System will use the #GtkSettings:gtk-cursor-blink setting.

source

pub fn cursor_shape(self, cursor_shape: CursorShape) -> Self

Controls the shape of the cursor.

source

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.

source

pub fn enable_a11y(self, enable_a11y: bool) -> Self

Available on crate feature v0_78 only.

Controls whether or not a11y is enabled for the widget.

source

pub fn enable_bidi(self, enable_bidi: bool) -> Self

Controls whether or not the terminal will perform bidirectional text rendering.

source

pub fn enable_fallback_scrolling(self, enable_fallback_scrolling: bool) -> Self

source

pub fn enable_shaping(self, enable_shaping: bool) -> Self

Controls whether or not the terminal will shape Arabic text.

source

pub fn enable_sixel(self, enable_sixel: bool) -> Self

Controls whether SIXEL image support is enabled.

source

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.

source

pub fn font_options(self, font_options: &FontOptions) -> Self

Available on crate feature 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.

source

pub fn font_scale(self, font_scale: f64) -> Self

The terminal’s font scale.

source

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.

source

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.

source

pub fn pty(self, pty: &Pty) -> Self

The PTY object for the terminal.

source

pub fn scroll_on_insert(self, scroll_on_insert: bool) -> Self

Available on crate feature 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).

source

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.

source

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.

source

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.

source

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.

Controls whether or not the terminal will allow blinking text.

source

pub fn xalign(self, xalign: Align) -> Self

Available on crate feature v0_76 only.

The horizontal alignment of @terminal within its allocation.

source

pub fn xfill(self, xfill: bool) -> Self

Available on crate feature v0_76 only.

The horizontal fillment of @terminal within its allocation.

source

pub fn yalign(self, yalign: Align) -> Self

Available on crate feature v0_76 only.

The vertical alignment of @terminal within its allocation

source

pub fn yfill(self, yfill: bool) -> Self

Available on crate feature 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.

source

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.

source

pub fn can_target(self, can_target: bool) -> Self

Whether the widget can receive pointer events.

source

pub fn css_classes(self, css_classes: impl Into<StrV>) -> Self

A list of css classes applied to this widget.

source

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.

source

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.

source

pub fn focusable(self, focusable: bool) -> Self

Whether this widget itself will accept the input focus.

source

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.

source

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.

source

pub fn hexpand(self, hexpand: bool) -> Self

Whether to expand horizontally.

source

pub fn hexpand_set(self, hexpand_set: bool) -> Self

Whether to use the hexpand property.

source

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.

source

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.

source

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.

source

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.

source

pub fn name(self, name: impl Into<GString>) -> Self

The name of the widget.

source

pub fn opacity(self, opacity: f64) -> Self

The requested opacity of the widget.

source

pub fn receives_default(self, receives_default: bool) -> Self

Whether the widget will receive the default action when it is focused.

source

pub fn sensitive(self, sensitive: bool) -> Self

Whether the widget responds to input.

source

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.

source

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.

source

pub fn vexpand(self, vexpand: bool) -> Self

Whether to expand vertically.

source

pub fn vexpand_set(self, vexpand_set: bool) -> Self

Whether to use the vexpand property.

source

pub fn visible(self, visible: bool) -> Self

Whether the widget is visible.

source

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.

source

pub fn build(self) -> Terminal

Build the Terminal.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.