Skip to content

Bookmarks, CoverBrowser: scale dogear icon#4081

Merged
poire-z merged 2 commits intokoreader:masterfrom
poire-z:dogear_scaled
Jul 19, 2018
Merged

Bookmarks, CoverBrowser: scale dogear icon#4081
poire-z merged 2 commits intokoreader:masterfrom
poire-z:dogear_scaled

Conversation

@poire-z
Copy link
Copy Markdown
Contributor

@poire-z poire-z commented Jul 16, 2018

The Dogear icon is 20x20 pixels and was never scaled where used. Now:

The bookmark icon (top right of screen) is scaled to 1/32th of the screen width (previously, it was 1/30th on a 600px wide emulator, 1/53th on a GloHD).
So, it should stay the same size on a small emulator, and become 2 times bigger on a 1000px device.
1/32 looks like this:
after_pdf_bookmark

On CreDocument, furthermore decrease its size if needed depending on the selected margins so it never overwrite the text (as margins are scaled for DPI, this somehow scale the icon for dpi too).
Before => after
before_bookmark => after_crebookmark

CoverBrowser list view: scale it to the available room under the "N % of P page" text, so it does not cover "page".
before_listmenu => after_listmenu

CoverBrowser mosaic view: scale it to 1/16th of the cover rectangle, which should prevent if from overwritting the text thanks to a max text width of 7/8 of the cover rectangle.

before_mosaicmenu
=>
after_mosaicmenu

The above CoverBrowser screenshots were made on the emulator, and the icon size looks divided by 2. But the after size is actually how it looked before and still looks after on a GloHD.

Also for CoverBrowser: don't index metadata for unsupported document (which could happen when browsing files with PathChooser) and show full filename for such documents.

Also: ImageWidget: small fix in case we use both scale_factor and scale_for_dpi.

The 1/32 (for bookmark icons) and 1/16 (for coverbrowser mosaic view) can be changed if people find it too big or too small (they fit my liking, I like things small, but strangely, I don't bother the bigger bookmark icon).

Close #3265. Close #4046.

poire-z added 2 commits July 16, 2018 12:32
The Dogear icon is 20x20 pixels and was never scaled where used. Now:

The bookmark icon (top right of screen) is scaled to 1/32th of the screen
width (previously, it was 1/30th on a 600px wide emulator, 1/53th on a GloHD).
On CreDocument, furthermore decrease its size if needed depending on the
selected margins so it never overwrite the text.

CoverBrowser list view: scale it to the available room under the
"N % of P page" text, so it does not cover "page".

CoverBrowser mosaic view: scale it to 1/16th of the cover rectangle, which
should prevent if from overwritting the text thanks to a max text width of
7/8 of the cover rectangle.

Also for CoverBrowser: don't index metadata for unsupported document
(which could happen when browsing files with PathChooser) and show
full filename for such documents.

Also: ImageWidget: small fix in case we use both scale_factor and
scale_for_dpi.
@poire-z poire-z merged commit 7666644 into koreader:master Jul 19, 2018
@poire-z poire-z deleted the dogear_scaled branch July 19, 2018 06:19
@ghost
Copy link
Copy Markdown

ghost commented Jul 20, 2018

since version v2015.11.1785 the doger icon appears too small on my aura one. what parameter is it necessary to modify to change its size?

@poire-z
Copy link
Copy Markdown
Contributor Author

poire-z commented Jul 20, 2018

I guess you meant to write: my dogear icon appears too small :)

Your icon from #4046 (comment) is 70 pixels. Previously, it wasn't scaled, so it appeared at 70 pixels.
Our dogear icon wasn't scaled either previously, so it appeared at 20 pixels.

Since v2015.11.1785, the dogear icon (yours and our original one) is scaled to 1/32 of the screen width.
On a Aura One, that would make it 1404/32 = 43 pixels.
That's 2 times bigger for our icon, but 1.6 smaller for yours.
You can try removing your icon to see how our original icon do (it may be bolder than yours).

If you really want even bigger, you'd need to change manually the 32 here to 20 to have any icon the size your icon had previously:

self.dogear_max_size = math.ceil( math.min(Screen:getWidth(), Screen:getHeight()) / 32)

@ghost
Copy link
Copy Markdown

ghost commented Jul 20, 2018

this change has no effect on the size of my deager icon.
I increased the size with photoshop but again, no effect

@poire-z
Copy link
Copy Markdown
Contributor Author

poire-z commented Jul 20, 2018

OK, so for EPUBs, it is furthermore limited by the page margins, in order to not override any text.
You can disable that by adding a line at 2 places (lines 46 & 57) in the same file:

function ReaderDogear:onReadSettings(config)
    if true then return end -- ADD THIS LINE
    if not self.ui.document.info.has_pages then
[...]
function ReaderDogear:onSetPageMargins(margins)
    if true then return end -- ADD THIS LINE
    if self.ui.document.info.has_pages then

@ghost
Copy link
Copy Markdown

ghost commented Jul 20, 2018

can you tell me which file is concerned? thank you

@poire-z
Copy link
Copy Markdown
Contributor Author

poire-z commented Jul 20, 2018

The same file that you modified earlier : koreader/frontend/apps/reader/modules/readerdogear.lua

@ghost
Copy link
Copy Markdown

ghost commented Jul 20, 2018

Apparemment, ça fait planter koreader

@Frenzie
Copy link
Copy Markdown
Member

Frenzie commented Jul 20, 2018

Cela veut dire probablement que vous avez accidentellement introduit une erreur de syntaxe.

Qu'est-ce que c'est l'erreur ?

@poire-z
Copy link
Copy Markdown
Contributor Author

poire-z commented Jul 20, 2018

Replace the file with this one (remove the .txt at the end): readerdogear.lua.txt

@ghost
Copy link
Copy Markdown

ghost commented Jul 20, 2018

impeccable, thank you!

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.

size of the page brand [UX] some small visual observations

2 participants