Skip to content

Show position on config panel#3194

Merged
Frenzie merged 7 commits intokoreader:masterfrom
robert00s:config_panel_pos
Sep 11, 2017
Merged

Show position on config panel#3194
Frenzie merged 7 commits intokoreader:masterfrom
robert00s:config_panel_pos

Conversation

@robert00s
Copy link
Copy Markdown
Contributor

Actually we don't know on which panel we are (in config panel). After this change we have inverted button to show which panel we use.
Before:
screenshot 2017-09-09 18-45-54
After:
screenshot 2017-09-09 18-47-16

@poire-z
Copy link
Copy Markdown
Contributor

poire-z commented Sep 9, 2017

Would be nice if both top and bottom menus had a similar way of showing the active icon.
For the top menu, the horizontal line is cut under the active icon.
(I would personally prefer the way the top menu does it, as, on my Kobo, a partial refresh, when a big block of black disappears, leaves the new text at its place a bit lighter than the other text that was not under black, so I guess i would feel the need to do a full refresh after closing bottom menu to restore balance :)
(Haven't looked at how possible or hard it is.)

@Frenzie
Copy link
Copy Markdown
Member

Frenzie commented Sep 9, 2017

For the top menu, the horizontal line is cut under the active icon.

Not just that. It also has the lines on the side. ;-)

I'll have to try this on my device, but I suspect that rather than a plain invert I would prefer a dark gray like in the MultiSelects (or whatever they're called) in the menu itself. If we choose to go for this style, that is.

@robert00s
Copy link
Copy Markdown
Contributor Author

Better?
screenshot 2017-09-10 00-16-28

@KenMaltby
Copy link
Copy Markdown

I think the matching grey indicator is a little more consistent and obvious, but the last approach also is consistent with the top menu treatment.

local spacing_line = LineWidget:new{
dimen = Geom:new{
w = spacing_width,
h = 2,
Copy link
Copy Markdown
Member

@Frenzie Frenzie Sep 10, 2017

Choose a reason for hiding this comment

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

Shouldn't this one be icon_sep_width?

Sorry, not that value, but scaled and probably a variable for reuse on the other h=2s?

local menu_items = {}
local icons_width = 0
local icons_height = 0
local line_thickness = 2
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.

Like I said though, shouldn't it also be given the scaleBySize treatment? :-)

@Frenzie
Copy link
Copy Markdown
Member

Frenzie commented Sep 10, 2017

Looks okay but we're still missing scaling on the lines on the very top and very bottom. Could you do those as well? :-)

screenshot_2017-09-10_21-30-08-fs8

@Frenzie
Copy link
Copy Markdown
Member

Frenzie commented Sep 10, 2017

@poire-z Btw, I don't think those ImageWidgets are scaling properly?

Edit: @robert00s Not a typo this time; @poire-z is responsible for the most recent ImageWidget changes. ;-)

@poire-z
Copy link
Copy Markdown
Contributor

poire-z commented Sep 10, 2017

I don't have a monitor big enough to reproduce what you show :)
IconButton have a scale_for_dpi = true parameter. Do you get different results if you add it and set to false or true in

local menu_icon = IconButton:new{
show_parent = self.config_dialog,
icon_file = config_options[c].icon,

Also, I don't know much about dpi mathematics, but when I checked the following, I think I remember it was multiplying by 2 at most:

-- scale_for_dpi setting: update scale_factor (even if not set) with it
if self.scale_for_dpi then
local dpi_scale = Screen:getDPI() / 167
-- rounding off to power of 2 to avoid alias with pow(2, floor(log(x)/log(2))
dpi_scale = math.pow(2, math.max(0, math.floor(math.log(dpi_scale)/0.69)))

@Frenzie
Copy link
Copy Markdown
Member

Frenzie commented Sep 10, 2017

@poire-z I get what looks like good results by removing the flooring.

--- a/frontend/ui/widget/imagewidget.lua
+++ b/frontend/ui/widget/imagewidget.lua
@@ -177,9 +177,9 @@ function ImageWidget:_render()
 
     -- scale_for_dpi setting: update scale_factor (even if not set) with it
     if self.scale_for_dpi then
+        local size_scale = math.min(Screen:getWidth(), Screen:getHeight())/600
         local dpi_scale = Screen:getDPI() / 167
-        -- rounding off to power of 2 to avoid alias with pow(2, floor(log(x)/log(2))
-        dpi_scale = math.pow(2, math.max(0, math.floor(math.log(dpi_scale)/0.69)))
+        dpi_scale = math.pow(2, math.max(0, math.log((size_scale+dpi_scale)/2)/0.69))
         if self.scale_factor == nil then
             self.scale_factor = 1
         end
diff --git a/test b/test

Before

screenshot_2017-09-10_22-45-17-fs8

After

screenshot_2017-09-10_22-45-00-fs8

Edit:

Doesn't look too shabby with a custom DPI either, although it has some beauty flaws (not the ImageWidget, but the GUI in general).

screenshot_2017-09-10_22-55-54-fs8

@poire-z
Copy link
Copy Markdown
Contributor

poire-z commented Sep 10, 2017

Well, I don't really get dpi arithmetics :)
But your changes looks the same on the emulator, but are way to big on my kobo:
reader_2017-sep-10_230634
(it looks more monstruous on the device that it does on this reduced screenshot)
Original, which I prefer:
reader_2017-sep-10_231118

@robert00s
Copy link
Copy Markdown
Contributor Author

@Frenzie
Could you check now?
I wonder if this line:


shouldn't be
bordersize = Screen:scaleBySize(2),
?

@Frenzie
Copy link
Copy Markdown
Member

Frenzie commented Sep 11, 2017

Yes, that is good. But like you said, don't do it in ConfigDialog and fix FrameContainer instead. 👍

local Device = require("device")
local Geom = require("ui/geometry")
local WidgetContainer = require("ui/widget/container/widgetcontainer")
local Screen = Device.screen
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.

Nitpick, but if you only need screen then local Screen = require("device").screen is fine. ;-)

radius = 0,
bordersize = 2,
bordersize = Screen:scaleBySize(2),
padding = 5,
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.

This one too please? 👍

@Frenzie Frenzie merged commit 85e2140 into koreader:master Sep 11, 2017
@Frenzie
Copy link
Copy Markdown
Member

Frenzie commented Sep 11, 2017

Thanks!

@poire-z
Copy link
Copy Markdown
Contributor

poire-z commented Sep 12, 2017

Noticed 2 things: icons move a few pixels left or right upon selection/unselection, and the selected icon looks to me a bit tight between its 2 vertical lines.
I'm having a try at spreading the spacing between icons into some padding between icon and vertical lines.

@Frenzie
Copy link
Copy Markdown
Member

Frenzie commented Sep 12, 2017

Could you make sure the padding is touchable? The top menu also wants that treatment. ;-)

@robert00s robert00s deleted the config_panel_pos branch January 19, 2018 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants