Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI Changes #5508

Merged
merged 41 commits into from Oct 21, 2019
Merged

UI Changes #5508

Changes from 5 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
919ce2b
Changed File Browser text
dontcrash Oct 20, 2019
4e5dab7
Changed the File Browser icon in reading mode
dontcrash Oct 20, 2019
08057d3
Remove the "page x of x" if only one page
dontcrash Oct 20, 2019
224a361
Remove the "page x of x" if only one page
dontcrash Oct 20, 2019
bffd512
Renamed ~ to Home
dontcrash Oct 20, 2019
dbaa11b
Added 12 hour time option
dontcrash Oct 20, 2019
e8ab7ff
Rename 12 Hour time to clock
dontcrash Oct 20, 2019
0bffa6e
Bug fix for page numbers
dontcrash Oct 20, 2019
3d9de99
Changed to setText method
dontcrash Oct 20, 2019
1e976c3
Commented code changes
dontcrash Oct 20, 2019
d243867
Revert to previous icon
dontcrash Oct 20, 2019
64f1dac
Added translation to "Home" text
dontcrash Oct 20, 2019
757b161
Changed time seperator
dontcrash Oct 20, 2019
c0cdba6
Change 12 hour clock to 12-hour clock
dontcrash Oct 20, 2019
bcf838d
Added custom home path dialog
dontcrash Oct 20, 2019
73c2b99
Rename page to Page
dontcrash Oct 20, 2019
4f1a157
Grammar
dontcrash Oct 20, 2019
fb850b9
Indentation
dontcrash Oct 20, 2019
220fd9e
Change twelve_hour_time to twelve_hour_clock
dontcrash Oct 21, 2019
a989081
Merge branch 'master' of https://github.com/dontcrash/koreader
dontcrash Oct 21, 2019
e2f37ce
Fixed indentation
dontcrash Oct 21, 2019
7ad1bac
Fixed indentation
dontcrash Oct 21, 2019
650443c
Removed unnecessary comment
dontcrash Oct 21, 2019
3c965cf
Proposed "Home" changes
dontcrash Oct 21, 2019
b1689d9
Remove unused InputDialog import
dontcrash Oct 21, 2019
57e6184
Fixed duplicate import name
dontcrash Oct 21, 2019
7ba3ab6
Rename "page" to "Page" for consistency
dontcrash Oct 21, 2019
e14f4db
Reduce calls to os.date as per poire-z's suggestion
dontcrash Oct 21, 2019
790029b
Reduce chance of desync, style improvement
dontcrash Oct 21, 2019
d40f5df
Change back to _("Home")
dontcrash Oct 21, 2019
42138f6
Removed comments that are unneeded
dontcrash Oct 21, 2019
d21662b
Unneeded comments
dontcrash Oct 21, 2019
a8687e7
Removed variable that was only used once
dontcrash Oct 21, 2019
b715fbc
Remove / from subfolders in home path
dontcrash Oct 21, 2019
a969565
Update touchmenu.lua
dontcrash Oct 21, 2019
a969838
Removed variable that was used only once
dontcrash Oct 21, 2019
2e7692e
Fixed order
dontcrash Oct 21, 2019
babd7da
Merge branch 'master' of https://github.com/dontcrash/koreader
dontcrash Oct 21, 2019
e7d1096
Merge branch 'master' of https://github.com/dontcrash/koreader
dontcrash Oct 21, 2019
447edaf
Moved translators comment to attach to the right line
dontcrash Oct 21, 2019
b420cad
Code optimization, thanks poire-z
dontcrash Oct 21, 2019
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

@@ -55,7 +55,7 @@ local function truncatePath(text)
end

local FileManager = InputContainer:extend{
title = _("KOReader File Browser"),
title = _("KOReader"),
root_path = lfs.currentdir(),
onExit = function() end,

@@ -40,7 +40,7 @@ function ReaderMenu:init()
icon = "resources/icons/appbar.magnify.browse.png",
},
filemanager = {
icon = "resources/icons/appbar.cabinet.files.png",
icon = "resources/icons/appbar.home.png",
remember = false,
callback = function()
self:onTapCloseMenu()
@@ -899,6 +899,9 @@ function Menu:updatePageInfo(select_number)
end
-- update page information
self.page_info_text:setText(util.template(_("page %1 of %2"), self.page, self.page_num))
if self.page == self.page_num then
self.page_info_text:setText("");
This conversation was marked as resolved by dontcrash
Comment on lines +902 to +903

This comment has been minimized.

Copy link
@poire-z

poire-z Oct 20, 2019

Contributor

In file browser, when on the last page, you'd see blank (between arrow buttons) instead of Page 3 of 3.
Probably better that way:

if self.page_num > 1 then
    self.page_info_text:setText(util.template(_("page %1 of %2"), self.page, self.page_num))
else
    self.page_info_text:setText("");
end

This comment has been minimized.

Copy link
@dontcrash

dontcrash Oct 20, 2019

Author Contributor

Absolutely agree, will update my code now, didn't think of that!

This conversation was marked as resolved by dontcrash

This comment has been minimized.

Copy link
@Frenzie

Frenzie Oct 20, 2019

Member
Suggested change
self.page_info_text:setText("");
self.page_info_text:setText("");
end
self.page_info_left_chev:showHide(self.page_num > 1)
self.page_info_right_chev:showHide(self.page_num > 1)
self.page_info_first_chev:showHide(self.page_num > 2)
@@ -595,6 +595,9 @@ function TouchMenu:updateItems()
table.insert(self.item_group, self.footer)
-- @translators %1 is the current page. %2 is the total number of pages. In some languages a good translation might need to reverse this order, for instance: "Total %2, page %1".
This conversation was marked as resolved by dontcrash

This comment has been minimized.

Copy link
@Frenzie

Frenzie Oct 21, 2019

Member

The comment should remain attached to the string for clarity within the code. (I think xgettext won't care and apply it to the first following string.)

self.page_info_text.text = util.template(_("Page %1 of %2"), self.page, self.page_num)
if self.page == self.page_num then
self.page_info_text:setText("");
This conversation was marked as resolved by dontcrash
Comment on lines +598 to +599

This comment has been minimized.

Copy link
@poire-z

poire-z Oct 20, 2019

Contributor

Not sure why, but in the top menu, when there are multiple pages, I don't see anymore Page P of N, I always see blank between arrows (eg, with crowded menu Gear > Tap & gestures > Gesture manager > Multiswipe)

This comment has been minimized.

Copy link
@dontcrash

dontcrash Oct 20, 2019

Author Contributor

Can be fixed by applying the same solution as menu.lua if page_num > 1, will update code

end
self.page_info_left_chev:showHide(self.page_num > 1)
self.page_info_right_chev:showHide(self.page_num > 1)
self.page_info_left_chev:enableDisable(self.page > 1)
@@ -132,14 +132,14 @@ function CoverBrowser:addToMainMenu(menu_items)
separator = true,
},
{
text = _("Shorten home directory to ~"),
text = _("Shorten home directory to Home"),
This conversation was marked as resolved by dontcrash
Comment on lines -135 to +135

This comment has been minimized.

Copy link
@poire-z

poire-z Oct 20, 2019

Contributor

Since the file browser can be considered "Home"

Can be, but not must be :) So don't must me!
That name can be tweaked, as the setting is just the value to be shown.
I don't mind replacing the default with Home, but you should allow me to use ~/. (OK, one could manually hack it into its settings.reader.lua - and if one has already checked that box, it will stay with ~ - until one play again with that checkbox.)
So, this should be some InputText (so no checkbox? or a checkbox for callback - and a hold_callback to set the name to use)?
Also, text = _("Shorten home directory"), , or include the setting value.

And "Home" should be translatable.
And I dunno. It looks nice in english with Home (Home/Wikipedia/Science) - may be less with some french translation (Accueil/Wikipedia/Science), and probably bothering in languages with long words (MyLilleHomeInThePrairie/Wikipedia/Science).

This comment has been minimized.

Copy link
@dontcrash

dontcrash Oct 20, 2019

Author Contributor

This change I'm impartial with, I like Home personally but it would be nice to allow the user to set the text, e.g. ~ or Home, I will have to do some more digging to figure out how to do that as I am still learning how all the code for KOReader is structured, haven't worked with LUA before either

checked_func = function() return G_reader_settings:readSetting("home_dir_display_name") end,
callback = function()
if G_reader_settings:readSetting("home_dir_display_name") then
G_reader_settings:delSetting("home_dir_display_name")
if FileManager.instance then FileManager.instance:reinit() end
else
G_reader_settings:saveSetting("home_dir_display_name", "~")
G_reader_settings:saveSetting("home_dir_display_name", "Home")
if FileManager.instance then FileManager.instance:reinit() end
end
end,
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.