fix #11810: only set FocusManager layout if hasDPod (#11811)

This commit is contained in:
Philip Chan
2024-05-16 00:29:32 +08:00
committed by GitHub
parent fd5260f2ce
commit 5d63907cae

View File

@@ -721,8 +721,10 @@ function DictQuickLookup:init()
-- NT: add dict_title.left_button and lookup_edit_button to FocusManager.
-- It is better to add these two buttons into self.movable, but it is not a FocusManager.
-- Only self.button_table is a FocusManager, so workaground is inserting these two buttons into self.button_table.layout.
table.insert(self.button_table.layout, 1, { self.dict_title.left_button });
table.insert(self.button_table.layout, 2, { lookup_edit_button });
if Device:hasDPad() then
table.insert(self.button_table.layout, 1, { self.dict_title.left_button });
table.insert(self.button_table.layout, 2, { lookup_edit_button });
end
-- We're a new window
table.insert(DictQuickLookup.window_list, self)