… | |
… | |
49 | } |
49 | } |
50 | |
50 | |
51 | sub configure { |
51 | sub configure { |
52 | my ($self) = @_; |
52 | my ($self) = @_; |
53 | |
53 | |
54 | my $tabheight = $self->int_bwidth + $self->fheight + $self->lineSpace; |
|
|
55 | |
|
|
56 | $self->{cur}->XMoveResizeWindow ( |
54 | $self->{cur}->XMoveResizeWindow ( |
57 | $self->{cur}->parent, |
55 | $self->{cur}->parent, |
58 | 0, $tabheight, |
56 | 0, $self->{tabheight}, |
59 | $self->width, $self->height - $tabheight |
57 | $self->width, $self->height - $self->{tabheight} |
60 | ); |
58 | ); |
61 | } |
59 | } |
62 | |
60 | |
63 | sub make_current { |
61 | sub make_current { |
64 | my ($self, $tab) = @_; |
62 | my ($self, $tab) = @_; |
… | |
… | |
69 | } |
67 | } |
70 | |
68 | |
71 | $self->{cur} = $tab; |
69 | $self->{cur} = $tab; |
72 | |
70 | |
73 | $self->configure; |
71 | $self->configure; |
|
|
72 | |
|
|
73 | my $wm_normal_hints = $self->XInternAtom ("WM_NORMAL_HINTS"); |
|
|
74 | |
|
|
75 | for my $atom ($tab->XListProperties ($tab->parent)) { |
|
|
76 | my ($type, $format, $items) = $self->XGetWindowProperty ($tab->parent, $atom); |
|
|
77 | |
|
|
78 | if ($atom == $wm_normal_hints) { |
|
|
79 | my (@hints) = unpack "l!*", $items; |
|
|
80 | $hints[ 4] += $self->{tabheight}; |
|
|
81 | $hints[16] += $self->{tabheight}; |
|
|
82 | $items = pack "l!*", @hints; |
|
|
83 | } |
|
|
84 | $self->XChangeWindowProperty ($self->parent, $atom, $type, $format, $items); |
|
|
85 | } |
74 | |
86 | |
75 | $tab->XMapWindow ($tab->parent); |
87 | $tab->XMapWindow ($tab->parent); |
76 | |
88 | |
77 | $self->refresh; |
89 | $self->refresh; |
78 | |
90 | |
… | |
… | |
123 | () |
135 | () |
124 | } |
136 | } |
125 | |
137 | |
126 | sub on_start { |
138 | sub on_start { |
127 | my ($self) = @_; |
139 | my ($self) = @_; |
|
|
140 | |
|
|
141 | $self->{tabheight} = $self->int_bwidth + $self->fheight + $self->lineSpace; |
128 | |
142 | |
129 | $self->cmd_parse ("\x1b[?25l\x1b[?7l"); |
143 | $self->cmd_parse ("\x1b[?25l\x1b[?7l"); |
130 | $self->new_tab; |
144 | $self->new_tab; |
131 | $self->new_tab; |
145 | $self->new_tab; |
132 | $self->new_tab; |
146 | $self->new_tab; |