summaryrefslogtreecommitdiff
path: root/src/frame.cc
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2002-12-25 22:02:34 +0000
committerDana Jansens <danakj@orodu.net>2002-12-25 22:02:34 +0000
commit2ae2b257d39ea62640c2590f794e4275c6db1cd4 (patch)
treef26abe4a0601d263fbc460eddc012c1d674c868b /src/frame.cc
parent3c61812e588fb3c34d0713d7f82ccbf21091f032 (diff)
might not compile... ob uses its own widgets now, which subclass only the base otk widget. working on compressing focus events and handling them etc.
Diffstat (limited to 'src/frame.cc')
-rw-r--r--src/frame.cc52
1 files changed, 30 insertions, 22 deletions
diff --git a/src/frame.cc b/src/frame.cc
index 4e30a1f5..fed6132e 100644
--- a/src/frame.cc
+++ b/src/frame.cc
@@ -43,31 +43,15 @@ OBFrame::OBFrame(OBClient *client, otk::Style *style)
XSelectInput(otk::OBDisplay::display, window(), OBFrame::event_mask);
- unmanaged();
- _titlebar.unmanaged();
- _button_close.unmanaged();
- _button_iconify.unmanaged();
- _button_max.unmanaged();
- _button_stick.unmanaged();
- _label.unmanaged();
- _handle.unmanaged();
- _grip_left.unmanaged();
- _grip_right.unmanaged();
- _plate.unmanaged();
-
_grip_left.setCursor(Openbox::instance->cursors().ll_angle);
_grip_right.setCursor(Openbox::instance->cursors().lr_angle);
- _button_close.setText("X");
- _button_iconify.setText("I");
- _button_max.setText("M");
- _button_stick.setText("S");
_label.setText(_client->title());
_style = 0;
setStyle(style);
- //XXX: uncomment me unfocus(); // stuff starts out focused in otk
+ otk::OtkWidget::unfocus(); // stuff starts out appearing focused in otk
_plate.show(); // the other stuff is shown based on decor settings
@@ -81,6 +65,13 @@ OBFrame::~OBFrame()
}
+void OBFrame::setTitle(const std::string &text)
+{
+ _label.setText(text);
+ _label.update();
+}
+
+
void OBFrame::setStyle(otk::Style *style)
{
assert(style);
@@ -97,9 +88,7 @@ void OBFrame::setStyle(otk::Style *style)
_style = style;
- // XXX: change when focus changes!
- XSetWindowBorder(otk::OBDisplay::display, window(),
- _style->getBorderColor()->pixel());
+ setBorderColor(_style->getBorderColor());
// if !replace, then adjust() will get called after the client is grabbed!
if (replace) {
@@ -110,6 +99,25 @@ void OBFrame::setStyle(otk::Style *style)
}
+void OBFrame::focus()
+{
+ otk::OtkWidget::focus();
+ update();
+}
+
+
+void OBFrame::unfocus()
+{
+ otk::OtkWidget::unfocus();
+ update();
+}
+
+
+void OBFrame::adjust()
+{
+}
+
+
void OBFrame::adjustSize()
{
// XXX: only if not overridden or something!!! MORE LOGIC HERE!!
@@ -142,13 +150,13 @@ void OBFrame::adjustSize()
_titlebar.setGeometry(-bwidth,
-bwidth,
width,
- (_style->getFont().height() +
+ (_style->getFont()->height() +
_style->getBevelWidth() * 2));
_innersize.top += _titlebar.height() + bwidth;
// set the label size
_label.setGeometry(0, _style->getBevelWidth(),
- width, _style->getFont().height());
+ width, _style->getFont()->height());
// set the buttons sizes
if (_decorations & OBClient::Decor_Iconify)
_button_iconify.setGeometry(0, _style->getBevelWidth() + 1,