/* ui/window.cc This file is part of the Osirion project and is distributed under the terms of the GNU General Public License version 2 */ #include "ui/paint.h" #include "ui/window.h" namespace ui { Window::Window(Widget *parent) : Widget(parent) { set_label("window"); set_border(true); set_background(true); set_focus(); } Window::~Window() { } void Window::show() { resize(); Widget::show(); raise(); Widget *w = this; while (w && w->visible()) { w->set_focus(); w = w->parent(); } } void Window::set_previous(Window *previous) { window_previous.assign(previous->label()); } void Window::clear_previous() { window_previous.clear(); } void Window::draw_border() { if (!border()) return; if(focus()) { paint::color(palette()->foreground()); } else { paint::color(palette()->border()); } paint::border(global_location(), size()); } }