Config: Apply PeVe/mseed patch: layout_button_width option in [layouts] section. Thanks to them.
This commit is contained in:
@@ -393,6 +393,7 @@ conf_layout_section(void)
|
||||
|
||||
layouts = fetch_section_first(NULL, "layouts");
|
||||
|
||||
conf.layout_button_width = fetch_opt_first(layouts, "O", "layout_button_width").num;
|
||||
conf.border.layout = fetch_opt_first(layouts, "false", "border").bool;
|
||||
conf.colors.layout_fg = fetch_opt_first(layouts, "#ffffff", "fg").str;
|
||||
conf.colors.layout_bg = getcolor((fetch_opt_first(layouts, "#000000", "bg").str));
|
||||
|
||||
@@ -95,7 +95,7 @@ infobar_init(void)
|
||||
/* Create layout switch barwindow */
|
||||
infobar[sc].layout_button = barwin_create(infobar[sc].bar->win,
|
||||
((conf.layout_placement) ? 0 : (j + PAD / 2)), 0,
|
||||
textw(tags[sc][seltag[sc]].layout.symbol) + PAD,
|
||||
((conf.layout_button_width > 0) ? conf.layout_button_width : (textw(tags[sc][seltag[sc]].layout.symbol) + PAD)),
|
||||
infobar[sc].geo.height,
|
||||
conf.colors.layout_bg, conf.colors.layout_fg,
|
||||
False, False, conf.border.layout);
|
||||
@@ -159,7 +159,7 @@ infobar_draw_layout(int sc)
|
||||
if(!conf.layout_placement)
|
||||
barwin_move(infobar[sc].layout_button, infobar[sc].tags_board->geo.width + PAD / 2, 0);
|
||||
|
||||
barwin_resize(infobar[sc].layout_button, textw(tags[sc][seltag[sc]].layout.symbol) + PAD, infobar[sc].geo.height);
|
||||
barwin_resize(infobar[sc].layout_button, ((conf.layout_button_width > 0) ? conf.layout_button_width : (textw(tags[sc][seltag[sc]].layout.symbol) + PAD)), infobar[sc].geo.height);
|
||||
barwin_refresh_color(infobar[sc].layout_button);
|
||||
|
||||
if(tags[sc][seltag[sc]].layout.symbol)
|
||||
@@ -225,7 +225,7 @@ infobar_draw_taglist(int sc)
|
||||
Bool is_occupied[MAXTAG + 1];
|
||||
|
||||
if(conf.layout_placement)
|
||||
barwin_move(infobar[sc].tags_board, textw(tags[sc][seltag[sc]].layout.symbol) + PAD * 1.5, 0);
|
||||
barwin_move(infobar[sc].tags_board, ((conf.layout_button_width > 0) ? conf.layout_button_width : (textw(tags[sc][seltag[sc]].layout.symbol) + PAD)) + PAD / 2, 0);
|
||||
|
||||
for(i = 0; i < MAXTAG; i++)
|
||||
is_occupied[i] = False;
|
||||
|
||||
@@ -61,7 +61,7 @@ launcher_execute(Launcher *launcher)
|
||||
|
||||
x = (conf.layout_placement)
|
||||
? (infobar[selscreen].tags_board->geo.x + infobar[selscreen].tags_board->geo.width)
|
||||
: (infobar[selscreen].layout_button->geo.x + textw(tags[selscreen][seltag[selscreen]].layout.symbol) + PAD);
|
||||
: (infobar[selscreen].layout_button->geo.x + infobar[selscreen].layout_button->geo.width);
|
||||
|
||||
XGrabKeyboard(dpy, ROOT, True, GrabModeAsync, GrabModeAsync, CurrentTime);
|
||||
|
||||
|
||||
@@ -469,6 +469,7 @@ typedef struct
|
||||
} systray;
|
||||
Alias alias[256];
|
||||
uint mouse_tag_action[TagActionLast];
|
||||
int layout_button_width;
|
||||
Layout layout[NUM_OF_LAYOUT];
|
||||
Menu *menu;
|
||||
Launcher *launcher;
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
bg = "#191919"
|
||||
fg = "#D4D4ff"
|
||||
|
||||
# Cut title lenght
|
||||
# Cut title length
|
||||
# max_length = 25
|
||||
|
||||
[mouse] button = "3" func = "clientlist" [/mouse]
|
||||
@@ -65,6 +65,9 @@
|
||||
# Symbol displayed for the selected layout in the list
|
||||
selected_layout_symbol = "*"
|
||||
|
||||
# Width of layout button
|
||||
# layout_button_width = x
|
||||
|
||||
# Tiling layouts.
|
||||
[layout] type = "tile_right" symbol = "RIGHT" [/layout]
|
||||
[layout] type = "tile_left" symbol = "LEFT" [/layout]
|
||||
|
||||
Reference in New Issue
Block a user