all repos — openbox @ 078f6e5ad0641372bb3c656b588f6c325fb64db0

openbox fork - make it a bit more like ryudo

properly align stuff when the icon is on the right side
Dana Jansens danakj@orodu.net
commit

078f6e5ad0641372bb3c656b588f6c325fb64db0

parent

6bb61c309550b8d1daa54553bbefd58f1e51e600

1 files changed, 13 insertions(+), 7 deletions(-)

jump to
M openbox/frame.copenbox/frame.c

@@ -1014,7 +1014,7 @@ const gint bwidth = ob_rr_theme->button_size + ob_rr_theme->paddingx + 1;

/* position of the left most button */ const gint left = ob_rr_theme->paddingx + 1; /* position of the right most button */ - const gint right = self->width - bwidth; + const gint right = self->width; /* turn them all off */ self->icon_on = self->desk_on = self->shade_on = self->iconify_on =

@@ -1055,43 +1055,49 @@ if (firstcon) *firstcon = OB_FRAME_CONTEXT_ICON;

if ((self->icon_on = is_button_present(self, lc, i))) { /* icon is bigger than buttons */ self->label_width -= bwidth + 2; - self->icon_x = x; + if (i > 0) self->icon_x = x; x += i * (bwidth + 2); + if (i < 0) self->icon_x = x; } } else if (*lc == 'D') { if (firstcon) *firstcon = OB_FRAME_CONTEXT_ALLDESKTOPS; if ((self->desk_on = is_button_present(self, lc, i))) { self->label_width -= bwidth; - self->desk_x = x; + if (i > 0) self->desk_x = x; x += i * bwidth; + if (i < 0) self->desk_x = x; } } else if (*lc == 'S') { if (firstcon) *firstcon = OB_FRAME_CONTEXT_SHADE; if ((self->shade_on = is_button_present(self, lc, i))) { self->label_width -= bwidth; - self->shade_x = x; + if (i > 0) self->shade_x = x; x += i * bwidth; + if (i < 0) self->shade_x = x; } } else if (*lc == 'I') { if (firstcon) *firstcon = OB_FRAME_CONTEXT_ICONIFY; if ((self->iconify_on = is_button_present(self, lc, i))) { self->label_width -= bwidth; - self->iconify_x = x; + if (i > 0) self->iconify_x = x; x += i * bwidth; + if (i < 0) self->iconify_x = x; } } else if (*lc == 'M') { if (firstcon) *firstcon = OB_FRAME_CONTEXT_MAXIMIZE; if ((self->max_on = is_button_present(self, lc, i))) { self->label_width -= bwidth; - self->max_x = x; + if (i > 0) self->max_x = x; x += i * bwidth; + if (i < 0) self->max_x = x; } } else if (*lc == 'C') { if (firstcon) *firstcon = OB_FRAME_CONTEXT_CLOSE; if ((self->close_on = is_button_present(self, lc, i))) { self->label_width -= bwidth; - self->close_x = x; + if (i > 0) self->close_x = x; x += i * bwidth; + if (i < 0) self->close_x = x; } } else continue; /* don't set firstcon */