diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..5008ddf Binary files /dev/null and b/.DS_Store differ diff --git a/pinpadlockscreen.koplugin/.DS_Store b/pinpadlockscreen.koplugin/.DS_Store new file mode 100644 index 0000000..bd9639b Binary files /dev/null and b/pinpadlockscreen.koplugin/.DS_Store differ diff --git a/pinpadlockscreen.koplugin/_meta.lua b/pinpadlockscreen.koplugin/_meta.lua old mode 100644 new mode 100755 diff --git a/pinpadlockscreen.koplugin/main.lua b/pinpadlockscreen.koplugin/main.lua old mode 100644 new mode 100755 diff --git a/pinpadlockscreen.koplugin/menu/menuentryitems.lua b/pinpadlockscreen.koplugin/menu/menuentryitems.lua old mode 100644 new mode 100755 diff --git a/pinpadlockscreen.koplugin/menu/pinpadmenuentry.lua b/pinpadlockscreen.koplugin/menu/pinpadmenuentry.lua old mode 100644 new mode 100755 diff --git a/pinpadlockscreen.koplugin/ui/.DS_Store b/pinpadlockscreen.koplugin/ui/.DS_Store new file mode 100644 index 0000000..32cb671 Binary files /dev/null and b/pinpadlockscreen.koplugin/ui/.DS_Store differ diff --git a/pinpadlockscreen.koplugin/ui/icons/lock.svg b/pinpadlockscreen.koplugin/ui/icons/lock.svg old mode 100644 new mode 100755 diff --git a/pinpadlockscreen.koplugin/ui/pinpadbuttondialog.lua b/pinpadlockscreen.koplugin/ui/pinpadbuttondialog.lua old mode 100644 new mode 100755 index 93637ba..f90f165 --- a/pinpadlockscreen.koplugin/ui/pinpadbuttondialog.lua +++ b/pinpadlockscreen.koplugin/ui/pinpadbuttondialog.lua @@ -24,6 +24,7 @@ local VerticalGroup = require("ui/widget/verticalgroup") local VerticalSpan = require("ui/widget/verticalspan") local Screen = Device.screen local util = require("util") +local RenderImage = require("ui/renderimage") local DGENERIC_ICON_SIZE = G_defaults:readSetting("DGENERIC_ICON_SIZE") @@ -83,14 +84,23 @@ function PinpadButtonDialog:init() } local aesthetic_space = VerticalSpan:new { width = Size.margin.default + Size.padding.default } + -- Pre-render the SVG to an image to avoid inconsistent caching/rasterization across multiple shows. + local icon_image = nil + local icon_path = plugin_dir and (plugin_dir .. "/icons/lock.svg") or nil + if icon_path and util.getFileNameSuffix(icon_path) == "svg" then + icon_image = RenderImage:renderSVGImageFile(icon_path, nil, nil, 1) + end local text_pin_content = VerticalGroup:new { align = "center", ImageWidget:new { - file = plugin_dir .. "/icons/lock.svg", + -- Prefer a pre-rendered image object when available; fallback to file path so existing behavior is preserved. + image = icon_image, + file = icon_image and nil or (plugin_dir .. "/icons/lock.svg"), alpha = true, width = Screen:scaleBySize(DGENERIC_ICON_SIZE) * 1.25, height = Screen:scaleBySize(DGENERIC_ICON_SIZE) * 1.25, - 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, }, aesthetic_space, @@ -204,6 +214,7 @@ function PinpadButtonDialog:init() alpha = self.alpha, anchor = self.anchor, FrameContainer:new { + -- Restore original white window background so the dialog has a proper window appearance. background = Blitbuffer.COLOR_WHITE, bordersize = Size.border.window, radius = Size.radius.window, diff --git a/pinpadlockscreen.koplugin/ui/pinpaddialog.lua b/pinpadlockscreen.koplugin/ui/pinpaddialog.lua old mode 100644 new mode 100755 index 25eada0..1da58f2 --- a/pinpadlockscreen.koplugin/ui/pinpaddialog.lua +++ b/pinpadlockscreen.koplugin/ui/pinpaddialog.lua @@ -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 diff --git a/pinpadlockscreen.koplugin/util/screensaverutil.lua b/pinpadlockscreen.koplugin/util/screensaverutil.lua old mode 100644 new mode 100755