updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / rxvt-unicode-chinese / pretty-tab.patch
blob99d7aa882488e97ca05d729c50aabece2128abab
1 diff -rupN orig/src/perl/tabbed new/src/perl/tabbed
2 --- orig/src/perl/tabbed 2009-04-20 10:23:35.000000000 +0800
3 +++ new/src/perl/tabbed 2009-04-20 10:29:38.000000000 +0800
4 @@ -10,8 +10,8 @@ sub refresh {
6 my @ofs;
8 - substr $text, 0, 7, "[NEW] |";
9 - @$rend[0 .. 5] = ($self->{rs_tab}) x 6;
10 + substr $text, 0, 7, " NEW ";
11 + @$rend[0 .. 5] = ($self->{rs_tabbar}) x 6;
12 push @ofs, [0, 6, sub { $_[0]->new_tab }];
14 my $ofs = 7;
15 @@ -26,7 +26,7 @@ sub refresh {
16 my $txt = "$act$idx$act";
17 my $len = length $txt;
19 - substr $text, $ofs, $len + 1, "$txt|";
20 + substr $text, $ofs, $len + 1, "$txt ";
21 @$rend[$ofs .. $ofs + $len - 1] = ($self->{rs_tab}) x $len
22 if $tab == $self->{cur};
24 @@ -224,10 +224,10 @@ sub on_init {
25 my $tabfg = $self->x_resource ("tab-fg");
26 my $tabbg = $self->x_resource ("tab-bg");
28 - defined $fg or $fg = 3;
29 - defined $bg or $bg = 0;
30 - defined $tabfg or $tabfg = 0;
31 - defined $tabbg or $tabbg = 1;
32 + defined $fg or $fg = 0;
33 + defined $bg or $bg = 7;
34 + defined $tabfg or $tabfg = 12;
35 + defined $tabbg or $tabbg = 0;
37 $self->{rs_tabbar} = urxvt::SET_COLOR (urxvt::DEFAULT_RSTYLE, $fg + 2, $bg + 2);
38 $self->{rs_tab} = urxvt::SET_COLOR (urxvt::DEFAULT_RSTYLE, $tabfg + 2, $tabbg + 2);
39 @@ -333,7 +333,12 @@ sub tab_key_press {
40 $self->make_current ($self->{tabs}[$idx2]);
42 return 1;
43 - }
44 + } elsif ($keysym > 48 && $keysym < 58) {
45 + my ($idx) = $keysym - 49;
46 + $self->make_current ($self->{tabs}[$idx]) if $self->{tabs}[$idx] != $tab and $idx < @{ $self->{tabs}};
48 + return 1;
49 + }