Widgets
widget
these properties apply to all widgets, and can be used anywhere!
Properties
class:stringcss class namevalign:stringhow to align this vertically. possible values: "fill", "baseline", "center", "start", "end"halign:stringhow to align this horizontally. possible values: "fill", "baseline", "center", "start", "end"vexpand:boolshould this container expand vertically. Default: false.hexpand:boolshould this widget expand horizontally. Default: false.width:intwidth of this element. note that this can not restrict the size if the contents stretch itheight:intheight of this element. note that this can not restrict the size if the contents stretch itactive:boolIf this widget can be interacted withtooltip:stringtooltip text (on hover)visible:boolvisibility of the widgetstyle:stringinline scss style applied to the widgetcss:stringscss 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:vecItems that should be displayed in the combo boxtimeout:durationtimeout of the command: Default: "200ms"onchange:stringruns 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:stringname of the expanderexpanded:boolsets if the tree is expanded
revealer
A widget that can reveal a child with an animation.
Properties
transition:stringthe name of the transition. Possible values: "slideright", "slideleft", "slideup", "slidedown", "crossfade", "none"reveal:boolsets if the child is revealed or notduration:durationthe duration of the reveal transition. Default: "500ms"
a checkbox
A checkbox that can trigger events on checked / unchecked.
Properties
checked:boolwhether the checkbox is toggled or not when createdtimeout:durationtimeout of the command. Default: "200ms"onchecked:stringaction (command) to be executed when checked by the useronunchecked:stringsimilar to onchecked but when the widget is unchecked
color-button
A button opening a color chooser window
Properties
use-alpha:boolbool to whether or not use alphaonchange:stringruns the code when the color was selectedtimeout:durationtimeout of the command. Default: "200ms"
color-chooser
A color chooser widget
Properties
use-alpha:boolbool to wether or not use alphaonchange:stringruns the code when the color was selectedtimeout:durationtimeout of the command. Default: "200ms"
scale
A slider.
Properties
flipped:boolflip the directionmarks:stringdraw marksdraw-value:booldraw the value of the propertyvalue-pos:stringposition of the drawn value. possible values: "left", "right", "top", "bottom"round-digits:intSets the number of decimals to round the value to when it changesvalue:floatthe valuemin:floatthe minimum valuemax:floatthe maximum valuetimeout:durationtimeout of the command. Default: "200ms"onchange:stringcommand executed once the value is changes. The placeholder{}, used in the command will be replaced by the new value.orientation:stringorientation 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:boolflip the directionvalue:floatvalue of the progress bar (between 0-100)orientation:stringorientation 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:stringthe content of the text fieldonchange:stringCommand to run when the text changes. The placeholder{}will be replaced by the valuetimeout:durationtimeout of the command. Default: "200ms"onaccept:stringCommand to run when the user hits return in the input field. The placeholder{}will be replaced by the valuepassword:boolif the input is obscured
button
A button containing any widget as it's child. Events are triggered on release.
Properties
timeout:durationtimeout of the command. Default: "200ms"onclick:stringcommand to run when the button is activated either by leftclicking or keyboardonmiddleclick:stringcommand to run when the button is middleclickedonrightclick:stringcommand to run when the button is rightclicked
image
A widget displaying an image
Properties
path:stringpath to the image fileimage-width:intwidth of the imageimage-height:intheight of the imagepreserve-aspect-ratio:boolwhether to keep the aspect ratio when resizing an image. Default: true, false doesn't work for all image typesfill-svg:stringsets the color of svg imagesicon:stringname of a theme iconicon-size:stringsize of the theme icon
box
the main layout container
Properties
spacing:intspacing between elementsorientation:stringorientation of the box. possible values: "vertical", "v", "horizontal", "h"space-evenly:boolspace 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:stringorientation of the centerbox. possible values: "vertical", "v", "horizontal", "h"
scroll
a container with a single child that can scroll.
Properties
hscroll:boolscroll horizontallyvscroll:boolscroll vertically
eventbox
a container which can receive events and must contain exactly one child. Supports :hover and :active css selectors.
Properties
timeout:durationtimeout of the command. Default: "200ms"onscroll:stringevent to execute when the user scrolls with the mouse over the widget. The placeholder{}used in the command will be replaced with eitherupordown.onhover:stringevent to execute when the user hovers over the widgetonhoverlost:stringevent to execute when the user losts hovers over the widgetcursor:stringCursor to show while hovering (see gtk3-cursors for possible names)ondropped:stringCommand 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:stringURI that will be provided when dragging from this widgetdragtype:stringType of value that should be dragged from this widget. Possible values: "file", "text"onclick:stringcommand to run when the widget is clickedonmiddleclick:stringcommand to run when the widget is middleclickedonrightclick:stringcommand to run when the widget is rightclicked
label
A text widget giving you more control over how the text is displayed
Properties
text:stringthe text to displaytruncate:boolwhether to truncate text (or pango markup). Ifshow-truncatedisfalse, or iflimit-widthhas a value, this property has no effect and truncation is enabled.limit-width:intmaximum count of characters to displaytruncate-left:boolwhether to truncate on the left sideshow-truncated:boolshow 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:boolwhether to remove leading spacesmarkup:stringPango markup to displaywrap:boolWrap the text. This mainly makes sense if you set the width of this widget.angle:floatthe angle of rotation for the label (between 0 - 360)gravity:stringthe gravity of the string (south, east, west, north, auto). Text will want to face the direction of gravity.xalign:floatthe alignment of the label text on the x axis (between 0 - 1, 0 -> left, 0.5 -> center, 1 -> right)yalign:floatthe alignment of the label text on the y axis (between 0 - 1, 0 -> bottom, 0.5 -> center, 1 -> top)justify:stringthe justification of the label text (left, right, center, fill)wrap-mode:stringhow text is wrapped. possible options: "word", "char", "wordchar"lines:intmaximum number of lines to display (only works whenlimit-widthhas a value). A value of -1 (default) disables the limit.
literal
A widget that allows you to render arbitrary yuck.
Properties
content:stringinline yuck that will be rendered as a widget.
calendar
A widget that displays a calendar
Properties
day:floatthe selected daymonth:floatthe selected monthyear:floatthe selected yearshow-details:boolshow detailsshow-heading:boolshow heading lineshow-day-names:boolshow names of daysshow-week-numbers:boolshow week numbersonclick:stringcommand 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:durationtimeout of the command. Default: "200ms"
stack
A widget that displays one of its children at a time
Properties
selected:intindex of child which should be showntransition:stringthe name of the transition. Possible values: "slideright", "slideleft", "slideup", "slidedown", "crossfade", "none"same-size:boolsets 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:floatthe percentage to rotatetransform-origin-x:stringx coordinate of origin of transformation (px or %)transform-origin-y:stringy coordinate of origin of transformation (px or %)translate-x:stringthe amount to translate in the x direction (px or %)translate-y:stringthe amount to translate in the y direction (px or %)scale-x:stringthe amount to scale in the x direction (px or %)scale-y:stringthe amount to scale in the y direction (px or %)
circular-progress
A widget that displays a circular progress bar
Properties
value:floatthe value, between 0 - 100start-at:floatthe percentage that the circle should start atthickness:floatthe thickness of the circleclockwise:boolwether 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:floatthe value, between 0 - 100thickness:floatthe thickness of the linetime-range:durationthe range of time to showmin:floatthe minimum value to show (defaults to 0 if value_max is provided)max:floatthe maximum value to showdynamic:boolwhether the y range should dynamically change based on valueline-style:stringchanges the look of the edges in the graph. Values: "miter" (default), "round",flip-x:boolwhether the x axis should go from high to lowflip-y:boolwhether the y axis should go from high to lowvertical:boolif set to true, the x and y axes will be exchanged
systray
Tray for system notifier icons
Properties
spacing:intspacing between elementsorientation:stringorientation of the box. possible values: "vertical", "v", "horizontal", "h"space-evenly:boolspace the widgets evenly.icon-size:intsize of icons in the trayprepend-new:boolprepend new icons.