more layout fixes for the decoration elements
This commit is contained in:
parent
3762f3c88f
commit
410a826458
2 changed files with 20 additions and 10 deletions
|
@ -87,10 +87,13 @@ public:
|
||||||
inline unsigned int getFrameWidth(void) const { return frame_width; }
|
inline unsigned int getFrameWidth(void) const { return frame_width; }
|
||||||
inline unsigned int getBorderWidth(void) const { return border_width; }
|
inline unsigned int getBorderWidth(void) const { return border_width; }
|
||||||
|
|
||||||
inline const BFont *getFont() const { return font; }
|
inline const BFont &getFont() const { return *font; }
|
||||||
|
|
||||||
inline const BColor &getBorderColor() const { return border_color; }
|
inline const BColor &getBorderColor() const { return border_color; }
|
||||||
|
|
||||||
|
inline const BTexture &getFrameFocus() const { return f_focus; }
|
||||||
|
inline const BTexture &getFrameUnfocus() const { return f_unfocus; }
|
||||||
|
|
||||||
inline void setImageControl(BImageControl *c) { image_control = c; }
|
inline void setImageControl(BImageControl *c) { image_control = c; }
|
||||||
inline void setScreenNumber(unsigned int scr) { screen_number = scr; }
|
inline void setScreenNumber(unsigned int scr) { screen_number = scr; }
|
||||||
|
|
||||||
|
|
25
src/frame.cc
25
src/frame.cc
|
@ -114,6 +114,13 @@ void OBFrame::loadStyle(const otk::Style *style)
|
||||||
XSetWindowBorder(otk::OBDisplay::display, _handle,
|
XSetWindowBorder(otk::OBDisplay::display, _handle,
|
||||||
_style->getBorderColor().pixel());
|
_style->getBorderColor().pixel());
|
||||||
|
|
||||||
|
// XXX: if (focused)
|
||||||
|
XSetWindowBackground(otk::OBDisplay::display, _window,
|
||||||
|
_style->getFrameFocus().color().pixel());
|
||||||
|
// XXX: else
|
||||||
|
// XXX: XSetWindowBackground(otk::OBDisplay::display, _window,
|
||||||
|
// XXX: _style->getFrameUnfocus().color().pixel());
|
||||||
|
|
||||||
// if !replace, then update() will get called after the client is grabbed!
|
// if !replace, then update() will get called after the client is grabbed!
|
||||||
if (replace) {
|
if (replace) {
|
||||||
update();
|
update();
|
||||||
|
@ -144,13 +151,13 @@ void OBFrame::update()
|
||||||
_titlebar_area.setRect(-_style->getBorderWidth(),
|
_titlebar_area.setRect(-_style->getBorderWidth(),
|
||||||
-_style->getBorderWidth(),
|
-_style->getBorderWidth(),
|
||||||
width,
|
width,
|
||||||
(_style->getFont()->height() +
|
(_style->getFont().height() +
|
||||||
_style->getBevelWidth() * 2));
|
_style->getBevelWidth() * 2));
|
||||||
_size.top += _titlebar_area.height() + _style->getBorderWidth();
|
_size.top += _titlebar_area.height() + _style->getBorderWidth();
|
||||||
|
|
||||||
// set the label size
|
// set the label size
|
||||||
_label_area.setRect(0, _style->getBevelWidth(),
|
_label_area.setRect(0, _style->getBevelWidth(),
|
||||||
width, _style->getFont()->height());
|
width, _style->getFont().height());
|
||||||
// set the buttons sizes
|
// set the buttons sizes
|
||||||
if (_decorations & OBClient::Decor_Iconify)
|
if (_decorations & OBClient::Decor_Iconify)
|
||||||
_button_iconify_area.setRect(0, _style->getBevelWidth() + 1,
|
_button_iconify_area.setRect(0, _style->getBevelWidth() + 1,
|
||||||
|
@ -217,7 +224,8 @@ void OBFrame::update()
|
||||||
|
|
||||||
if (_decorations & OBClient::Decor_Handle) {
|
if (_decorations & OBClient::Decor_Handle) {
|
||||||
_handle_area.setRect(-_style->getBorderWidth(),
|
_handle_area.setRect(-_style->getBorderWidth(),
|
||||||
_size.top + _client->area().height(),
|
_size.top + _client->area().height() +
|
||||||
|
_style->getFrameWidth(),
|
||||||
width, _style->getHandleWidth());
|
width, _style->getHandleWidth());
|
||||||
_grip_left_area.setRect(-_style->getBorderWidth(),
|
_grip_left_area.setRect(-_style->getBorderWidth(),
|
||||||
-_style->getBorderWidth(),
|
-_style->getBorderWidth(),
|
||||||
|
@ -337,14 +345,14 @@ void OBFrame::updateShape()
|
||||||
if (!_client->shaped()) {
|
if (!_client->shaped()) {
|
||||||
// clear the shape on the frame window
|
// clear the shape on the frame window
|
||||||
XShapeCombineMask(otk::OBDisplay::display, _window, ShapeBounding,
|
XShapeCombineMask(otk::OBDisplay::display, _window, ShapeBounding,
|
||||||
_size.left - 2,//frame.margin.left - frame.border_w,
|
_size.left,
|
||||||
_size.top - 2,//frame.margin.top - frame.border_w,
|
_size.top,
|
||||||
None, ShapeSet);
|
None, ShapeSet);
|
||||||
} else {
|
} else {
|
||||||
// make the frame's shape match the clients
|
// make the frame's shape match the clients
|
||||||
XShapeCombineShape(otk::OBDisplay::display, _window, ShapeBounding,
|
XShapeCombineShape(otk::OBDisplay::display, _window, ShapeBounding,
|
||||||
_size.left - 2,
|
_size.left,
|
||||||
_size.top - 2,
|
_size.top,
|
||||||
_client->window(), ShapeBounding, ShapeSet);
|
_client->window(), ShapeBounding, ShapeSet);
|
||||||
|
|
||||||
int num = 0;
|
int num = 0;
|
||||||
|
@ -386,8 +394,7 @@ void OBFrame::grabClient()
|
||||||
// reparent the client to the frame
|
// reparent the client to the frame
|
||||||
XSelectInput(otk::OBDisplay::display, _client->window(),
|
XSelectInput(otk::OBDisplay::display, _client->window(),
|
||||||
OBClient::event_mask & ~StructureNotifyMask);
|
OBClient::event_mask & ~StructureNotifyMask);
|
||||||
XReparentWindow(otk::OBDisplay::display, _client->window(), _window,
|
XReparentWindow(otk::OBDisplay::display, _client->window(), _window, 0, 0);
|
||||||
_size.left, _size.top);
|
|
||||||
XSelectInput(otk::OBDisplay::display, _client->window(),
|
XSelectInput(otk::OBDisplay::display, _client->window(),
|
||||||
OBClient::event_mask);
|
OBClient::event_mask);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue