From 3f3299836d98132758790989d2076a2b72f1ed76 Mon Sep 17 00:00:00 2001 From: DreamMaoMao <2523610504@qq.com> Date: Sat, 28 Jun 2025 16:07:34 +0800 Subject: [PATCH] opt: optimize code struct --- src/config/preset.h | 23 ----------------------- src/layout/layout.h | 24 +++++++++++++++++++++++- 2 files changed, 23 insertions(+), 24 deletions(-) diff --git a/src/config/preset.h b/src/config/preset.h index e1f37ab..e0f67ff 100644 --- a/src/config/preset.h +++ b/src/config/preset.h @@ -90,29 +90,6 @@ int warpcursor = 1; /* Warp cursor to focused client */ int xwayland_persistence = 1; /* xwayland persistence */ int syncobj_enable = 0; -/* layout(s) */ -Layout overviewlayout = {"󰃇", overview, "overview"}; - -Layout layouts[] = { - // 最少两个,不能删除少于两个 - /* symbol arrange function name */ - {"S", scroller, "scroller"}, // 滚动布局 - {"T", tile, "tile"}, // 堆栈布局 - {"G", grid, "grid"}, - {"M", monocle, "monocle"}, - {"D", dwindle, "dwindle"}, - {"P", spiral, "spiral"}, - {"K", deck, "deck"}, - {"VS", vertical_scroller, "vertical_scroller"}, - {"VT", vertical_tile, "vertical_tile"}, - {"VM", vertical_monocle, "vertical_monocle"}, - {"VD", vertical_dwindle, "vertical_dwindle"}, - {"VP", vertical_spiral, "vertical_spiral"}, - {"VG", vertical_grid, "vertical_grid"}, - {"VK", vertical_deck, "vertical_deck"}, - -}; - /* keyboard */ /* diff --git a/src/layout/layout.h b/src/layout/layout.h index 2d55309..05190cf 100644 --- a/src/layout/layout.h +++ b/src/layout/layout.h @@ -13,4 +13,26 @@ static void vertical_scroller(Monitor *m); static void vertical_deck(Monitor *mon); static void vertical_dwindle(Monitor *mon); static void vertical_spiral(Monitor *mon); -static void vertical_monocle(Monitor *m); \ No newline at end of file +static void vertical_monocle(Monitor *m); + +/* layout(s) */ +Layout overviewlayout = {"󰃇", overview, "overview"}; + +Layout layouts[] = { + // 最少两个,不能删除少于两个 + /* symbol arrange function name */ + {"S", scroller, "scroller"}, // 滚动布局 + {"T", tile, "tile"}, // 堆栈布局 + {"G", grid, "grid"}, + {"M", monocle, "monocle"}, + {"D", dwindle, "dwindle"}, + {"P", spiral, "spiral"}, + {"K", deck, "deck"}, + {"VS", vertical_scroller, "vertical_scroller"}, + {"VT", vertical_tile, "vertical_tile"}, + {"VM", vertical_monocle, "vertical_monocle"}, + {"VD", vertical_dwindle, "vertical_dwindle"}, + {"VP", vertical_spiral, "vertical_spiral"}, + {"VG", vertical_grid, "vertical_grid"}, + {"VK", vertical_deck, "vertical_deck"}, +}; \ No newline at end of file