Klasse Banner

Alle implementierten Schnittstellen:
PointerInterface

public class Banner extends Widget
A bar with contextual information.

<picture>
<source srcset="banner-dark.png" media="(prefers-color-scheme: dark)">
<img src="banner.png" alt="banner">
</picture>

Banners are hidden by default, use [property@Banner:revealed] to show them.

Banners have a title, set with [property@Banner:title]. Titles can be marked
up with Pango markup, use [property@Banner:use-markup] to enable it.

The title will be shown centered or left-aligned depending on available
space.

Banners can optionally have a button with text on it, set through
[property@Banner:button-label]. The button can be used with a `GAction`,
or with the [signal@Banner::button-clicked] signal. The button can have
different styles, a gray style and a suggested style.

<picture>
<source srcset="banner-suggested-dark.png" media="(prefers-color-scheme: dark)">
<img src="banner-suggested.png" alt="banner with suggested button style">
</picture>

## CSS nodes

`AdwBanner` has a main CSS node with the name `banner`.

https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.Banner.html

  • Felddetails

  • Konstruktordetails

    • Banner

      public Banner(PointerContainer pointer)
    • Banner

      public Banner(@Nonnull Str title)
      Creates a new `AdwBanner`.
      Parameter:
      title - the banner title
    • Banner

      public Banner(String title)
      Creates a new `AdwBanner`.
      Parameter:
      title - the banner title
  • Methodendetails

    • getClassHandler

      public static ClassHandler getClassHandler()
    • getButtonLabel

      public Str getButtonLabel()
      Gets the button label for @self.
      Gibt zurück:
      the button label for @self
    • getButtonStyle

      public int getButtonStyle()
      Gets the style class in use for the banner button.
      Gibt zurück:
      the current button style
    • getRevealed

      public boolean getRevealed()
      Gets if a banner is revealed
      Gibt zurück:
      Whether a banner is revealed
    • getTitle

      public Str getTitle()
      Gets the title for @self.
      Gibt zurück:
      the title for @self
    • getUseMarkup

      public boolean getUseMarkup()
      Gets whether to use Pango markup for the banner title.
      Gibt zurück:
      whether to use markup
    • setButtonLabel

      public void setButtonLabel(@Nullable Str label)
      Sets the button label for @self.

      If set to `""` or `NULL`, the button won't be shown.

      The button can be used with a `GAction`, or with the
      [signal@Banner::button-clicked] signal.
      Parameter:
      label - the label
    • setButtonLabel

      public void setButtonLabel(String label)
      Sets the button label for @self.

      If set to `""` or `NULL`, the button won't be shown.

      The button can be used with a `GAction`, or with the
      [signal@Banner::button-clicked] signal.
      Parameter:
      label - the label
    • setButtonStyle

      public void setButtonStyle(int style)
      Sets the style class to use for the banner button.

      When set to `ADW_BANNER_BUTTON_DEFAULT`, the button stays grey.
      When set to `ADW_BANNER_BUTTON_SUGGESTED`, the button follows the [`.suggested-action`](style-classes.html#suggested-action) style

      <picture>
      <source srcset="banner-suggested-dark.png" media="(prefers-color-scheme: dark)">
      <img src="banner-suggested.png" alt="banner with suggested button style">
      </picture>
      Parameter:
      style - a button style
    • setRevealed

      public void setRevealed(boolean revealed)
      Sets whether a banner should be revealed
      Parameter:
      revealed - whether a banner should be revealed
    • setTitle

      public void setTitle(@Nonnull Str title)
      Sets the title for this banner.

      See also: [property@Banner:use-markup].
      Parameter:
      title - the title
    • setTitle

      public void setTitle(String title)
      Sets the title for this banner.

      See also: [property@Banner:use-markup].
      Parameter:
      title - the title
    • setUseMarkup

      public void setUseMarkup(boolean use_markup)
      Sets whether to use Pango markup for the banner title.

      See also [func@Pango.parse_markup].
      Parameter:
      use_markup - whether to use markup
    • onButtonClicked

      public SignalHandler onButtonClicked(Banner.OnButtonClicked signal)
      Connect to signal "button-clicked".
      See Banner.OnButtonClicked.onButtonClicked() for signal description.
      Field SIGNAL_ON_BUTTON_CLICKED contains original signal name and can be used as resource reference.
      Parameter:
      signal - callback function (lambda).
      Gibt zurück:
      SignalHandler. Can be used to disconnect signal and to release callback function.
    • asAccessible

      public Accessible asAccessible()
      Implements interface Accessible. Call this to get access to interface functions.
      Setzt außer Kraft:
      asAccessible in Klasse Widget
      Gibt zurück:
      Accessible
    • asActionable

      public Actionable asActionable()
      Implements interface Actionable. Call this to get access to interface functions.
      Gibt zurück:
      Actionable
    • asBuildable

      public Buildable asBuildable()
      Implements interface Buildable. Call this to get access to interface functions.
      Setzt außer Kraft:
      asBuildable in Klasse Widget
      Gibt zurück:
      Buildable
    • asConstraintTarget

      public ConstraintTarget asConstraintTarget()
      Implements interface ConstraintTarget. Call this to get access to interface functions.
      Setzt außer Kraft:
      asConstraintTarget in Klasse Widget
      Gibt zurück:
      ConstraintTarget
    • getTypeID

      public static long getTypeID()
    • getParentTypeID

      public static long getParentTypeID()
    • getTypeSize

      public static TypeSystem.TypeSize getTypeSize()
    • getParentTypeSize

      public static TypeSystem.TypeSize getParentTypeSize()
    • getInstanceSize

      public static int getInstanceSize()