I am writing my first Cinnamon applet (after I managed to write a desklet).
I have a St.BoxLayout
embedded in a PopupMenu.PopupBaseMenuItem
in order to get in in a popup menu.
Now I want it's width to be 100% of the popup menu width, but it (i.e. the box containing 1 +2 = 3
in the screenshot) looks like this and just takes its minimal width to contain the embedded text and it grows when you type into it:
I tried:
- a style_class
expression-box
and in CSSwidth: 100%
x_align: Clutter.ActorAlign.FILL
,x_expand: true
But it just doesn't expand its width. What else could I try?
I must admit that I'm still looking for a extensive CJS / GJS documentation, browsing other applets' sources seem to be the best way to find out what is actually working ...
Here's the code:
applet.js
:
this.widgets.expressionItem = new PopupMenu.PopupBaseMenuItem({reactive: false, focusOnHover: true});
this.menu.addMenuItem(this.widgets.expressionItem);
this.widgets.expressionBox = new St.BoxLayout({
style_class: "expression-box",
vertical: true,
x_align: Clutter.ActorAlign.FILL,
x_expand: true
})
stylesheet.css
:
.expression-box {
background-color: lightslategray;
color: black;
border-radius: 4px;
width: 100%;
padding: 4px;
}
You can find the complete source code in GitHub.