… | |
… | |
18 | for (my $widget = $HOVER; $widget; $widget = $widget->{parent}) { |
18 | for (my $widget = $HOVER; $widget; $widget = $widget->{parent}) { |
19 | if (exists $widget->{tooltip}) { |
19 | if (exists $widget->{tooltip}) { |
20 | |
20 | |
21 | if ($TOOLTIP->{owner} != $widget) { |
21 | if ($TOOLTIP->{owner} != $widget) { |
22 | $TOOLTIP->{owner} = $widget; |
22 | $TOOLTIP->{owner} = $widget; |
|
|
23 | |
|
|
24 | my $tip = $widget->{tooltip}; |
|
|
25 | |
|
|
26 | $tip = $tip->($widget) if CODE:: eq ref $tip; |
|
|
27 | |
23 | $TOOLTIP->set_text ($widget->{tooltip}); |
28 | $TOOLTIP->set_text ($widget->{tooltip}); |
24 | $TOOLTIP->move ($widget->coord2global ($widget->{w}, 0)); |
29 | $TOOLTIP->move ($widget->coord2global ($widget->{w}, 0)); |
25 | $TOOLTIP->show; |
30 | $TOOLTIP->show; |
26 | } |
31 | } |
27 | |
32 | |
… | |
… | |
1723 | my $self = $class->SUPER::new ( |
1728 | my $self = $class->SUPER::new ( |
1724 | tooltip => $arg{type}, |
1729 | tooltip => $arg{type}, |
1725 | %arg, |
1730 | %arg, |
1726 | ); |
1731 | ); |
1727 | |
1732 | |
1728 | $self->add ($self->{value} = new CFClient::UI::Label valign => +1, align => 0, template => "999"); |
1733 | $self->add ($self->{value} = new CFClient::UI::Label valign => +1, align => 0, template => "999", can_events => 1, can_hover => 1); |
1729 | $self->add ($self->{gauge} = new CFClient::UI::VGauge type => $self->{type}, expand => 1); |
1734 | $self->add ($self->{gauge} = new CFClient::UI::VGauge type => $self->{type}, expand => 1, can_events => 1, can_hover => 1); |
1730 | $self->add ($self->{max} = new CFClient::UI::Label valign => -1, align => 0, template => "999"); |
1735 | $self->add ($self->{max} = new CFClient::UI::Label valign => -1, align => 0, template => "999", can_events => 1, can_hover => 1); |
1731 | |
1736 | |
1732 | $self |
1737 | $self |
1733 | } |
1738 | } |
1734 | |
1739 | |
1735 | sub set_fontsize { |
1740 | sub set_fontsize { |