Term/Widget/Label.pm

filter: Statementstmt 81.8% 9 / 11 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod n/a totaltotal 86.6% 13 / 15 CC 1 SCAR 0.7
CC
1
Cov
82%
BEGIN
1.3
BEGIN
1.0
BEGIN
1.0
CRAP 1.1
« Term/Widget/Entry.pm ↑ Summary Term/Ribbon.pm »
1 # You may distribute under the terms of the GNU General Public License
2 #
3 # (C) Paul Evans, 2011-2023 -- leonerd@leonerd.org.uk
4  
5 package Circle::FE::Term::Widget::Label 0.240250;
6  
7 1 ▶use v5.26;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 1 ▶use constant type => "Label";
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 0 ▶use Tickit::Widget::Static;
Subroutine BEGIN: called CC=1 SCAR=2.6
13  
14 sub build
15 {
16 my $class = shift;
17 my ( $obj, $tab ) = @_;
18  
19 my $widget = Tickit::Widget::Static->new(
20 classes => $obj->prop( "classes" ),
21 text => "",
22 );
23  
24 $tab->adopt_future(
25 $obj->watch_property_with_initial(
26 "text",
27 on_set => sub { $widget->set_text( $_[0] ) },
28 )
29 );
30  
31 return $widget;
32 }
33  
34 Tickit::Style->load_style( <<'EOF' );
35 Static.ident {
36 bg: "blue";
37 }
38  
39 Static.transient {
40 fg: "yellow";
41 b: 1;
42 }
43  
44 EOF
45  
46 0x55AA;
« Term/Widget/Entry.pm ↑ Summary Term/Ribbon.pm »