Browse Source

Input dialogs: keep size in rotation (#8223)

reviewable/pr8227/r1
hius07 1 month ago
committed by GitHub
parent
commit
859327dea5
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 23 additions and 41 deletions
  1. +0
    -3
      frontend/apps/cloudstorage/dropbox.lua
  2. +0
    -3
      frontend/apps/cloudstorage/ftp.lua
  3. +0
    -3
      frontend/apps/cloudstorage/webdav.lua
  4. +0
    -1
      frontend/apps/filemanager/filemanagerfilesearcher.lua
  5. +9
    -6
      frontend/apps/filemanager/filemanagersetdefaults.lua
  6. +5
    -2
      frontend/apps/reader/modules/readersearch.lua
  7. +7
    -5
      frontend/ui/widget/inputdialog.lua
  8. +2
    -1
      frontend/ui/widget/multiinputdialog.lua
  9. +0
    -2
      plugins/calibre.koplugin/search.lua
  10. +0
    -6
      plugins/opds.koplugin/opdsbrowser.lua
  11. +0
    -2
      plugins/perceptionexpander.koplugin/main.lua
  12. +0
    -2
      plugins/terminal.koplugin/main.lua
  13. +0
    -5
      plugins/wallabag.koplugin/main.lua

+ 0
- 3
frontend/apps/cloudstorage/dropbox.lua View File

@ -7,7 +7,6 @@ local MultiInputDialog = require("ui/widget/multiinputdialog")
local UIManager = require("ui/uimanager")
local ReaderUI = require("apps/reader/readerui")
local util = require("util")
local Screen = require("device").screen
local T = require("ffi/util").template
local _ = require("gettext")
@ -136,8 +135,6 @@ function DropBox:config(item, callback)
},
},
},
width = math.floor(Screen:getWidth() * 0.95),
height = math.floor(Screen:getHeight() * 0.2),
input_type = "text",
}
UIManager:show(self.settings_dialog)

+ 0
- 3
frontend/apps/cloudstorage/ftp.lua View File

@ -5,7 +5,6 @@ local FtpApi = require("apps/cloudstorage/ftpapi")
local InfoMessage = require("ui/widget/infomessage")
local MultiInputDialog = require("ui/widget/multiinputdialog")
local ReaderUI = require("apps/reader/readerui")
local Screen = require("device").screen
local UIManager = require("ui/uimanager")
local ltn12 = require("ltn12")
local logger = require("logger")
@ -160,8 +159,6 @@ Username and password are optional.]])
},
},
},
width = math.floor(Screen:getWidth() * 0.95),
height = math.floor(Screen:getHeight() * 0.2),
input_type = "text",
}
UIManager:show(self.settings_dialog)

+ 0
- 3
frontend/apps/cloudstorage/webdav.lua View File

@ -8,7 +8,6 @@ local ReaderUI = require("apps/reader/readerui")
local WebDavApi = require("apps/cloudstorage/webdavapi")
local util = require("util")
local _ = require("gettext")
local Screen = require("device").screen
local T = require("ffi/util").template
local WebDav = {}
@ -153,8 +152,6 @@ The start folder is appended to the server path.]])
},
},
},
width = math.floor(Screen:getWidth() * 0.95),
height = math.floor(Screen:getHeight() * 0.2),
input_type = "text",
}
UIManager:show(self.settings_dialog)

+ 0
- 1
frontend/apps/filemanager/filemanagerfilesearcher.lua View File

@ -122,7 +122,6 @@ function FileSearcher:onShowFileSearch(search_string)
self.search_dialog = InputDialog:new{
title = _("Enter filename to search for"),
input = search_string or self.search_value,
width = math.floor(Screen:getWidth() * 0.9),
buttons = {
{
{

+ 9
- 6
frontend/apps/filemanager/filemanagersetdefaults.lua View File

@ -56,6 +56,10 @@ function SetDefaults:ConfirmEdit()
end
function SetDefaults:init()
self.screen_width = Screen:getWidth()
self.screen_height = Screen:getHeight()
self.dialog_width = math.floor(math.min(self.screen_width, self.screen_height) * 0.95)
self.results = {}
local defaults = {}
@ -90,8 +94,8 @@ function SetDefaults:init()
end
self.defaults_menu = Menu:new{
width = Screen:getWidth() - (Size.margin.fullscreen_popout * 2),
height = Screen:getHeight() - (Size.margin.fullscreen_popout * 2),
width = self.screen_width - (Size.margin.fullscreen_popout * 2),
height = self.screen_height - (Size.margin.fullscreen_popout * 2),
cface = Font:getFace("smallinfofont"),
show_parent = menu_container,
_manager = self,
@ -157,7 +161,7 @@ function SetDefaults:init()
},
},
input_type = setting_type,
width = math.floor(Screen:getWidth() * 0.95),
width = self.dialog_width,
}
UIManager:show(self.set_dialog)
self.set_dialog:onShowKeyboard()
@ -208,8 +212,7 @@ function SetDefaults:init()
},
},
},
width = math.floor(Screen:getWidth() * 0.95),
height = math.floor(Screen:getHeight() * 0.2),
width = self.dialog_width,
}
UIManager:show(self.set_dialog)
self.set_dialog:onShowKeyboard()
@ -247,7 +250,7 @@ function SetDefaults:init()
},
},
input_type = setting_type,
width = math.floor(Screen:getWidth() * 0.95),
width = self.dialog_width,
}
UIManager:show(self.set_dialog)
self.set_dialog:onShowKeyboard()

+ 5
- 2
frontend/apps/reader/modules/readersearch.lua View File

@ -107,7 +107,7 @@ function ReaderSearch:onShowFulltextSearchInput()
end
self.input_dialog = InputDialog:new{
title = _("Enter text to search for"),
width = math.floor(Screen:getWidth() * 0.9),
width = math.floor(math.min(Screen:getWidth(), Screen:getHeight()) * 0.9),
input = self.last_search_text,
buttons = {
{
@ -153,7 +153,10 @@ function ReaderSearch:onShowFulltextSearchInput()
self.check_button_regex:toggleCheck()
end,
hold_callback = function()
UIManager:show(InfoMessage:new{ text = help_text })
UIManager:show(InfoMessage:new{
text = help_text,
width = Screen:getWidth() * 0.9,
})
end,
}
self.input_dialog:addWidget(self.check_button_regex)

+ 7
- 5
frontend/ui/widget/inputdialog.lua View File

@ -202,13 +202,15 @@ local InputDialog = InputContainer:new{
}
function InputDialog:init()
self.screen_width = Screen:getWidth()
self.screen_height = Screen:getHeight()
if self.fullscreen then
self.is_movable = false
self.border_size = 0
self.width = Screen:getWidth() - 2*self.border_size
self.width = self.screen_width - 2*self.border_size
self.covers_fullscreen = true -- hint for UIManager:_repaint()
else
self.width = self.width or math.floor(Screen:getWidth() * 0.8)
self.width = self.width or math.floor(math.min(self.screen_width, self.screen_height) * 0.8)
end
if self.condensed then
self.text_width = self.width - 2*(self.border_size + self.input_padding + self.input_margin)
@ -334,7 +336,7 @@ function InputDialog:init()
end
input_widget:onCloseWidget() -- free() textboxwidget and keyboard
-- Find out available height
local available_height = Screen:getHeight()
local available_height = self.screen_height
- 2*self.border_size
- self.title_widget:getSize().h
- self.title_bar:getSize().h
@ -457,8 +459,8 @@ function InputDialog:init()
or self._input_widget:getKeyboardDimen().h
self[1] = CenterContainer:new{
dimen = Geom:new{
w = Screen:getWidth(),
h = Screen:getHeight() - keyboard_height,
w = self.screen_width,
h = self.screen_height - keyboard_height,
},
frame
}

+ 2
- 1
frontend/ui/widget/multiinputdialog.lua View File

@ -123,7 +123,8 @@ function MultiInputDialog:init()
self[1] = CenterContainer:new{
dimen = Geom:new{
w = Screen:getWidth(),
h = Screen:getHeight() - self._input_widget:getKeyboardDimen().h,
h = math.max(Screen:getHeight() - self._input_widget:getKeyboardDimen().h,
self.dialog_frame:getSize().h),
},
self.dialog_frame,
}

+ 0
- 2
plugins/calibre.koplugin/search.lua View File

@ -226,8 +226,6 @@ function CalibreSearch:ShowSearch()
},
},
},
width = math.floor(Screen:getWidth() * 0.8),
height = math.floor(Screen:getHeight() * 0.2),
}
UIManager:show(self.search_dialog)
self.search_dialog:onShowKeyboard()

+ 0
- 6
plugins/opds.koplugin/opdsbrowser.lua View File

@ -161,8 +161,6 @@ function OPDSBrowser:addNewCatalog()
},
},
},
width = math.floor(Screen:getWidth() * 0.95),
height = math.floor(Screen:getHeight() * 0.2),
}
UIManager:show(self.add_server_dialog)
self.add_server_dialog:onShowKeyboard()
@ -213,8 +211,6 @@ function OPDSBrowser:editCalibreServer()
},
},
},
width = math.floor(Screen:getWidth() * 0.95),
height = math.floor(Screen:getHeight() * 0.2),
}
UIManager:show(self.add_server_dialog)
self.add_server_dialog:onShowKeyboard()
@ -890,8 +886,6 @@ function OPDSBrowser:editOPDSServer(item)
},
},
},
width = math.floor(Screen:getWidth() * 0.95),
height = math.floor(Screen:getHeight() * 0.2),
}
UIManager:show(self.edit_server_dialog)
self.edit_server_dialog:onShowKeyboard()

+ 0
- 2
plugins/perceptionexpander.koplugin/main.lua View File

@ -152,8 +152,6 @@ function PerceptionExpander:showSettingsDialog()
},
},
},
width = math.floor(Screen:getWidth() * 0.8),
height = math.floor(Screen:getHeight() * 0.3),
}
UIManager:show(self.settings_dialog)
self.settings_dialog:onShowKeyboard()

+ 0
- 2
plugins/terminal.koplugin/main.lua View File

@ -226,7 +226,6 @@ function Terminal:editCommands(item)
edit_dialog = InputDialog:new{
title = T(_('Edit commands for "%1"'), item.text),
input = item.commands,
width = Screen:getWidth() * 0.9,
para_direction_rtl = false, -- force LTR
input_type = "string",
allow_newline = true,
@ -262,7 +261,6 @@ function Terminal:editName(item)
edit_dialog = InputDialog:new{
title = _("Edit name"),
input = item.text,
width = Screen:getWidth() * 0.9,
para_direction_rtl = false, -- force LTR
input_type = "string",
allow_newline = false,

+ 0
- 5
plugins/wallabag.koplugin/main.lua View File

@ -30,7 +30,6 @@ local socketutil = require("socketutil")
local util = require("util")
local _ = require("gettext")
local T = FFIUtil.template
local Screen = require("device").screen
-- constants
local article_id_prefix = "[w-id_"
@ -973,8 +972,6 @@ Restart KOReader after editing the config file.]]), BD.dirpath(DataStorage:getSe
},
},
},
width = math.floor(Screen:getWidth() * 0.95),
height = math.floor(Screen:getHeight() * 0.2),
input_type = "string",
}
UIManager:show(self.settings_dialog)
@ -1013,8 +1010,6 @@ function Wallabag:editClientSettings()
},
},
},
width = math.floor(Screen:getWidth() * 0.95),
height = math.floor(Screen:getHeight() * 0.2),
input_type = "string",
}
UIManager:show(self.client_settings_dialog)

Loading…
Cancel
Save