Add format explanation to eww open position and size docs

This commit is contained in:
elkowar 2022-05-26 13:27:58 +02:00
parent 77adfbca6b
commit 3297c4eb70
No known key found for this signature in database
GPG key ID: E321AD71B1D1F27F
2 changed files with 3 additions and 2 deletions

View file

@ -95,11 +95,11 @@ pub enum ActionWithServer {
#[structopt(long)] #[structopt(long)]
screen: Option<i32>, screen: Option<i32>,
/// The position of the window, where it should open. /// The position of the window, where it should open. (i.e.: 200x100)
#[structopt(short, long)] #[structopt(short, long)]
pos: Option<Coords>, pos: Option<Coords>,
/// The size of the window to open /// The size of the window to open (i.e.: 200x100)
#[structopt(short, long)] #[structopt(short, long)]
size: Option<Coords>, size: Option<Coords>,

View file

@ -158,6 +158,7 @@ pub(super) fn resolve_widget_attrs(bargs: &mut BuilderArgs, gtk_widget: &gtk::Wi
def_widget!(bargs, _g, gtk_widget, { def_widget!(bargs, _g, gtk_widget, {
// @prop class - css class name // @prop class - css class name
prop(class: as_string) { prop(class: as_string) {
// TODO currently this overrides classes that gtk adds automatically, which is kinda stupid...
let old_classes = gtk_widget.style_context().list_classes(); let old_classes = gtk_widget.style_context().list_classes();
let old_classes = old_classes.iter().map(|x| x.as_str()).collect::<Vec<&str>>(); let old_classes = old_classes.iter().map(|x| x.as_str()).collect::<Vec<&str>>();
let new_classes = class.split(' ').collect::<Vec<_>>(); let new_classes = class.split(' ').collect::<Vec<_>>();