Class Settings.Builder<B extends Settings.Builder<B>>

Type Parameters:
B - the type of the Builder that is returned
All Implemented Interfaces:
BuilderInterface
Enclosing class:
Settings

public static class Settings.Builder<B extends Settings.Builder<B>> extends GObject.Builder<B>
Inner class implementing a builder pattern to construct a GObject with properties.
  • Constructor Details

    • Builder

      protected Builder()
      Default constructor for a Builder object.
  • Method Details

    • build

      public Settings build()
      Finish building the Settings object. This will call GObject.withProperties(Type, String[], Value[]) to create a new GObject instance, which is then cast to Settings.
      Overrides:
      build in class GObject.Builder<B extends Settings.Builder<B>>
      Returns:
      a new instance of Settings with the properties that were set in the Builder object.
    • setGtkAlternativeButtonOrder

      public B setGtkAlternativeButtonOrder(boolean gtkAlternativeButtonOrder)
      Whether buttons in dialogs should use the alternative button order.
      Parameters:
      gtkAlternativeButtonOrder - the value for the gtk-alternative-button-order property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setGtkAlternativeSortArrows

      public B setGtkAlternativeSortArrows(boolean gtkAlternativeSortArrows)

      Controls the direction of the sort indicators in sorted list and tree views.

      By default an arrow pointing down means the column is sorted in ascending order. When set to true, this order will be inverted.

      Parameters:
      gtkAlternativeSortArrows - the value for the gtk-alternative-sort-arrows property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setGtkApplicationPreferDarkTheme

      @Deprecated public B setGtkApplicationPreferDarkTheme(boolean gtkApplicationPreferDarkTheme)
      Deprecated.
      Use GtkCssProvider properties instead

      Whether the application prefers to use a dark theme.

      If a GTK theme includes a dark variant, it will be used instead of the configured theme.

      Some applications benefit from minimizing the amount of light pollution that interferes with the content. Good candidates for dark themes are photo and video editors that make the actual content get all the attention and minimize the distraction of the chrome.

      Dark themes should not be used for documents, where large spaces are white/light and the dark chrome creates too much contrast (web browser, text editor...).

      Parameters:
      gtkApplicationPreferDarkTheme - the value for the gtk-application-prefer-dark-theme property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setGtkCursorAspectRatio

      public B setGtkCursorAspectRatio(double gtkCursorAspectRatio)
      The aspect ratio of the text caret.
      Parameters:
      gtkCursorAspectRatio - the value for the gtk-cursor-aspect-ratio property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setGtkCursorBlink

      public B setGtkCursorBlink(boolean gtkCursorBlink)

      Whether the cursor should blink.

      Also see the Gtk.Settings:gtk-cursor-blink-timeout setting, which allows more flexible control over cursor blinking.

      Parameters:
      gtkCursorBlink - the value for the gtk-cursor-blink property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setGtkCursorBlinkTime

      public B setGtkCursorBlinkTime(int gtkCursorBlinkTime)
      Length of the cursor blink cycle, in milliseconds.
      Parameters:
      gtkCursorBlinkTime - the value for the gtk-cursor-blink-time property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setGtkCursorBlinkTimeout

      public B setGtkCursorBlinkTimeout(int gtkCursorBlinkTimeout)

      Time after which the cursor stops blinking, in seconds.

      The timer is reset after each user interaction.

      Setting this to zero has the same effect as setting Gtk.Settings:gtk-cursor-blink to false.

      Parameters:
      gtkCursorBlinkTimeout - the value for the gtk-cursor-blink-timeout property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setGtkCursorThemeName

      public B setGtkCursorThemeName(String gtkCursorThemeName)

      Name of the cursor theme to use.

      Use null to use the default theme.

      Parameters:
      gtkCursorThemeName - the value for the gtk-cursor-theme-name property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setGtkCursorThemeSize

      public B setGtkCursorThemeSize(int gtkCursorThemeSize)

      The size to use for cursors.

      0 means to use the default size.

      Parameters:
      gtkCursorThemeSize - the value for the gtk-cursor-theme-size property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setGtkDecorationLayout

      public B setGtkDecorationLayout(String gtkDecorationLayout)

      Determines which buttons should be put in the titlebar of client-side decorated windows, and whether they should be placed on the left or right.

      The format of the string is button names, separated by commas. A colon separates the buttons that should appear on the left from those on the right. Recognized button names are minimize, maximize, close, icon (the window icon) and menu (a menu button for the fallback app menu).

      For example, "menu:minimize,maximize,close" specifies a menu on the left, and minimize, maximize and close buttons on the right.

      Note that buttons will only be shown when they are meaningful. E.g. a menu button only appears when the desktop shell does not show the app menu, and a close button only appears on a window that can be closed.

      Also note that the setting can be overridden with the Gtk.HeaderBar:decoration-layout property.

      Parameters:
      gtkDecorationLayout - the value for the gtk-decoration-layout property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setGtkDialogsUseHeader

      public B setGtkDialogsUseHeader(boolean gtkDialogsUseHeader)

      Whether builtin GTK dialogs such as the file chooser, the color chooser or the font chooser will use a header bar at the top to show action widgets, or an action area at the bottom.

      This setting does not affect custom dialogs using GtkDialog directly, or message dialogs.

      Parameters:
      gtkDialogsUseHeader - the value for the gtk-dialogs-use-header property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setGtkDndDragThreshold

      public B setGtkDndDragThreshold(int gtkDndDragThreshold)
      The number of pixels the cursor can move before dragging.
      Parameters:
      gtkDndDragThreshold - the value for the gtk-dnd-drag-threshold property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setGtkDoubleClickDistance

      public B setGtkDoubleClickDistance(int gtkDoubleClickDistance)
      The maximum distance allowed between two clicks for them to be considered a double click, in pixels.
      Parameters:
      gtkDoubleClickDistance - the value for the gtk-double-click-distance property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setGtkDoubleClickTime

      public B setGtkDoubleClickTime(int gtkDoubleClickTime)
      The maximum time to allow between two clicks for them to be considered a double click, in milliseconds.
      Parameters:
      gtkDoubleClickTime - the value for the gtk-double-click-time property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setGtkEnableAccels

      public B setGtkEnableAccels(boolean gtkEnableAccels)
      Whether menu items should have visible accelerators which can be activated.
      Parameters:
      gtkEnableAccels - the value for the gtk-enable-accels property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setGtkEnableAnimations

      public B setGtkEnableAnimations(boolean gtkEnableAnimations)
      Whether to enable toolkit-wide animations.
      Parameters:
      gtkEnableAnimations - the value for the gtk-enable-animations property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setGtkEnableEventSounds

      public B setGtkEnableEventSounds(boolean gtkEnableEventSounds)

      Whether to play any event sounds at all.

      See the Sound Theme Specifications for more information on event sounds and sound themes.

      GTK itself does not support event sounds, you have to use a loadable module like the one that comes with libcanberra.

      Parameters:
      gtkEnableEventSounds - the value for the gtk-enable-event-sounds property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setGtkEnableInputFeedbackSounds

      public B setGtkEnableInputFeedbackSounds(boolean gtkEnableInputFeedbackSounds)

      Whether to play event sounds as feedback to user input.

      See the Sound Theme Specifications for more information on event sounds and sound themes.

      GTK itself does not support event sounds, you have to use a loadable module like the one that comes with libcanberra.

      Parameters:
      gtkEnableInputFeedbackSounds - the value for the gtk-enable-input-feedback-sounds property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setGtkEnablePrimaryPaste

      public B setGtkEnablePrimaryPaste(boolean gtkEnablePrimaryPaste)
      Whether a middle click on a mouse should paste the 'PRIMARY' clipboard content at the cursor location.
      Parameters:
      gtkEnablePrimaryPaste - the value for the gtk-enable-primary-paste property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setGtkEntryPasswordHintTimeout

      public B setGtkEntryPasswordHintTimeout(int gtkEntryPasswordHintTimeout)

      How long to show the last input character in hidden entries.

      This value is in milliseconds. 0 disables showing the last char. 600 is a good value for enabling it.

      Parameters:
      gtkEntryPasswordHintTimeout - the value for the gtk-entry-password-hint-timeout property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setGtkEntrySelectOnFocus

      public B setGtkEntrySelectOnFocus(boolean gtkEntrySelectOnFocus)
      Whether to select the contents of an entry when it is focused.
      Parameters:
      gtkEntrySelectOnFocus - the value for the gtk-entry-select-on-focus property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setGtkErrorBell

      public B setGtkErrorBell(boolean gtkErrorBell)

      When true, keyboard navigation and other input-related errors will cause a beep.

      Since the error bell is implemented using gdk_surface_beep(), the windowing system may offer ways to configure the error bell in many ways, such as flashing the window or similar visual effects.

      Parameters:
      gtkErrorBell - the value for the gtk-error-bell property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setGtkFontName

      public B setGtkFontName(String gtkFontName)

      The default font to use.

      GTK uses the family name and size from this string.

      Parameters:
      gtkFontName - the value for the gtk-font-name property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setGtkFontRendering

      public B setGtkFontRendering(FontRendering gtkFontRendering)

      How GTK font rendering is set up.

      When set to Gtk.FontRendering.MANUAL, GTK respects the low-level font-related settings (Gtk.Settings:gtk-hint-font-metrics, Gtk.Settings:gtk-xft-antialias, Gtk.Settings:gtk-xft-hinting, Gtk.Settings:gtk-xft-hintstyle and Gtk.Settings:gtk-xft-rgba) as much as practical.

      When set to Gtk.FontRendering.AUTOMATIC, GTK will consider factors such as screen resolution and scale in deciding how to render fonts.

      Parameters:
      gtkFontRendering - the value for the gtk-font-rendering property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      4.16
    • setGtkFontconfigTimestamp

      public B setGtkFontconfigTimestamp(int gtkFontconfigTimestamp)
      Timestamp of the current fontconfig configuration.
      Parameters:
      gtkFontconfigTimestamp - the value for the gtk-fontconfig-timestamp property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setGtkHintFontMetrics

      public B setGtkHintFontMetrics(boolean gtkHintFontMetrics)

      Whether hinting should be applied to font metrics.

      Note that this also turns off subpixel positioning of glyphs, since it conflicts with metrics hinting.

      Parameters:
      gtkHintFontMetrics - the value for the gtk-hint-font-metrics property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      4.6
    • setGtkIconThemeName

      public B setGtkIconThemeName(String gtkIconThemeName)

      Name of the icon theme to use.

      See IconTheme for details about how GTK handles icon themes.

      Parameters:
      gtkIconThemeName - the value for the gtk-icon-theme-name property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setGtkImModule

      public B setGtkImModule(String gtkImModule)

      Which IM (input method) module should be used by default.

      This is the input method that will be used if the user has not explicitly chosen another input method from the IM context menu. This also can be a colon-separated list of input methods, which GTK will try in turn until it finds one available on the system.

      See IMContext.

      Parameters:
      gtkImModule - the value for the gtk-im-module property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setGtkInterfaceColorScheme

      public B setGtkInterfaceColorScheme(InterfaceColorScheme gtkInterfaceColorScheme)

      The color scheme used for rendering the user interface.

      This setting communicates the system-wide preference. The color scheme that is actually used when applying CSS styles can be set with the Gtk.CssProvider:prefers-color-scheme property.

      Parameters:
      gtkInterfaceColorScheme - the value for the gtk-interface-color-scheme property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      4.20
    • setGtkInterfaceContrast

      public B setGtkInterfaceContrast(InterfaceContrast gtkInterfaceContrast)

      The level of contrast to use for the user interface.

      This setting communicates the system-wide preference. The contrast level that is actually used when applying CSS styles can be set with the Gtk.CssProvider:prefers-contrast property.

      Parameters:
      gtkInterfaceContrast - the value for the gtk-interface-contrast property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      4.20
    • setGtkInterfaceReducedMotion

      public B setGtkInterfaceReducedMotion(ReducedMotion gtkInterfaceReducedMotion)

      Whether animations should be reduced to essential motions.

      This setting communicates the system-wide preference. The motion level that is actually used when applying CSS styles can be set with the Gtk.CssProvider:prefers-reduced-motion property.

      Parameters:
      gtkInterfaceReducedMotion - the value for the gtk-interface-reduced-motion property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      4.22
    • setGtkKeynavUseCaret

      public B setGtkKeynavUseCaret(boolean gtkKeynavUseCaret)

      Whether GTK should make sure that text can be navigated with a caret, even if it is not editable.

      This is useful when using a screen reader.

      Parameters:
      gtkKeynavUseCaret - the value for the gtk-keynav-use-caret property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setGtkLabelSelectOnFocus

      public B setGtkLabelSelectOnFocus(boolean gtkLabelSelectOnFocus)
      Whether to select the contents of a selectable label when it is focused.
      Parameters:
      gtkLabelSelectOnFocus - the value for the gtk-label-select-on-focus property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setGtkLongPressTime

      public B setGtkLongPressTime(int gtkLongPressTime)

      The time for a button or touch press to be considered a “long press”.

      See GestureLongPress.

      Parameters:
      gtkLongPressTime - the value for the gtk-long-press-time property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setGtkOverlayScrolling

      public B setGtkOverlayScrolling(boolean gtkOverlayScrolling)

      Whether scrolled windows may use overlaid scrolling indicators.

      If this is set to false, scrolled windows will have permanent scrollbars.

      Parameters:
      gtkOverlayScrolling - the value for the gtk-overlay-scrolling property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setGtkPrimaryButtonWarpsSlider

      public B setGtkPrimaryButtonWarpsSlider(boolean gtkPrimaryButtonWarpsSlider)

      If the value of this setting is true, clicking the primary button in a GtkRange trough will move the slider, and hence set the range’s value, to the point that you clicked.

      If it is false, a primary click will cause the slider/value to move by the range’s page-size towards the point clicked.

      Whichever action you choose for the primary button, the other action will be available by holding Shift and primary-clicking, or clicking the middle mouse button.

      Parameters:
      gtkPrimaryButtonWarpsSlider - the value for the gtk-primary-button-warps-slider property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setGtkPrintBackends

      public B setGtkPrintBackends(String gtkPrintBackends)

      A comma-separated list of print backends to use in the print dialog.

      Available print backends depend on the GTK installation, and may include "file", "cups", "lpr" or "papi".

      Parameters:
      gtkPrintBackends - the value for the gtk-print-backends property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setGtkPrintPreviewCommand

      public B setGtkPrintPreviewCommand(String gtkPrintPreviewCommand)

      A command to run for displaying the print preview.

      The command should contain a %f placeholder, which will get replaced by the path to the pdf file. The command may also contain a %s placeholder, which will get replaced by the path to a file containing the print settings in the format produced by PrintSettings.toFile(String).

      The preview application is responsible for removing the pdf file and the print settings file when it is done.

      Parameters:
      gtkPrintPreviewCommand - the value for the gtk-print-preview-command property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setGtkRecentFilesEnabled

      public B setGtkRecentFilesEnabled(boolean gtkRecentFilesEnabled)

      Whether GTK should keep track of items inside the recently used resources list.

      If set to false, the list will always be empty.

      Parameters:
      gtkRecentFilesEnabled - the value for the gtk-recent-files-enabled property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setGtkRecentFilesMaxAge

      public B setGtkRecentFilesMaxAge(int gtkRecentFilesMaxAge)

      The maximum age, in days, of the items inside the recently used resources list.

      Items older than this setting will be excised from the list. If set to 0, the list will always be empty; if set to -1, no item will be removed.

      Parameters:
      gtkRecentFilesMaxAge - the value for the gtk-recent-files-max-age property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setGtkShellShowsAppMenu

      @Deprecated public B setGtkShellShowsAppMenu(boolean gtkShellShowsAppMenu)
      Deprecated.
      This setting is not relevant anymore
      Set to true if the desktop environment is displaying the app menu, false if the app should display it itself.
      Parameters:
      gtkShellShowsAppMenu - the value for the gtk-shell-shows-app-menu property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setGtkShellShowsDesktop

      @Deprecated public B setGtkShellShowsDesktop(boolean gtkShellShowsDesktop)
      Deprecated.
      This setting is not relevant anymore
      Set to true if the desktop environment is displaying the desktop folder, false if not.
      Parameters:
      gtkShellShowsDesktop - the value for the gtk-shell-shows-desktop property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setGtkShellShowsMenubar

      @Deprecated public B setGtkShellShowsMenubar(boolean gtkShellShowsMenubar)
      Deprecated.
      This setting is not relevant anymore
      Set to true if the desktop environment is displaying the menubar, false if the app should display it itself.
      Parameters:
      gtkShellShowsMenubar - the value for the gtk-shell-shows-menubar property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setGtkShowStatusShapes

      public B setGtkShowStatusShapes(boolean gtkShowStatusShapes)
      When true, widgets like switches include shapes to indicate their on/off state.
      Parameters:
      gtkShowStatusShapes - the value for the gtk-show-status-shapes property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      4.14
    • setGtkSoundThemeName

      public B setGtkSoundThemeName(String gtkSoundThemeName)

      The XDG sound theme to use for event sounds.

      See the Sound Theme Specifications for more information on event sounds and sound themes.

      GTK itself does not support event sounds, you have to use a loadable module like the one that comes with libcanberra.

      Parameters:
      gtkSoundThemeName - the value for the gtk-sound-theme-name property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setGtkSplitCursor

      public B setGtkSplitCursor(boolean gtkSplitCursor)
      Whether two cursors should be displayed for mixed left-to-right and right-to-left text.
      Parameters:
      gtkSplitCursor - the value for the gtk-split-cursor property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setGtkThemeName

      public B setGtkThemeName(String gtkThemeName)

      Name of the theme to load.

      See CssProvider for details about how GTK finds the CSS stylesheet for a theme.

      Parameters:
      gtkThemeName - the value for the gtk-theme-name property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setGtkTitlebarDoubleClick

      public B setGtkTitlebarDoubleClick(String gtkTitlebarDoubleClick)

      Determines the action to take when a double-click occurs on the titlebar of client-side decorated windows.

      Recognized actions are minimize, toggle-maximize, menu, lower or none.

      Parameters:
      gtkTitlebarDoubleClick - the value for the gtk-titlebar-double-click property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setGtkTitlebarMiddleClick

      public B setGtkTitlebarMiddleClick(String gtkTitlebarMiddleClick)

      Determines the action to take when a middle-click occurs on the titlebar of client-side decorated windows.

      Recognized actions are minimize, toggle-maximize, menu, lower or none.

      Parameters:
      gtkTitlebarMiddleClick - the value for the gtk-titlebar-middle-click property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setGtkTitlebarRightClick

      public B setGtkTitlebarRightClick(String gtkTitlebarRightClick)

      Determines the action to take when a right-click occurs on the titlebar of client-side decorated windows.

      Recognized actions are minimize, toggle-maximize, menu, lower or none.

      Parameters:
      gtkTitlebarRightClick - the value for the gtk-titlebar-right-click property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setGtkXftAntialias

      public B setGtkXftAntialias(int gtkXftAntialias)

      Whether to antialias fonts.

      The values are 0 for no, 1 for yes, or -1 for the system default.

      Parameters:
      gtkXftAntialias - the value for the gtk-xft-antialias property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setGtkXftDpi

      public B setGtkXftDpi(int gtkXftDpi)

      The font resolution, in 1024 * dots/inch.

      -1 to use the default value.

      Parameters:
      gtkXftDpi - the value for the gtk-xft-dpi property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setGtkXftHinting

      public B setGtkXftHinting(int gtkXftHinting)

      Whether to enable font hinting.

      The values are 0 for no, 1 for yes, or -1 for the system default.

      Parameters:
      gtkXftHinting - the value for the gtk-xft-hinting property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setGtkXftHintstyle

      public B setGtkXftHintstyle(String gtkXftHintstyle)

      What degree of font hinting to use.

      The possible vaues are hintnone, hintslight, hintmedium, hintfull.

      Parameters:
      gtkXftHintstyle - the value for the gtk-xft-hintstyle property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setGtkXftRgba

      public B setGtkXftRgba(String gtkXftRgba)

      The type of subpixel antialiasing to use.

      The possible values are none, rgb, bgr, vrgb, vbgr.

      Note that GSK does not support subpixel antialiasing, and this setting has no effect on font rendering in GTK.

      Parameters:
      gtkXftRgba - the value for the gtk-xft-rgba property
      Returns:
      the Builder instance is returned, to allow method chaining