feat: add layout tgmix
This commit is contained in:
@@ -485,7 +485,8 @@ void resize_tile_client(Client *grabc, bool isdrag, int offsetx, int offsety,
|
||||
const Layout *current_layout =
|
||||
grabc->mon->pertag->ltidxs[grabc->mon->pertag->curtag];
|
||||
if (current_layout->id == TILE || current_layout->id == DECK ||
|
||||
current_layout->id == CENTER_TILE || current_layout->id == RIGHT_TILE
|
||||
current_layout->id == CENTER_TILE || current_layout->id == RIGHT_TILE ||
|
||||
(current_layout->id == TGMIX && grabc->mon->visible_tiling_clients <= 3)
|
||||
|
||||
) {
|
||||
resize_tile_master_horizontal(grabc, isdrag, offsetx, offsety, time,
|
||||
|
||||
@@ -840,4 +840,15 @@ monocle(Monitor *m) {
|
||||
}
|
||||
if ((c = focustop(m)))
|
||||
wlr_scene_node_raise_to_top(&c->scene->node);
|
||||
}
|
||||
|
||||
void tgmix(Monitor *m) {
|
||||
uint32_t n = m->visible_tiling_clients;
|
||||
if (n <= 3) {
|
||||
tile(m);
|
||||
return;
|
||||
} else {
|
||||
grid(m);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -11,6 +11,7 @@ static void vertical_overview(Monitor *m);
|
||||
static void vertical_grid(Monitor *m);
|
||||
static void vertical_scroller(Monitor *m);
|
||||
static void vertical_deck(Monitor *mon);
|
||||
static void tgmix(Monitor *m);
|
||||
|
||||
/* layout(s) */
|
||||
Layout overviewlayout = {"", overview, "overview"};
|
||||
@@ -27,6 +28,7 @@ enum {
|
||||
VERTICAL_GRID,
|
||||
VERTICAL_DECK,
|
||||
RIGHT_TILE,
|
||||
TGMIX,
|
||||
};
|
||||
|
||||
Layout layouts[] = {
|
||||
@@ -44,4 +46,5 @@ Layout layouts[] = {
|
||||
{"VT", vertical_tile, "vertical_tile", VERTICAL_TILE}, // 垂直平铺布局
|
||||
{"VG", vertical_grid, "vertical_grid", VERTICAL_GRID}, // 垂直格子布局
|
||||
{"VK", vertical_deck, "vertical_deck", VERTICAL_DECK}, // 垂直卡片布局
|
||||
{"TG", tgmix, "tgmix", TGMIX}, // 混合布局
|
||||
};
|
||||
Reference in New Issue
Block a user