Widgets
widget
these properties apply to all widgets, and can be used anywhere!
Properties
class
:string
css class namevalign
:string
how to align this vertically. possible values: "fill", "baseline", "center", "start", "end"halign
:string
how to align this horizontally. possible values: "fill", "baseline", "center", "start", "end"vexpand
:bool
should this container expand vertically. Default: false.hexpand
:bool
should this widget expand horizontally. Default: false.width
:int
width of this element. note that this can not restrict the size if the contents stretch itheight
:int
height of this element. note that this can not restrict the size if the contents stretch itactive
:bool
If this widget can be interacted withtooltip
:string
tooltip text (on hover)visible
:bool
visibility of the widgetstyle
:string
inline scss style applied to the widgetcss
:string
scss code applied to the widget, i.e.:button {color: red;}
combo-box-text
A combo box allowing the user to choose between several items.
Properties
items
:vec
Items that should be displayed in the combo boxtimeout
:duration
timeout of the command: Default: "200ms"onchange
:string
runs the code when a item was selected, replacing {} with the item as a string
expander
A widget that can expand and collapse, showing/hiding it's children. Should contain
Properties
name
:string
name of the expanderexpanded
:bool
sets if the tree is expanded
revealer
A widget that can reveal a child with an animation.
Properties
transition
:string
the name of the transition. Possible values: "slideright", "slideleft", "slideup", "slidedown", "crossfade", "none"reveal
:bool
sets if the child is revealed or notduration
:duration
the duration of the reveal transition. Default: "500ms"
a checkbox
A checkbox that can trigger events on checked / unchecked.
Properties
checked
:bool
whether the checkbox is toggled or not when createdtimeout
:duration
timeout of the command. Default: "200ms"onchecked
:string
action (command) to be executed when checked by the useronunchecked
:string
similar to onchecked but when the widget is unchecked
color-button
A button opening a color chooser window
Properties
use-alpha
:bool
bool to whether or not use alphaonchange
:string
runs the code when the color was selectedtimeout
:duration
timeout of the command. Default: "200ms"
color-chooser
A color chooser widget
Properties
use-alpha
:bool
bool to wether or not use alphaonchange
:string
runs the code when the color was selectedtimeout
:duration
timeout of the command. Default: "200ms"
scale
A slider.
Properties
flipped
:bool
flip the directionmarks
:string
draw marksdraw-value
:bool
draw the value of the propertyround-digits
:int
Sets the number of decimals to round the value to when it changesvalue
:float
the valuemin
:float
the minimum valuemax
:float
the maximum valuetimeout
:duration
timeout of the command. Default: "200ms"onchange
:string
command executed once the value is changes. The placeholder{}
, used in the command will be replaced by the new value.orientation
:string
orientation of the widget. Possible values: "vertical", "v", "horizontal", "h"
progress
A progress bar. HINT: for the width
property to work, you may need to set the min-width
of progressbar > trough
in your css.
Properties
flipped
:bool
flip the directionvalue
:float
value of the progress bar (between 0-100)orientation
:string
orientation of the progress bar. possible values: "vertical", "v", "horizontal", "h"
input
An input field. For this to be useful, set focusable="true"
on the window.
Properties
value
:string
the content of the text fieldonchange
:string
Command to run when the text changes. The placeholder{}
will be replaced by the valuetimeout
:duration
timeout of the command. Default: "200ms"onaccept
:string
Command to run when the user hits return in the input field. The placeholder{}
will be replaced by the valuepassword
:bool
if the input is obscured
button
A button containing any widget as it's child. Events are triggered on release.
Properties
timeout
:duration
timeout of the command. Default: "200ms"onclick
:string
command to run when the button is activated either by leftclicking or keyboardonmiddleclick
:string
command to run when the button is middleclickedonrightclick
:string
command to run when the button is rightclicked
image
A widget displaying an image
Properties
path
:string
path to the image fileimage-width
:int
width of the imageimage-height
:int
height of the imagepreserve-aspect-ratio
:bool
whether to keep the aspect ratio when resizing an image. Default: true, false doesn't work for all image typesfill-svg
:string
sets the color of svg imagesicon
:string
name of a theme iconicon-size
:string
size of the theme icon
box
the main layout container
Properties
spacing
:int
spacing between elementsorientation
:string
orientation of the box. possible values: "vertical", "v", "horizontal", "h"space-evenly
:bool
space the widgets evenly.
overlay
a widget that places its children on top of each other. The overlay widget takes the size of its first child.
Properties
tooltip
A widget that have a custom tooltip. The first child is the content of the tooltip, the second one is the content of the widget.
Properties
centerbox
a box that must contain exactly three children, which will be layed out at the start, center and end of the container.
Properties
orientation
:string
orientation of the centerbox. possible values: "vertical", "v", "horizontal", "h"
scroll
a container with a single child that can scroll.
Properties
hscroll
:bool
scroll horizontallyvscroll
:bool
scroll vertically
eventbox
a container which can receive events and must contain exactly one child. Supports :hover
and :active
css selectors.
Properties
timeout
:duration
timeout of the command. Default: "200ms"onscroll
:string
event to execute when the user scrolls with the mouse over the widget. The placeholder{}
used in the command will be replaced with eitherup
ordown
.onhover
:string
event to execute when the user hovers over the widgetonhoverlost
:string
event to execute when the user losts hovers over the widgetcursor
:string
Cursor to show while hovering (see gtk3-cursors for possible names)ondropped
:string
Command to execute when something is dropped on top of this element. The placeholder{}
used in the command will be replaced with the uri to the dropped thing.dragvalue
:string
URI that will be provided when dragging from this widgetdragtype
:string
Type of value that should be dragged from this widget. Possible values: "file", "text"onclick
:string
command to run when the widget is clickedonmiddleclick
:string
command to run when the widget is middleclickedonrightclick
:string
command to run when the widget is rightclicked
label
A text widget giving you more control over how the text is displayed
Properties
text
:string
the text to displaytruncate
:bool
whether to truncate text (or pango markup). Ifshow-truncated
isfalse
, or iflimit-width
has a value, this property has no effect and truncation is enabled.limit-width
:int
maximum count of characters to displaytruncate-left
:bool
whether to truncate on the left sideshow-truncated
:bool
show whether the text was truncated. Disabling it will also disable dynamic truncation (the labels won't be truncated more thanlimit-width
, even if there is not enough space for them), and will completly disable truncation on pango markup.unindent
:bool
whether to remove leading spacesmarkup
:string
Pango markup to displaywrap
:bool
Wrap the text. This mainly makes sense if you set the width of this widget.angle
:float
the angle of rotation for the label (between 0 - 360)gravity
:string
the gravity of the string (south, east, west, north, auto). Text will want to face the direction of gravity.xalign
:float
the alignment of the label text on the x axis (between 0 - 1, 0 -> left, 0.5 -> center, 1 -> right)yalign
:float
the alignment of the label text on the y axis (between 0 - 1, 0 -> bottom, 0.5 -> center, 1 -> top)justify
:string
the justification of the label text (left, right, center, fill)
literal
A widget that allows you to render arbitrary yuck.
Properties
content
:string
inline yuck that will be rendered as a widget.
calendar
A widget that displays a calendar
Properties
day
:float
the selected daymonth
:float
the selected monthyear
:float
the selected yearshow-details
:bool
show detailsshow-heading
:bool
show heading lineshow-day-names
:bool
show names of daysshow-week-numbers
:bool
show week numbersonclick
:string
command to run when the user selects a date. The{0}
placeholder will be replaced by the selected day,{1}
will be replaced by the month, and{2}
by the year.timeout
:duration
timeout of the command. Default: "200ms"
stack
A widget that displays one of its children at a time
Properties
selected
:int
index of child which should be showntransition
:string
the name of the transition. Possible values: "slideright", "slideleft", "slideup", "slidedown", "crossfade", "none"same-size
:bool
sets whether all children should be the same size
transform
A widget that applies transformations to its content. They are applied in the following order: rotate -> translate -> scale
Properties
rotate
:float
the percentage to rotatetransform-origin-x
:string
x coordinate of origin of transformation (px or %)transform-origin-y
:string
y coordinate of origin of transformation (px or %)translate-x
:string
the amount to translate in the x direction (px or %)translate-y
:string
the amount to translate in the y direction (px or %)scale-x
:string
the amount to scale in the x direction (px or %)scale-y
:string
the amount to scale in the y direction (px or %)
circular-progress
A widget that displays a circular progress bar
Properties
value
:float
the value, between 0 - 100start-at
:float
the percentage that the circle should start atthickness
:float
the thickness of the circleclockwise
:bool
wether the progress bar spins clockwise or counter clockwise
graph
A widget that displays a graph showing how a given value changes over time
Properties
value
:float
the value, between 0 - 100thickness
:float
the thickness of the linetime-range
:duration
the range of time to showmin
:float
the minimum value to show (defaults to 0 if value_max is provided)max
:float
the maximum value to showdynamic
:bool
whether the y range should dynamically change based on valueline-style
:string
changes the look of the edges in the graph. Values: "miter" (default), "round",flip-x
:bool
whether the x axis should go from high to lowflip-y
:bool
whether the y axis should go from high to lowvertical
:bool
if set to true, the x and y axes will be exchanged
systray
Tray for system notifier icons
Properties
spacing
:int
spacing between elementsorientation
:string
orientation of the box. possible values: "vertical", "v", "horizontal", "h"space-evenly
:bool
space the widgets evenly.icon-size
:int
size of icons in the trayprepend-new
:bool
prepend new icons.