From 079038252469e0a70b51f28f46587c287864f767 Mon Sep 17 00:00:00 2001 From: Ksaper Date: Sun, 5 Feb 2023 00:42:18 +0200 Subject: [PATCH] Use forced_num_col so I don't need to do dumb shit to get the actual amount of rows --- widget/app_launcher/init.lua | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/widget/app_launcher/init.lua b/widget/app_launcher/init.lua index 9ff0060..6aef106 100644 --- a/widget/app_launcher/init.lua +++ b/widget/app_launcher/init.lua @@ -413,12 +413,9 @@ local function page_forward(self, direction) if direction == "down" then select_app(self, 1, 1) else - local last_col_max_row = math.min(pos.row, #self._private.grid.children % self.apps_per_row) - if last_col_max_row ~= 0 then - select_app(self, last_col_max_row, 1) - else - select_app(self, pos.row, 1) - end + local rows, _ = self._private.grid:get_dimension() + local row = math.min(pos.row, rows) + select_app(self, row, 1) end end end @@ -903,11 +900,11 @@ local function new(args) layout = wibox.layout.grid, forced_width = grid_width, forced_height = grid_height, - orientation = "horizontal", + orientation = "vertical", homogeneous = true, expand = ret.expand_apps, spacing = ret.apps_spacing, - forced_num_rows = ret.apps_per_row, + forced_num_cols = ret.apps_per_column, buttons = { awful.button({}, 4, function() scroll_up(ret) end),