… | |
… | |
4 | * |
4 | * |
5 | * This file is covered by the GNU Library General Public License, |
5 | * This file is covered by the GNU Library General Public License, |
6 | * which should be included with libndk++ as the file COPYING. |
6 | * which should be included with libndk++ as the file COPYING. |
7 | */ |
7 | */ |
8 | |
8 | |
9 | #include <ncurses/pen.hh> |
9 | #include <ndk++/pen.hh> |
10 | #include <ndk++/frame.hh> |
10 | #include <ndk++/frame.hh> |
11 | #include <ndk++/palette.hh> |
11 | #include <ndk++/palette.hh> |
12 | |
12 | |
13 | |
13 | |
14 | ndk::frame::frame (std::string const &title, panel *parent) |
14 | ndk::frame::frame (std::string const &title, panel *parent) |
… | |
… | |
22 | void |
22 | void |
23 | ndk::frame::draw () |
23 | ndk::frame::draw () |
24 | { |
24 | { |
25 | panel::draw (); |
25 | panel::draw (); |
26 | |
26 | |
27 | ncurses::pen p (*this); |
27 | pen p (*this); |
28 | p.clear (); |
28 | p.clear (); |
29 | |
29 | |
30 | p.set_color (palette::instance ()[active_ ? colors::frame1 : colors::frame2]); |
30 | p.set_color (palette::instance ().find (active_ ? colors::frame1 : colors::frame2)->second); |
31 | p.frame (); |
31 | p.frame (); |
32 | if (!title_.empty ()) |
32 | if (!title_.empty ()) |
33 | p.title (title_.substr (0, width () - 2)); |
33 | p.title (title_.substr (0, width () - 2)); |
34 | p.set_color (palette::instance ()[colors::frame2]); |
34 | p.set_color (palette::instance ().find (colors::frame2)->second); |
35 | } |
35 | } |
36 | |
36 | |
37 | int |
37 | int |
38 | ndk::frame::padding () const |
38 | ndk::frame::padding () const |
39 | { |
39 | { |
40 | return 1; |
40 | return 1; |
|
|
41 | } |
|
|
42 | |
|
|
43 | std::string const & |
|
|
44 | ndk::frame::title () const |
|
|
45 | { |
|
|
46 | return title_; |
41 | } |
47 | } |
42 | |
48 | |
43 | void |
49 | void |
44 | ndk::frame::set_title (std::string const &title) |
50 | ndk::frame::set_title (std::string const &title) |
45 | { |
51 | { |