Revision: | 1.11 |
Committed: | Tue Oct 3 12:13:57 2006 UTC (17 years, 9 months ago) by root |
Branch: | MAIN |
CVS Tags: | before_dynamic_fontidx, rel-9_14, rel-9_11, rel-9_10, rel-8_1, rel-9_12, rel-8_5a, rel-8_2, rel-8_9, rel-8_8, dynamic_fontidx, rel-8_0, rel-8_4, rel-9_0, rel-8_3, rxvt-unicode-rel-9_15, rel-8_6, rel-8_7, rel-9_09, rel-9_02, rel-9_01, rel-9_06, rel-9_07, rel-9_05 |
Changes since 1.10: | +7 -0 lines |
Log Message: | *** empty log message *** |
# | Content |
---|---|
1 | #! perl |
2 | |
3 | sub on_start { |
4 | my ($self) = @_; |
5 | |
6 | $self->grab_button (2, urxvt::ControlMask); |
7 | |
8 | () |
9 | } |
10 | |
11 | sub on_button_press { |
12 | my ($self, $event) = @_; |
13 | |
14 | if ($event->{button} == 2 && $event->{state} & urxvt::ControlMask) { |
15 | my $popup = $self->popup ($event) |
16 | or return 1; |
17 | |
18 | $popup->add_title ("Options"); |
19 | $popup->add_separator; |
20 | |
21 | my %unsafe = map +($_ => 1), |
22 | qw(borderLess console iconic loginShell reverseVideo |
23 | scrollBar scrollBar_floating scrollBar_right |
24 | secondaryScreen transparent utmpInhibit meta8 |
25 | override_redirect); |
26 | |
27 | for my $name (sort keys %urxvt::OPTION) { |
28 | next if $unsafe{$name}; |
29 | |
30 | my $optval = $urxvt::OPTION{$name}; |
31 | |
32 | $popup->add_toggle ($name => $self->option ($optval), |
33 | sub { $self->option ($optval, $_[0]) }); |
34 | } |
35 | |
36 | for my $hook (@{ $self->{term}{option_popup_hook} || [] }) { |
37 | if (my ($name, $value, $cb) = $hook->($popup)) { |
38 | $popup->add_toggle ($name => $value, sub { $cb->($_[0]) }); |
39 | } |
40 | } |
41 | |
42 | { |
43 | $popup->add_separator; |
44 | my $locale = $self->locale; |
45 | $locale =~ y/\x20-\x7e//cd; |
46 | $popup->add_title ("Locale: $locale"); |
47 | } |
48 | |
49 | $popup->show; |
50 | |
51 | return 1; |
52 | } |
53 | |
54 | () |
55 | } |
56 |