Skip to content

Add separator to custom footer text item - #14328

Merged
Frenzie merged 2 commits into
koreader:masterfrom
JasonInOttawa:master
Sep 15, 2025
Merged

Add separator to custom footer text item#14328
Frenzie merged 2 commits into
koreader:masterfrom
JasonInOttawa:master

Conversation

@JasonInOttawa

@JasonInOttawa JasonInOttawa commented Sep 14, 2025

Copy link
Copy Markdown
Contributor

This change is Reviewable

@Frenzie
Frenzie requested a review from hius07 September 14, 2025 19:10
@hius07

hius07 commented Sep 14, 2025

Copy link
Copy Markdown
Member

I'm not sure about this.
Patterns are for variables, like opened book metadata, reading progress or device/system state.
Fixed symbols can be written into the string directly.

@JasonInOttawa

Copy link
Copy Markdown
Contributor Author

I did do that with a cut and paste, but it was hard to find the right symbol and paste it on a Kobo. I did it in a desktop application and then manually updated the settings file on the Kobo. Thought it would be easier this way.

@JasonInOttawa

Copy link
Copy Markdown
Contributor Author

Also I believe (but haven't tried) that changing the separator in settings will update this automatically

@Frenzie

Frenzie commented Sep 14, 2025

Copy link
Copy Markdown
Member

Also I believe (but haven't tried) that changing the separator in settings will update this automatically

Correct. It is indeed a type of variable in that sense.

@hius07

hius07 commented Sep 15, 2025

Copy link
Copy Markdown
Member

I still don't feel the settings to be variables. Anyway, up to @Frenzie.

If approved, this pattern should be under is_doc_required, otherwise it'll crash in the file browser.

UPD: not under is_doc_required but safeguarded:
if patterns["%r"] and self.document then

end

if patterns["%r"] then
local separator_icon = self.ui.view.footer:genSeparator()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Depending on the settings it can be not an icon, so just separator.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UPD: no need of this local at all.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Local removed


if patterns["%r"] then
local separator_icon = self.ui.view.footer:genSeparator()
if separator_icon then

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

genSeparator always returns something, the check is not needed.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check removed

@Frenzie

Frenzie commented Sep 15, 2025

Copy link
Copy Markdown
Member

I still don't feel the settings to be variables. Anyway, up to @Frenzie.

I think it makes sense to have your added separators automatically change along with any built-in ones.

@JasonInOttawa

Copy link
Copy Markdown
Contributor Author

I set my separator to all the choices (vertical bar/bullet/dot/no separator) and noticed that the separator changed each time and did not crash when "no separator" was chosen

@Frenzie Frenzie added this to the 2025.10 milestone Sep 15, 2025
@Frenzie
Frenzie merged commit 3362917 into koreader:master Sep 15, 2025
4 checks passed
0xstillb pushed a commit to 0xstillb/koreader-thai that referenced this pull request May 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants