Skip to content

ButtonBlock

Michael Palmos edited this page Sep 1, 2021 · 6 revisions

ButtonBlock

This block is used provide a clickable button that performs some action (more actions coming soon -- submit an issue if you have an idea).

Required Properties

Name Type Description Example
padding Padding Padding around the block, which is applied before hooking. padding: Padding(left: 7.0, right: 7.0, top: 7.0, bottom: 7.0
action Action The type of action that this button should trigger. DefaultAction will trigger the primary notification action (same as the notification_action1 mouse shortcut).
Note: OtherAction(int) counts from 0, and excludes the default action. So OtherAction(0) would be the first action not including the default one (if it exists).
action: DefaultAction
action: OtherAction(0)
text string Text to display in this text block. %a will be substituted with the action text, %s with the summary text, %b with the body text, and a few more. See the Text Markup wiki page for full details. text: "%a"
font string Font description string for the desired font, in the format of "[FAMILY-LIST] [STYLE-OPTIONS] [SIZE] [VARIATIONS]".
For more information on font descriptions, see pango documentation.
> To find a font family's name, try fc-list in a terminal.
font: "Arial Bold 10"
border_width float The width in pixels of the border around the button. border_width: 3.0
border_rounding float Rounding of the border, where 0.0 is no rounding and higher values are progressively more rounded. border_rounding: 3.0
text_color Color Text color. color: Color(hex: "#ebdbb2")
border_color Color Border color. color: Color(hex: "#ebdbb2")
background_color Color Background color. background_color: Color(hex: "#282828")
dimensions Dimensions Desired text dimensions. This means minimum and maximum width and height of the block (in pixels).
See TextBlock for notes on this behavior.
dimensions: (width: (min: 0, max: 150), height: (min: 0, max: 0))

Optional Properties

Name Type Description Example
text_color_hovered Color The text color that should be used while the mouse is hovered over this block.
Default: use text_color
text_color_hovered: Color(hex: "#fbf1c7")
border_color_hovered Color The border color that should be used while the mouse is hovered over this block.
Default: use border_color
border_color_hovered: Color(hex: "#fbf1c7")
background_color_hovered Color The background color that should be used while the mouse is hovered over this block.
Default: use background_color
background_color_hovered: Color(hex: "#fbf1c7")
ellipsize EllipsizeMode Determines which part of the string should be trimmed when it exceeds its maximum width.
Either Start, Middle, End, or None.
Default: Middle
ellipsize: Middle