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

Status bar alignment #5195

Merged
merged 2 commits into from Aug 11, 2019

Conversation

@robert00s
Copy link
Contributor

commented Aug 10, 2019

Close #5044
Option to align status bar without progress bar.

obraz

obraz

obraz

@Frenzie Frenzie added this to the 2019.09 milestone Aug 10, 2019

@Frenzie Frenzie added the enhancement label Aug 10, 2019

local new_screen_width = Screen:getWidth()
local new_screen_height = Screen:getHeight()
if new_screen_width == self._saved_screen_width
and new_screen_height == self._saved_screen_height then return end
and new_screen_height == self._saved_screen_height and force_reset == nil then return end

This comment has been minimized.

Copy link
@Frenzie

Frenzie Aug 10, 2019

Member

Or perhaps and not force_reset so that nil and false are treated the same? (Unless the distinction between nil and false is important.)

self.footer_container = BottomContainer:new{
dimen = Geom:new{ w = 0, h = self.height*2 },
self.footer_content,
}

This comment has been minimized.

Copy link
@poire-z

poire-z Aug 10, 2019

Contributor

I never understood the why of these double BottomContainer, and why one had self.height*2 :)
It was introduced in 6938b54, I hope it does not matter with the touch zone now after many other changes since 2014 :) and that DTAP_ZONE_MINIBAR works just as expected.
(BottomContainer does centering by default, so it acted as the centerer I think - might as well use a CenterContainer as you did for clarity.)

This comment has been minimized.

Copy link
@robert00s

robert00s Aug 11, 2019

Author Contributor

I also don't understand why double BottomContainer wa used :)
Touch zones should work because we have separate method:

function ReaderFooter:setupTouchZones()
if not Device:isTouchDevice() then return end
local footer_screen_zone = {
ratio_x = DTAP_ZONE_MINIBAR.x, ratio_y = DTAP_ZONE_MINIBAR.y,
ratio_w = DTAP_ZONE_MINIBAR.w, ratio_h = DTAP_ZONE_MINIBAR.h,
}
self.ui:registerTouchZones({
{
id = "readerfooter_tap",
ges = "tap",
screen_zone = footer_screen_zone,
handler = function(ges) return self:onTapFooter(ges) end,
overrides = {
"tap_forward",
"tap_backward",
"readerconfigmenu_tap",
},
},
{
id = "readerfooter_hold",
ges = "hold",
screen_zone = footer_screen_zone,
handler = function() return self:onHoldFooter() end,
overrides = {
"readerhighlight_hold",
},
},
})
end

dimen = Geom:new{},
self.footer_container,
}
self[1] = self.footer_positioner

This comment has been minimized.

Copy link
@poire-z

poire-z Aug 10, 2019

Contributor

That code is duplicated with the one in ReaderFooter:init() that you updated above.
Might be moved in a new ReaderFooter:updateFooterContainer() so there's a single copy of that code that could be called from both places.
That would give here:

                callback = function()
                    self.settings.align = "center"
                    self:updateFooterContainer()
                    self:resetLayout(true)
                    self:updateFooter()
                    UIManager:setDirty(nil, "ui")
                end,

This comment has been minimized.

Copy link
@Frenzie

Frenzie Aug 10, 2019

Member

I second that.

This comment has been minimized.

Copy link
@robert00s

robert00s Aug 11, 2019

Author Contributor

Good point.

@Frenzie Frenzie merged commit 0a2a1ff into koreader:master Aug 11, 2019

1 check passed

ci/circleci Your tests passed on CircleCI!
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.