Upload modified plugin files that correct .svg rendering issue as well as adding feature for auto-enter on correct PIN
This commit is contained in:
27
pinpadlockscreen.koplugin/ui/pinpaddialog.lua
Normal file → Executable file
27
pinpadlockscreen.koplugin/ui/pinpaddialog.lua
Normal file → Executable file
@@ -204,7 +204,8 @@ function PinPadDialog:initializeScreensaverBackground()
|
||||
alpha = true,
|
||||
width = self.icon_size,
|
||||
height = self.icon_size,
|
||||
scale_factor = 0,
|
||||
-- don't force raster scaling for SVGs; let renderer handle vector scaling for crisp output
|
||||
scale_factor = nil,
|
||||
original_in_nightmode = false,
|
||||
}
|
||||
self.screensaver_widget = ScreenSaverWidget:new {
|
||||
@@ -284,7 +285,8 @@ function PinPadDialog:showPinPad()
|
||||
alpha = true,
|
||||
width = self.icon_size,
|
||||
height = self.icon_size,
|
||||
scale_factor = 0,
|
||||
-- allow vector rendering for SVGs
|
||||
scale_factor = nil,
|
||||
original_in_nightmode = false,
|
||||
}
|
||||
}
|
||||
@@ -301,7 +303,8 @@ function PinPadDialog:showPinPad()
|
||||
alpha = true,
|
||||
width = self.icon_size,
|
||||
height = self.icon_size,
|
||||
scale_factor = 0,
|
||||
-- allow vector rendering for SVGs
|
||||
scale_factor = nil,
|
||||
original_in_nightmode = false,
|
||||
}
|
||||
}
|
||||
@@ -399,12 +402,25 @@ function PinPadDialog:onAppendToPin(digit)
|
||||
end
|
||||
self.pin = self.pin .. digit
|
||||
|
||||
-- Check whether we should auto-submit the PIN immediately: only when
|
||||
-- we're in the locked/confirm_current_code stages and the entered pin
|
||||
-- matches the stored PIN.
|
||||
local stored_pin = G_reader_settings:readSetting("pinpadlock_pin_code") or ""
|
||||
local should_auto_submit = (self.stage == "locked" or self.stage == "confirm_current_code") and (self.pin == stored_pin)
|
||||
|
||||
if G_reader_settings:isTrue("pinpadlock_display_digit_activated") then
|
||||
local temp_display_text = self.dialog_text .. digit
|
||||
self.dialog:updateTitle(temp_display_text)
|
||||
|
||||
self.dialog_text = self.dialog_text .. "*"
|
||||
|
||||
-- If we matched the PIN, submit immediately. closeDialogs() (called in onOk)
|
||||
-- will stop any timers and clean up widgets properly.
|
||||
if should_auto_submit then
|
||||
self:onOk()
|
||||
return
|
||||
end
|
||||
|
||||
self.digit_display_timer = UIManager:scheduleIn(1, function()
|
||||
self.dialog:updateTitle(self.dialog_text)
|
||||
self.digit_display_timer = nil
|
||||
@@ -412,6 +428,11 @@ function PinPadDialog:onAppendToPin(digit)
|
||||
else
|
||||
self.dialog_text = self.dialog_text .. "*"
|
||||
self.dialog:updateTitle(self.dialog_text)
|
||||
|
||||
if should_auto_submit then
|
||||
self:onOk()
|
||||
return
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user