Commit Graph

3464 Commits

Author SHA1 Message Date
hius07
5fb9216efb "Tools" menu order minor fix (#12717)
* same order in FM and Reader
* remove unused "send2ebook"
2024-11-08 19:24:53 +01:00
hius07
c2d1099976 Profiles: more auto-exec triggers 2 (#12691) 2024-10-31 20:26:21 +02:00
hius07
8b710d183c Focus: fixes (#12688) 2024-10-30 20:09:59 +02:00
hius07
97a7ebefb9 Text editor: rotate (#12658) 2024-10-29 20:49:43 +02:00
mergen3107
f8446538c0 Fix KOReader spelling in the code (#12670) 2024-10-24 10:46:46 +02:00
NiLuJe
2497d8f352 Misc: Some more FocusManager fallout (#12667)
Don't show initial focus in KVP & CalendarView

Fix https://github.com/koreader/koreader/pull/12583#issuecomment-2427403108
2024-10-22 10:38:02 +02:00
NiLuJe
fdd342de40 Menu: Fix fallout from #12583 on hasDPad devices (#12657)
Tweak `mergeTitleBarIntoLayout` to keep the current selection (adjusted for the added rows) instead of resetting the focus.

It only actually called `moveFocusTo` on `hasDPad` devices, which explains why this was missed during testing.

Fix https://github.com/koreader/koreader/pull/12583#issuecomment-2423554770
2024-10-21 13:35:44 +02:00
hius07
716ed1f19d InputText: fix Terminal plugin input (#12652)
Regression in #12632.
2024-10-17 19:06:18 +02:00
hius07
71a89e45c0 Text editor: show current line number (#12632) 2024-10-16 20:03:31 +03:00
hius07
ce7fcff360 Menu widget: draw focus on focused item (#12583) 2024-10-13 18:02:51 +03:00
hius07
85591c75ce Profiles: add "on rotation" auto-execute event (#12612) 2024-10-10 18:05:24 +03:00
hius07
76deedfb73 Menu widget: rotation handler (#12573) 2024-10-10 10:54:59 +03:00
TANG Xiao
80975ea4b0 ProgressWidget: fix misalignment (#12526) 2024-10-06 17:38:50 +02:00
David
cba79bca1c Quickstart guide Kindle illustrations (#12577) 2024-10-02 23:49:56 +02:00
hius07
b937a079ea Profiles: auto-execute on events (#12564) 2024-09-30 19:22:20 +03:00
David
e2d1c55ec5 [DictQuickLookup] shortcuts for editing searches (#12539) 2024-09-29 20:25:26 +02:00
hius07
4cdef40f97 File search: improve (#12549) 2024-09-28 19:47:56 +03:00
Chris Heywood
9e73a88e59 Fix typos in quickstart (#12566) 2024-09-28 08:42:19 +02:00
Benoit Pierre
a1edbbf0c4 use new ffi.loadlib helper (#12545)
To load our native libraries.
2024-09-26 18:36:09 +02:00
David
08205c47c8 [ReaderFooter] Update status bar in real time when inverting page turning (#12424) 2024-09-25 21:16:06 +02:00
NiLuJe
03aa96dc7d optionsutil: Document optionsutil.showValues
Specifically, the whole unit interactions ;).
2024-09-16 17:12:43 +02:00
NiLuJe
e887be693f optionsutil: Simplify the public formatFlexSize wrapper
Pull the dimension_units from in there,
instead of asking callers to do that.
2024-09-16 17:12:43 +02:00
NiLuJe
e47aeb77b7 optionsutil: Switch to PostScript point
Because that's what most people are probably thinking of.

But, more importantly, it's what *FreeType* assumes ;).
2024-09-16 17:12:43 +02:00
NiLuJe
9dfd4f949c CREOptions: Simplify a few name_text_hold_callback calls when we want to
display a size unit

Rely on `name_text_unit` instead of wrapping `optionsutil.showValues`
2024-09-16 17:12:43 +02:00
NiLuJe
cd0d8ca8bd UI: Support appending the value in pixels when formating metric/imperial dimensions 2024-09-16 17:12:43 +02:00
NiLuJe
f8890a310d optionsutil: Rename real_size_string to formatFlexSize, and make it public
Use it in the ReaderView:onPageGapUpdate notification, instead of
enforcing "px" there.
2024-09-16 17:12:43 +02:00
NiLuJe
d537ef5c76 UI: Expand the "Units" configuration menu to include "Pixels"
Rename it to "Dimension units", and make it a radio submenu.

Migrate the previous metric_length setting to this new dimension_units
one.

Update optionsutil to follow it.
2024-09-16 17:12:43 +02:00
NiLuJe
77b6ef785a koptoptions: Stop making page gap a special snowflake
Use the user-preferred display unit for dimensions.
2024-09-16 17:12:43 +02:00
NiLuJe
7239cf391d optiuonsutil: unbreak real_size_string
Don't mangle string input values when a unit was passed.
(i.e., keep displaying them as their actual string instead of as nil).

(e.g., when current is set to a number, but default is still unset,
which translates to "not set" in showValues).
2024-09-16 17:12:43 +02:00
NiLuJe
9333843919 optionsutil: tweak showValuesHMargins text string
Attempting to align the numbers on the same column was a fool's errand.
Our default UI font is not monospaced, to begin with,
and to do it right, we'd need to align the rightmost number, not the
leftmost ;).

i.e., T() would need to have much fancier justification capabilities ;).
Or, err, *any* text justification features, really ^^.
2024-09-16 17:12:43 +02:00
NiLuJe
da2957392a optionsutil: Refactor size conversion/printing
DRYer, simpler. Will make it easier to make "px" a real viable display
format.
2024-09-16 17:12:43 +02:00
NiLuJe
65ce72df27 KOptOptions: Make Page Gap a buttonprogress instead of a toggle
We want to be able to set a custom value (i.e., more_options),
because on high-dpi devices, the scaling can lead to pretty large
differences; but more_options on a toggle is ugly and clunky.

So, switch to something more suited to what this actually sets,
which is ultimately an absolute pixel value, like margins.

Add a few more steps on the low end to fill out the bar (and because
that's where I found them most useful on high-dpi devices).
2024-09-16 17:12:43 +02:00
NiLuJe
a55b1038d7 optionsutil: Make sure showValues can actually use the real_size_string helper effectively
configdialog doesn't actually pass a unit argument to
name_text_hold_callback, so pull it instead from a new name_text_unit
field.

Expand said helper to support a "px" unit, which simply converts from
our arbitrary pixels to actual on-device pixels (e.g., a plain
scaleBySize).

Enable real_size_string usage when name_text_true_values is set
(it's a NOP in terms of the generated string if no unit is specified).
2024-09-16 17:12:43 +02:00
NiLuJe
da74691515 Chore: Don't cache static data tables (ui/elements, ui/data, kb layouts & co) (#12519)
Using `require` didn't make much sense since most of them are only used in a single place anyway, and it takes care of a few weird interactions in the process (besides not polluting `package.loaded` with useless crap ;)).
2024-09-16 17:11:42 +02:00
hius07
bf290e0c2b Write highlights into PDF: revisited (#12509) 2024-09-14 15:21:26 +03:00
NiLuJe
89cceee9f1 Defaults: Deprecate DKOPTREADER_CONFIG_DOC_LANGS_TEXT
It's unused since #11977, dropping it ensures we no longer show it in
the advanced settings UI.
2024-09-11 13:20:39 +02:00
David
5b2cc5f632 Doc: Update quickstartguide on kindle non touch (#12426) 2024-09-09 14:40:17 +02:00
hius07
5476301034 ButtonDialogTitle: remove (#12394) 2024-09-07 20:11:35 +03:00
Ichnilatis
00984ba6bc Keyboard: update el_popup.lua (#12463)
Some minor changes for consistency.
2024-09-04 15:31:30 +02:00
NiLuJe
ae5222b97a InputText: Unbreak onTapTextBox on an already in-focus field (#12449)
The drive-by fix for the original issue noticed late in #12361 turned out to be a bit heavy-handed ;).

Fix #12444
Regression since #12361
2024-09-02 23:38:57 +02:00
hius07
84ed68ba82 inputtext: fix deleting a word by backspace swipe north 2024-08-31 15:18:18 +02:00
Rowan Decker
60e0e3ef45 Add color highlight menu (#11044) 2024-08-30 22:10:43 +02:00
poire-z
d51179690d PageBrowser: fix drawing of thicker thumbnail frame on tap (#12432)
Bottom and right edges were not drawn since some
recent FrameContainer tweak.
2024-08-30 14:40:14 +02:00
poire-z
96312bfa10 HtmlBoxWidget: help MuPDF with block elements it doesn't know
MuPDF's own stylesheet is incomplete, and doesn't specify that
a few common (and uncommon) elements are display:block, so it
would consider them inline, and render them badly (MuPDF also
doesn't handle well <BR/> inside inline elements, so this
fixes <br/> ones in these elements).
Fix this in HtmlBoxWidget so it solves any issue in HTML
dict and popup footnote.
For popup footnotes, also include crengine internal block
elements, as we may indeed get them in the HTML content.
2024-08-25 22:39:31 +02:00
poire-z
837b32906a TextBoxWidget: fix handling of Home/End keys on a scrollable edit box 2024-08-25 22:39:31 +02:00
poire-z
9f308399f9 Book style tweak editor: fix double notification on discard
Avoid two identical stacked notifications "Book tweak not modified"
after Close + Discard when text was modified.
2024-08-25 22:39:31 +02:00
NiLuJe
9cd305177e FocusManager: Fix focus_flags check in moveFocusTo, and deal with the fallout (#12361)
* FocusManager: Fix `focus_flags` check in `moveFocusTo` (0 is truthy in Lua, can't do AND checks like in C ;).)
* FileManager+FileChooser: Pass our custom title bar directly to FileChooser (which also means we can now use FC's FocusManager layout directly).
* FileChooser/Menu: Get rid of the weird `outer_title_bar` hack, and simply take a `custom_title_bar` pointer to an actual TitleBar instance instead.
* FileManager/Menu/ListMenu/CoverMenu: Fix content height computations in `_recalculateDimen` (all the non-FM cases were including an old and now unused padding value, `self.header_padding`, leading to more blank space at the bottom than necessary, and, worse, leading to different item heights between FM views, possibly leading to unnecessary thumbnail scaling !)
* ButtonDialog: Proper focus management when the ButtonTable is wrapped in a ScrollableContainer.
* ConfigDialog: Implement a stupid workaround for a weird FocusManager issue when going back from `[⋮]` buttons.
* ConfigDialog: Don't move the visual focus in `update` (i.e., we use `NOT_FOCUS` now that it works as intended).
* DictQuickLookup: Ensures the `Menu` key bind does the exact same thing as the hamburger icon.
* DictQuickLookup: Ensure we refocus after having mangled the FocusManager layout (prevents an old focus highlight from lingering on the wrong button).
* FileChooser: Stop flagging it as no_title, because it is *never* without a title. (This behavior was a remnant of the previous FM-specific title bar hacks, which are no longer a thing).
* FileChooser: Stop calling `mergeTitleBarIntoLayout` twice in `updateItems`. We already call Menu's, which handles it. (Prevents the title bar from being added twice to the FocusManager layout).
* FocusManager: Relax the `Unfocus` checks in `moveFocusTo` to ensure we *always* unfocus something (if unfocusing was requested), even if we have to blast the whole widget tree to do so. This ensures callers that mangle self.layout can expect things to work after calling it regardless of how borked the current focus is.
* FocusManager: Allow passing `focus_flags` to `refocusWidget`, so that it can be forwarded to the internal `moveFocusTo` call.
* FocusManager: The above also allows us to enforce a default that ensures we do *not* send a Focus event on Touch devices, even if they have the hasDPad devcap. This essentially restores the previous/current behavior of not showing the visual feedback from such focus "events" sent programmatically, given the `focus_flags` check fix at the root of this PR ;).
* InputDialog: Fix numerous issues relating to double/ghost instances of both InputText and VirtualKeyboard, ensuring we only ever have a single InputText & VK instance live.
* InputDialog: Make sure every way we have of hiding the VK play nice together, especially when the `toggleKeyboard` button (shown w/ `add_nav_bar`) is at play. And doubly so when we're `fullscreen`, as hiding the VK implies resizing the widget.
* InputText: Make sure we're flagged as in-focus when tapping inside the text field.
* InputText: Make sure we don't attempt to show an already-visible VK in the custom `hasDPad` `onFocus` handler.
* Menu: Get rid of an old and no longer used (nor meaningful) hack in `onFocus` about the initial/programmatically-sent Focus event.
* Menu: Get rid of the unused `header_padding` field mentioned earlier in the FM/FC fixes.
* Menu: Use `FOCUS_ONLY_ON_NT` in the explicit `moveFocusTo` call in `updatePageInfo`, so as to keep the current behavior of not showing the visual feedback of this focus on Touch devices.
* Menu: Make sure *all* the `moveFocusTo` calls are gated behind the `hasDPad` devcap (previously, that was only the case for `updatePageInfo`, but not `mergeTitleBarIntoLayout` (which is called by `updateItems`).
* MultiInputDialog: Actively get rid of the InputText & VK instances from the base class's constructor that we do not use.
* MultiInputDialog: Ensure the FocusManager layout is *slightly* less broken (password fields can still be a bit weird, though).
* TextViewer: Get rid of the unfocus -> layout mangling -> refocus hack now that `refocusWidget` handles this case sanely.
* VirtualKeyboard: Notify our parent InputDialog when we get closed, so it can act accordingly (e.g., resize itself when `fullscreen`).
* ScrollableContainer: Implement the necessary machinery for focus handling inside ButtonDialog (specifically, when scrolling via PgUp/PgDwn).
* TextEditor: Given the above fixes, the plugin is no longer disabled on non-touch devices.
* ReaderBookMark: Make sure we request a full refresh when closing the "Edit note" dialog, as CRe highlights may extend past its dimensions, and if it's closed separately from VK, the refresh would have been limited to its own dimensions, leaving a neat InputDialog-sized hole in the highlights ;).
2024-08-25 19:34:31 +02:00
Frédéric Brière
39fa008e21 Bookmarks: refresh list entry when closing Bookmark details dialog with X (#12390)
Also: refresh dogear state for current page when closing Page browser
or Book map, as we may have toggled bookmark on it.
2024-08-21 23:46:51 +02:00
hius07
415ce40f84 Touch menu: always go up to correct parent page (#12378) 2024-08-21 20:53:45 +03:00
David
698fc35c3f Minor keyboard corrections (#12372) 2024-08-20 12:01:27 +02:00