~ubuntu-branches/ubuntu/dapper/rxvt-unicode/dapper

« back to all changes in this revision

Viewing changes to src/perl/option-popup

  • Committer: Bazaar Package Importer
  • Author(s): Eduard Bloch
  • Date: 2006-01-16 16:51:28 UTC
  • mfrom: (1.1.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20060116165128-dmz1wi3x3e17gu43
Tags: 7.0-1
* New upstream release
  + autodetection of (incorrect) Latin1 in pure UTF-8 environment works
    again (closes: #347718)
* removed the font name preset, automatic selection works acceptably well

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! perl
 
2
 
 
3
sub on_start {
 
4
   my ($self) = @_;
 
5
 
 
6
   $self->grab_button (2, urxvt::ControlMask);
 
7
}
 
8
 
 
9
sub on_button_press {
 
10
   my ($self, $event) = @_;
 
11
 
 
12
   if ($event->{button} == 2 && $event->{state} & urxvt::ControlMask) {
 
13
      my $popup = $self->popup ($event)
 
14
         or return 1;
 
15
 
 
16
      $popup->add_title ("Options");
 
17
      $popup->add_separator;
 
18
 
 
19
      my %unsafe = map +($_ => 1),
 
20
         qw(borderLess console iconic loginShell reverseVideo
 
21
            scrollBar scrollBar_floating scrollBar_right
 
22
            secondaryScreen transparent utmpInhibit meta8);
 
23
 
 
24
      for my $name (sort keys %urxvt::OPTION) {
 
25
         next if $unsafe{$name};
 
26
 
 
27
         my $optval = $urxvt::OPTION{$name};
 
28
 
 
29
         $popup->add_toggle ($name => sub { $self->option ($optval, $_[0]) },
 
30
                             $self->option ($optval));
 
31
      }
 
32
 
 
33
      $popup->show;
 
34
 
 
35
      return 1;
 
36
   }
 
37
 
 
38
   ()
 
39
}
 
40