… | |
… | |
2074 | my $class = shift; |
2074 | my $class = shift; |
2075 | |
2075 | |
2076 | $class->SUPER::new ( |
2076 | $class->SUPER::new ( |
2077 | fg => [1, 1, 1], |
2077 | fg => [1, 1, 1], |
2078 | bg => [0, 0, 0, 0.2], |
2078 | bg => [0, 0, 0, 0.2], |
|
|
2079 | outline => [0.6, 0.3, 0.1], |
2079 | active_bg => [0, 0, 1, .2], |
2080 | active_bg => [0, 0, 1, .2], |
2080 | active_fg => [1, 1, 1], |
2081 | active_fg => [1, 1, 1], |
2081 | active_outline => [1, 1, 0], |
2082 | active_outline => [1, 1, 0], |
2082 | can_hover => 1, |
2083 | can_hover => 1, |
2083 | can_focus => 1, |
2084 | can_focus => 1, |
… | |
… | |
2254 | glVertex 0.5 + $self->{cur_x} + $self->{ox}, $self->{cur_y} + $self->{oy} + $self->{cur_h}; |
2255 | glVertex 0.5 + $self->{cur_x} + $self->{ox}, $self->{cur_y} + $self->{oy} + $self->{cur_h}; |
2255 | glEnd; |
2256 | glEnd; |
2256 | |
2257 | |
2257 | glLineWidth 3; |
2258 | glLineWidth 3; |
2258 | glColor @{$self->{active_outline}}; |
2259 | glColor @{$self->{active_outline}}; |
2259 | glTranslate -.375, -.375; |
|
|
2260 | glBegin GL_LINE_LOOP; |
2260 | glBegin GL_LINE_LOOP; |
2261 | glVertex 0, 0; |
2261 | glVertex 0, 0; |
2262 | glVertex $self->{w}, 0; |
2262 | glVertex $self->{w} - 1, 0; |
2263 | glVertex $self->{w}, $self->{h}; |
2263 | glVertex $self->{w} - 1, $self->{h} - 1; |
2264 | glVertex 0, $self->{h}; |
2264 | glVertex 0, $self->{h} - 1; |
2265 | glEnd; |
2265 | glEnd; |
2266 | glLineWidth 1; |
2266 | glLineWidth 1; |
|
|
2267 | |
|
|
2268 | } else { |
|
|
2269 | glColor @{$self->{outline}}; |
|
|
2270 | glTranslate .375, .375; |
|
|
2271 | glBegin GL_LINE_STRIP; |
|
|
2272 | glVertex 0, $self->{h} * .5; |
|
|
2273 | glVertex 0, $self->{h} - 3; |
|
|
2274 | glVertex $self->{w} - 1, $self->{h} - 3; |
|
|
2275 | glVertex $self->{w} - 1, $self->{h} * .5; |
|
|
2276 | glEnd; |
2267 | } |
2277 | } |
2268 | } |
2278 | } |
2269 | |
2279 | |
2270 | ############################################################################# |
2280 | ############################################################################# |
2271 | |
2281 | |
… | |
… | |
3488 | glTranslate 0.375, 0.375; |
3498 | glTranslate 0.375, 0.375; |
3489 | |
3499 | |
3490 | my ($w, $h) = @$self{qw(w h)}; |
3500 | my ($w, $h) = @$self{qw(w h)}; |
3491 | |
3501 | |
3492 | glColor 1, 0.8, 0.4; |
3502 | glColor 1, 0.8, 0.4; |
3493 | glBegin GL_QUADS; |
3503 | glRect 0, 0, $w, $h; |
3494 | glVertex 0 , 0; |
|
|
3495 | glVertex 0 , $h; |
|
|
3496 | glVertex $w, $h; |
|
|
3497 | glVertex $w, 0; |
|
|
3498 | glEnd; |
|
|
3499 | |
3504 | |
3500 | glColor 0, 0, 0; |
3505 | glColor 0, 0, 0; |
3501 | glBegin GL_LINE_LOOP; |
3506 | glBegin GL_LINE_LOOP; |
3502 | glVertex 0 , 0; |
3507 | glVertex 0 , 0; |
3503 | glVertex 0 , $h; |
3508 | glVertex 0 , $h; |