-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Configuration for the alternate status bar in crengine #7107
Conversation
For reference, the available settings I found out: #5848 (comment) A few thoughts:
|
That was my first thought too. :-) |
Thanks, I will add the remaining switches, when the code is ready.
Plugin or core, I don't mind. But a sub-menu is confusing. Maybe 'Status bars' with a submenu for each bar?
Yes
I took
Hmm. Now, displaying the top status bar is per document and the default value for fresh opened documents is set with
Interestingly the menu-entry is only shown with crengine and not with mupdf. But a check does no harm.
Yup. |
Dunno. I think I would prefer we not add footer stuff into a submenu of Also, if you move it into core, I'm not sure what's the best place to handle that. ReaderFooter sounds like not the best place :) ReaderTypeSet is where we handle other crengine specific stuff, but top status bar is not typesetting...
May be - but was that really a good idea? Possibly, it was done the same way as other typesetting settings are used and set (per document), but I think for footer and top bars, your preferences in what is shown is something kind of global. Having it per document, for me, is more confusing as if you change something, it will only affect future newly opened books - previously opened books stick with what were your altStatusBar setting at the time... |
It's a menu like "Status bar", just below that (unfortunately on the second page). Is there an option/possibility to show more menu items on bigger displays? All "new" options are global now. I would prefer to leave the code as a plugin. What would be the benefit in putting it into core? Maybe we should name the thing "Upper Status Bar", alternate seems a bit misleading (the one or the other). |
BUT (and I think @NiLuJe will agree), the status bar handling and its side effects on the footer, the page height, the top and bottom page margins are quite complicated. So, changing this logic and making all that possibly more consistent feels like quite a bit much more work than what you - and I - want to get into :)
Consistency, logic ? But actually: :/ I really don't feel confortable with all that code - and your plugin interaction with the document configurable / per document settings / bottom toggle menu toggle - but it feels like things are remote and there may be bad interaction - but may be it just works, dunno, dontwannano :) |
Sounds good. |
Not really "good", it just sounds like we/I were lazy and scary :)
I wrote the following before testing it - keeping it as it still apply (just a bit less strongly :) We could think about killing one or the other. Yes, it's not super nice - but this menu with items is not something one will go at modifying often. You play with it one day, decide what you like, and forget it. Then you enable it with the bottom menu (once, as global default) or per document - and forget it. And if this menu is to have only checkable items and don't change much of the existing behaviour and introduce no risk, it might as well be into core menus. Where, I still don't know :) but even if you made it a plugin, you forced the menu to show among the core menus and not in the Tools> menu where plugins usually are :) Follow up thought: it feels like all your plugin code could just fit in the currently really small frontend/apps/reader/modules/readercoptlistener.lua (at least, I wouldn't be shocked finding it in it :) as it already deals with the first set up of the top status bar: |
I think you are right, in order to fix this propery probably requires a deep dive into |
I understand :) but may be it isn't? |
from my quick read of I will take a deeper look a little later. |
I have killed the enable functionality in the menu and added an info-message. |
If everything works, I find it perfect and logical to have it here :) |
Should we increase the number of elements in the settings menu? If yes, should we increase it globally with |
I can already give you @poire-z's answer: no ;p. (I would tend to agree with him, btw ;)). |
:) But I don't think I would mind that much: I have limited to 5 the ones (Font, Typography language) that affect the text below, so there's room to see how it affects it. These are non-negotiable :) But I don't know. If when we add stuff, we need to increment max_per_page_default , we won't stop :) But this Alt status bar one does not feel like it should have the proeminence of the others: it's a little thingy that works only on half the books, and that most users don't use (well, so is probably night mode :) |
Yeah, +1 on moving it inside Status bar, that probably makes sense ;). |
Dunno if we yet have stuff that register/addToMainMenu that can plug into another module's menu :/ |
It can be inserted at the end with |
Yes, but don't we agree, that the "Alt status bar" should be the first entry in the "Status bar" menu? For future enhancements you can insist not to use "sorting_hint_top" if it is not consensus to do so? |
+1 inside Status bar, on the top, and separator after it |
I was thinking about having ReaderCoptListener:getAltStatusBarMenuItems(), and have ReaderFooter itself do, when it builds its own menu items: if self.ui.crelistener then
table.insert(mymenu, 1, self.ui.crelistener:getAltStatusBarMenuItems()
end But I'm also fine with the sorting_hint_top as it's not much added. |
Alternative to introduce
It would cost nothing, but might help future enhancements, dunno? |
NB The sorting hint thing is not intended as the primary method for positioning; that's what the menu order is for. The sorting hint provides some backwards compatibility to people with their customized menu order and a way for third-party plugin authors to hook in. So more flexibility there is welcome, but in "core" plugins it's only intended as a fallback. |
@poire-z: Isn't More transparent is the So I would go for |
No, that's too complicated and totally uneeded, we don't want 10 items more in reader_menu_order.lua.
Fine with me, but I don't know much about the menu order stuff and its spirit, so trusting @Frenzie thoughs on it.
Yes it is, but that's the kind of stuff we have lots in the code :) using stuff from other modules - and it makes kind of sense and explicit what we do: --- a/frontend/apps/reader/modules/readerfooter.lua
+++ b/frontend/apps/reader/modules/readerfooter.lua
@@ -1697,6 +1697,11 @@ function ReaderFooter:addToMainMenu(menu_items)
end
table.insert(sub_items, getMinibarOption("book_title"))
table.insert(sub_items, getMinibarOption("book_chapter"))
+
+ -- If using crengine, add Alt status bar items at top
+ if self.ui.crelistener then
+ table.insert(sub_items, 1, self.ui.crelistener:getAltStatusBarMenu())
+ end
end
--- a/frontend/apps/reader/modules/readercoptlistener.lua
+++ b/frontend/apps/reader/modules/readercoptlistener.lua
+-- Will be added by ReaderFooter at top of its "Status bar" menu
+function ReaderCoptListener:getAltStatusBarMenu()
+ return {
+ text = _("Alt status bar"),
+ separator = true,
+ sub_item_table = {
+ {
+ text = _("About alternate status bar"),
+ keep_menu_open = true,
+ callback = function()
+ UIManager:show(InfoMessage:new{
+ text = "blah",
+ })
+ end,
+ separator = true,
+ },
+ }
+ }
+end
+
return ReaderCoptListener |
@poire-z: Thank you for your help with roundabout :) |
function ReaderCoptListener:onSetFontSize(font_size) | ||
self.document.configurable.font_size = font_size | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hint for @yparitcher : looks like this event handler is just there to update the bottom menu state (the main handler is in ReaderFont).
So, at worst, add such stupid handlers in readercoptlistener.lua and readerkoptlistener.lua ?
(Althought I'm not sure why there is this one, and only this one :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is basically re implementing ConfigDialog
stuff in other places. If we go this route we should probably remove the configurable stuff from ConfigDialog
and have it done once, leaving the event as the source of truth.
Here you can set the items shown in the top status bar. | ||
|
||
The settings here will only affect CRE documents in page mode. | ||
|
||
The top status bar (per document or by default) has to be enabled in the bottom menu.]]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Improvising, to be corrected by @Frenzie:
On CRE documents only, an alt status bar can be displayed at top of screen, with or without the regular bottom status bar.
Enabling this alt status bar, per document or by default, can be done in the bottom menu.
You can set here which information this top status bar will show.
Works perfectly, thanks. Now we have different names for the same indicators in the Top and Bottom bars. Maybe it's better to unify? I'm not sure which ones are better though. |
I think we should take over the wording from the bottom bar. |
Yes, use the ones from the bottom bar, as they are all already translated. |
Hi all, I love the alternative status bar! I like using multiple bars to show more information. However, I found it super confusing that I enable the upper status bar with the bottom pop-up menu, but configure it with the normal upper menu. I know there's been a bit of conversation here about this already, but just my 2c. |
That's an interesting thought. After all, the footer is also completely configured from the top menu, so, murdering that bottom toggle with fire & brimstone and leaving everything to the top menu does make some kind of sense? |
@NiLuJe TBH when I read the release notes, I just went to the top menu, analogous to configuring the bottom status bar. That felt like more of a natural place for me. |
Yeah, the first menu item "About..." can be replaced with a checkbox "Enable..." to avoid the 2nd page |
Although the alternate status bar is not as smart as the lower one, I do like the status informations on top.
With this plugin the top bar can be configured.
This change is