… | |
… | |
562 | |
562 | |
563 | A common use case is to fade the background image when the terminal loses |
563 | A common use case is to fade the background image when the terminal loses |
564 | focus, often together with the C<-fade> command line option. In fact, |
564 | focus, often together with the C<-fade> command line option. In fact, |
565 | there is a special function for just that use case: C<focus_fade>. |
565 | there is a special function for just that use case: C<focus_fade>. |
566 | |
566 | |
567 | Example: use two entirely different bacckground images, depending on |
567 | Example: use two entirely different background images, depending on |
568 | whether the window has focus. |
568 | whether the window has focus. |
569 | |
569 | |
570 | FOCUS ? keep { load "has_focus.jpg" } : keep { load "no_focus.jpg" } |
570 | FOCUS ? keep { load "has_focus.jpg" } : keep { load "no_focus.jpg" } |
571 | |
571 | |
572 | =cut |
572 | =cut |
… | |
… | |
958 | =item focus_fade $factor, $color, $img |
958 | =item focus_fade $factor, $color, $img |
959 | |
959 | |
960 | Fades the image by the given factor (and colour) when focus is lost (the |
960 | Fades the image by the given factor (and colour) when focus is lost (the |
961 | same as the C<-fade>/C<-fadecolor> command line options, which also supply |
961 | same as the C<-fade>/C<-fadecolor> command line options, which also supply |
962 | the default values for C<factor> and C<$color>. Unlike with C<-fade>, the |
962 | the default values for C<factor> and C<$color>. Unlike with C<-fade>, the |
963 | C<$factor> is the real value, not a percentage value (that is, 0..1, not |
963 | C<$factor> is a real value, not a percentage value (that is, 0..1, not |
964 | 0..100). |
964 | 0..100). |
965 | |
965 | |
966 | Example: do the right thing when focus fading is requested. |
966 | Example: do the right thing when focus fading is requested. |
967 | |
967 | |
968 | focus_fade load "mybg.jpg"; |
968 | focus_fade load "mybg.jpg"; |