1
0
Fork 0
mirror of https://github.com/davatorium/rofi.git synced 2024-11-25 13:55:34 -05:00

[Lexer] Fix media parser.

This commit is contained in:
Dave Davenport 2020-09-11 18:10:49 +02:00
parent d3ae324290
commit 6ba878e44a
3 changed files with 23 additions and 5 deletions

View file

@ -1420,12 +1420,23 @@ It supports the following keys as constraint:
.IP \(bu 2
\fB\fCmin\-aspect\-ratio\fR load when aspect ratio is over value.
.IP \(bu 2
\fB\fCmax\-aspect\_ratio\fR: load when aspect ratio is under value.
\fB\fCmax\-aspect\-ratio\fR: load when aspect ratio is under value.
.IP \(bu 2
\fB\fCmonitor\-id\fR: The monitor id, see rofi \-help for id's.
.PP
@media takes an integer number or a fraction.
@media takes an integer number or a fraction, for integer number \fB\fCpx\fR can be added.
.PP
.RS
.nf
@media ( min\-width: 120 px ) {
}
.fi
.RE
.SH Multiple file handling
.PP

View file

@ -997,12 +997,18 @@ It supports the following keys as constraint:
* `min-height`: load when height is bigger then value.
* `max-height`: load when height is smaller then value.
* `min-aspect-ratio` load when aspect ratio is over value.
* `max-aspect_ratio`: load when aspect ratio is under value.
* `max-aspect-ratio`: load when aspect ratio is under value.
* `monitor-id`: The monitor id, see rofi -help for id's.
@media takes an integer number or a fraction.
@media takes an integer number or a fraction, for integer number `px` can be added.
```
@media ( min-width: 120 px ) {
}
```
## Multiple file handling
The rasi file format offers two methods of including other files.

View file

@ -167,6 +167,7 @@ UANYN {ASCN}|{U2}{U}|{U3}{U}{U}|{U4}{U}{U}{U}
WHITESPACE [[:blank:]]
WSO [[:blank:]]*
WORD [[:alnum:]-]+
MEDIA_NAME [[:alpha:]-]+
COLOR_NAME [[:alpha:]]+
STRING \"{UANYN}*\"
CHAR \'({ASCN}|\\\\|\\\'|\\0)\'
@ -648,7 +649,7 @@ if ( queue == NULL ){
BEGIN(MEDIA_CONTENT);
return T_PARENT_LEFT;
}
<MEDIA_CONTENT>{WORD} {
<MEDIA_CONTENT>{MEDIA_NAME} {
yylval->sval = g_strdup(yytext);
return T_STRING;
}