kill the side borders on the handle and titlebar when max_horz
This commit is contained in:
parent
b70afd1016
commit
4e0ba65d30
1 changed files with 57 additions and 46 deletions
|
@ -124,6 +124,11 @@ ObFrame *frame_new(ObClient *client)
|
||||||
|
|
||||||
mask |= CWEventMask;
|
mask |= CWEventMask;
|
||||||
attrib.event_mask = ELEMENT_EVENTMASK;
|
attrib.event_mask = ELEMENT_EVENTMASK;
|
||||||
|
self->innerleft = createWindow(self->window, NULL, mask, &attrib);
|
||||||
|
self->innertop = createWindow(self->window, NULL, mask, &attrib);
|
||||||
|
self->innerright = createWindow(self->window, NULL, mask, &attrib);
|
||||||
|
self->innerbottom = createWindow(self->window, NULL, mask, &attrib);
|
||||||
|
|
||||||
self->title = createWindow(self->window, NULL, mask, &attrib);
|
self->title = createWindow(self->window, NULL, mask, &attrib);
|
||||||
self->titleleft = createWindow(self->window, NULL, mask, &attrib);
|
self->titleleft = createWindow(self->window, NULL, mask, &attrib);
|
||||||
self->titletop = createWindow(self->window, NULL, mask, &attrib);
|
self->titletop = createWindow(self->window, NULL, mask, &attrib);
|
||||||
|
@ -141,11 +146,6 @@ ObFrame *frame_new(ObClient *client)
|
||||||
self->left = createWindow(self->window, NULL, mask, &attrib);
|
self->left = createWindow(self->window, NULL, mask, &attrib);
|
||||||
self->right = createWindow(self->window, NULL, mask, &attrib);
|
self->right = createWindow(self->window, NULL, mask, &attrib);
|
||||||
|
|
||||||
self->innerleft = createWindow(self->window, NULL, mask, &attrib);
|
|
||||||
self->innertop = createWindow(self->window, NULL, mask, &attrib);
|
|
||||||
self->innerright = createWindow(self->window, NULL, mask, &attrib);
|
|
||||||
self->innerbottom = createWindow(self->window, NULL, mask, &attrib);
|
|
||||||
|
|
||||||
self->label = createWindow(self->title, NULL, mask, &attrib);
|
self->label = createWindow(self->title, NULL, mask, &attrib);
|
||||||
self->max = createWindow(self->title, NULL, mask, &attrib);
|
self->max = createWindow(self->title, NULL, mask, &attrib);
|
||||||
self->close = createWindow(self->title, NULL, mask, &attrib);
|
self->close = createWindow(self->title, NULL, mask, &attrib);
|
||||||
|
@ -352,7 +352,7 @@ void frame_adjust_area(ObFrame *self, gboolean moved,
|
||||||
|
|
||||||
if (self->max_horz) {
|
if (self->max_horz) {
|
||||||
self->cbwidth_l = self->cbwidth_r = 0;
|
self->cbwidth_l = self->cbwidth_r = 0;
|
||||||
self->width = self->client->area.width - self->bwidth * 2;
|
self->width = self->client->area.width;
|
||||||
if (self->max_vert)
|
if (self->max_vert)
|
||||||
self->cbwidth_b = 0;
|
self->cbwidth_b = 0;
|
||||||
} else
|
} else
|
||||||
|
@ -429,9 +429,7 @@ void frame_adjust_area(ObFrame *self, gboolean moved,
|
||||||
gint titlesides;
|
gint titlesides;
|
||||||
|
|
||||||
/* height of titleleft and titleright */
|
/* height of titleleft and titleright */
|
||||||
titlesides = (!self->max_horz ?
|
titlesides = (!self->max_horz ? ob_rr_theme->grip_width : 0);
|
||||||
ob_rr_theme->grip_width :
|
|
||||||
self->size.top - self->bwidth);
|
|
||||||
|
|
||||||
XMoveResizeWindow(ob_display, self->titletop,
|
XMoveResizeWindow(ob_display, self->titletop,
|
||||||
ob_rr_theme->grip_width + self->bwidth, 0,
|
ob_rr_theme->grip_width + self->bwidth, 0,
|
||||||
|
@ -476,7 +474,7 @@ void frame_adjust_area(ObFrame *self, gboolean moved,
|
||||||
|
|
||||||
if (self->decorations & OB_FRAME_DECOR_TITLEBAR) {
|
if (self->decorations & OB_FRAME_DECOR_TITLEBAR) {
|
||||||
XMoveResizeWindow(ob_display, self->titlebottom,
|
XMoveResizeWindow(ob_display, self->titlebottom,
|
||||||
self->bwidth,
|
(self->max_horz ? 0 : self->bwidth),
|
||||||
ob_rr_theme->title_height + self->bwidth,
|
ob_rr_theme->title_height + self->bwidth,
|
||||||
self->width,
|
self->width,
|
||||||
self->bwidth);
|
self->bwidth);
|
||||||
|
@ -496,7 +494,8 @@ void frame_adjust_area(ObFrame *self, gboolean moved,
|
||||||
|
|
||||||
if (self->decorations & OB_FRAME_DECOR_TITLEBAR) {
|
if (self->decorations & OB_FRAME_DECOR_TITLEBAR) {
|
||||||
XMoveResizeWindow(ob_display, self->title,
|
XMoveResizeWindow(ob_display, self->title,
|
||||||
self->bwidth, self->bwidth,
|
(self->max_horz ? 0 : self->bwidth),
|
||||||
|
self->bwidth,
|
||||||
self->width, ob_rr_theme->title_height);
|
self->width, ob_rr_theme->title_height);
|
||||||
|
|
||||||
XMapWindow(ob_display, self->title);
|
XMapWindow(ob_display, self->title);
|
||||||
|
@ -536,19 +535,24 @@ void frame_adjust_area(ObFrame *self, gboolean moved,
|
||||||
layout_title(self);
|
layout_title(self);
|
||||||
|
|
||||||
if (!fake) {
|
if (!fake) {
|
||||||
|
gint sidebwidth = self->max_horz ? 0 : self->bwidth;
|
||||||
|
|
||||||
if (self->bwidth && self->size.bottom) {
|
if (self->bwidth && self->size.bottom) {
|
||||||
XMoveResizeWindow(ob_display, self->handlebottom,
|
XMoveResizeWindow(ob_display, self->handlebottom,
|
||||||
ob_rr_theme->grip_width +
|
ob_rr_theme->grip_width +
|
||||||
self->bwidth * 2,
|
self->bwidth + sidebwidth,
|
||||||
self->size.top + self->client->area.height +
|
self->size.top + self->client->area.height +
|
||||||
self->size.bottom - self->bwidth,
|
self->size.bottom - self->bwidth,
|
||||||
self->width - (ob_rr_theme->grip_width +
|
self->width - (ob_rr_theme->grip_width +
|
||||||
self->bwidth) * 2,
|
sidebwidth) * 2,
|
||||||
self->bwidth);
|
self->bwidth);
|
||||||
|
|
||||||
|
|
||||||
|
if (sidebwidth) {
|
||||||
XMoveResizeWindow(ob_display, self->lgripleft,
|
XMoveResizeWindow(ob_display, self->lgripleft,
|
||||||
0,
|
0,
|
||||||
self->size.top + self->client->area.height +
|
self->size.top +
|
||||||
|
self->client->area.height +
|
||||||
self->size.bottom -
|
self->size.bottom -
|
||||||
(!self->max_horz ?
|
(!self->max_horz ?
|
||||||
ob_rr_theme->grip_width :
|
ob_rr_theme->grip_width :
|
||||||
|
@ -558,9 +562,11 @@ void frame_adjust_area(ObFrame *self, gboolean moved,
|
||||||
ob_rr_theme->grip_width :
|
ob_rr_theme->grip_width :
|
||||||
self->size.bottom - self->cbwidth_b));
|
self->size.bottom - self->cbwidth_b));
|
||||||
XMoveResizeWindow(ob_display, self->rgripright,
|
XMoveResizeWindow(ob_display, self->rgripright,
|
||||||
self->size.left + self->client->area.width +
|
self->size.left +
|
||||||
|
self->client->area.width +
|
||||||
self->size.right - self->bwidth,
|
self->size.right - self->bwidth,
|
||||||
self->size.top + self->client->area.height +
|
self->size.top +
|
||||||
|
self->client->area.height +
|
||||||
self->size.bottom -
|
self->size.bottom -
|
||||||
(!self->max_horz ?
|
(!self->max_horz ?
|
||||||
ob_rr_theme->grip_width :
|
ob_rr_theme->grip_width :
|
||||||
|
@ -570,15 +576,22 @@ void frame_adjust_area(ObFrame *self, gboolean moved,
|
||||||
ob_rr_theme->grip_width :
|
ob_rr_theme->grip_width :
|
||||||
self->size.bottom - self->cbwidth_b));
|
self->size.bottom - self->cbwidth_b));
|
||||||
|
|
||||||
|
XMapWindow(ob_display, self->lgripleft);
|
||||||
|
XMapWindow(ob_display, self->rgripright);
|
||||||
|
} else {
|
||||||
|
XUnmapWindow(ob_display, self->lgripleft);
|
||||||
|
XUnmapWindow(ob_display, self->rgripright);
|
||||||
|
}
|
||||||
|
|
||||||
XMoveResizeWindow(ob_display, self->lgripbottom,
|
XMoveResizeWindow(ob_display, self->lgripbottom,
|
||||||
self->bwidth,
|
sidebwidth,
|
||||||
self->size.top + self->client->area.height +
|
self->size.top + self->client->area.height +
|
||||||
self->size.bottom - self->bwidth,
|
self->size.bottom - self->bwidth,
|
||||||
ob_rr_theme->grip_width + self->bwidth,
|
ob_rr_theme->grip_width + self->bwidth,
|
||||||
self->bwidth);
|
self->bwidth);
|
||||||
XMoveResizeWindow(ob_display, self->rgripbottom,
|
XMoveResizeWindow(ob_display, self->rgripbottom,
|
||||||
self->size.left + self->client->area.width +
|
self->size.left + self->client->area.width +
|
||||||
self->size.right - self->bwidth * 2 -
|
self->size.right - self->bwidth - sidebwidth -
|
||||||
ob_rr_theme->grip_width,
|
ob_rr_theme->grip_width,
|
||||||
self->size.top + self->client->area.height +
|
self->size.top + self->client->area.height +
|
||||||
self->size.bottom - self->bwidth,
|
self->size.bottom - self->bwidth,
|
||||||
|
@ -586,8 +599,6 @@ void frame_adjust_area(ObFrame *self, gboolean moved,
|
||||||
self->bwidth);
|
self->bwidth);
|
||||||
|
|
||||||
XMapWindow(ob_display, self->handlebottom);
|
XMapWindow(ob_display, self->handlebottom);
|
||||||
XMapWindow(ob_display, self->lgripleft);
|
|
||||||
XMapWindow(ob_display, self->rgripright);
|
|
||||||
XMapWindow(ob_display, self->lgripbottom);
|
XMapWindow(ob_display, self->lgripbottom);
|
||||||
XMapWindow(ob_display, self->rgripbottom);
|
XMapWindow(ob_display, self->rgripbottom);
|
||||||
|
|
||||||
|
@ -596,10 +607,10 @@ void frame_adjust_area(ObFrame *self, gboolean moved,
|
||||||
{
|
{
|
||||||
XMoveResizeWindow(ob_display, self->handletop,
|
XMoveResizeWindow(ob_display, self->handletop,
|
||||||
ob_rr_theme->grip_width +
|
ob_rr_theme->grip_width +
|
||||||
self->bwidth * 2,
|
self->bwidth + sidebwidth,
|
||||||
FRAME_HANDLE_Y(self),
|
FRAME_HANDLE_Y(self),
|
||||||
self->width - (ob_rr_theme->grip_width +
|
self->width - (ob_rr_theme->grip_width +
|
||||||
self->bwidth) * 2,
|
sidebwidth) * 2,
|
||||||
self->bwidth);
|
self->bwidth);
|
||||||
XMapWindow(ob_display, self->handletop);
|
XMapWindow(ob_display, self->handletop);
|
||||||
|
|
||||||
|
@ -618,7 +629,7 @@ void frame_adjust_area(ObFrame *self, gboolean moved,
|
||||||
ob_rr_theme->handle_height);
|
ob_rr_theme->handle_height);
|
||||||
|
|
||||||
XMoveResizeWindow(ob_display, self->lgriptop,
|
XMoveResizeWindow(ob_display, self->lgriptop,
|
||||||
self->bwidth,
|
sidebwidth,
|
||||||
FRAME_HANDLE_Y(self),
|
FRAME_HANDLE_Y(self),
|
||||||
ob_rr_theme->grip_width +
|
ob_rr_theme->grip_width +
|
||||||
self->bwidth,
|
self->bwidth,
|
||||||
|
@ -626,8 +637,8 @@ void frame_adjust_area(ObFrame *self, gboolean moved,
|
||||||
XMoveResizeWindow(ob_display, self->rgriptop,
|
XMoveResizeWindow(ob_display, self->rgriptop,
|
||||||
self->size.left +
|
self->size.left +
|
||||||
self->client->area.width +
|
self->client->area.width +
|
||||||
self->size.right - self->bwidth * 2 -
|
self->size.right - self->bwidth -
|
||||||
ob_rr_theme->grip_width,
|
sidebwidth - ob_rr_theme->grip_width,
|
||||||
FRAME_HANDLE_Y(self),
|
FRAME_HANDLE_Y(self),
|
||||||
ob_rr_theme->grip_width +
|
ob_rr_theme->grip_width +
|
||||||
self->bwidth,
|
self->bwidth,
|
||||||
|
@ -670,7 +681,7 @@ void frame_adjust_area(ObFrame *self, gboolean moved,
|
||||||
ob_rr_theme->handle_height > 0)
|
ob_rr_theme->handle_height > 0)
|
||||||
{
|
{
|
||||||
XMoveResizeWindow(ob_display, self->handle,
|
XMoveResizeWindow(ob_display, self->handle,
|
||||||
self->bwidth,
|
sidebwidth,
|
||||||
FRAME_HANDLE_Y(self) + self->bwidth,
|
FRAME_HANDLE_Y(self) + self->bwidth,
|
||||||
self->width, ob_rr_theme->handle_height);
|
self->width, ob_rr_theme->handle_height);
|
||||||
XMapWindow(ob_display, self->handle);
|
XMapWindow(ob_display, self->handle);
|
||||||
|
|
Loading…
Reference in a new issue