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

Sleep screen menu reworked #11549

Merged
merged 49 commits into from
Apr 8, 2024
Merged

Conversation

Commodore64user
Copy link
Contributor

@Commodore64user Commodore64user commented Mar 14, 2024

This PR brings a complete make over to the Lock Screen, currently know as 'screensaver' menu.

NO changes have been made to functionality, this is a strictly cosmetic but comprehensive update.

The following image, showcases the new arrangement of the menu: most names have been changed for ease of use but again no changes to back end code (you can see that though).

Book1.pdf

Regarding "Hide reboot/poweroff Message", what the **ck does that do? I have never seen such a message and I don't have that selected. Anyway, I was not be able to place it correctly, so please let me know so it can be moved (if needed) to the appropriate place.

Regarding the newly named "background fill" option, could someone please help me make it so that is greyed out when both conditions ('Lock the screen in current state' and 'Add Lock screen message') are not met...

I made these changes because, honestly, the top menu is like the Wild West, if anyone else is happy and on board, I could work on renaming and rearranging the whole top menu in a much more cohesive way.

Blimey, this took a lot longer than I expected... 🤓


This change is Reviewable

@poire-z
Copy link
Contributor

poire-z commented Mar 14, 2024

Regarding the newly named "background fill" option, could someone please help me make it so that is greyed out when both conditions ('Lock the screen in current state' and 'Add Lock screen message') are not met...

You need to stick a enabled_func = function() similar to the checked_func() you've seen.
(Dunno/haven't checked if enabled_func works on a menu item with a submenu though.)

Regarding "Hide reboot/poweroff Message", what the **ck does that do? I have never seen such a message and I don't have that selected.

Haven't looked at the code, but I would assume it puts the additional messages "powered off" / "rebooting" on top of any screensaver (or only some?) when powering off or rebooting :) and maybe only when there is no custom message set (because the setting is named screensaver_hide_fallback_msg) ?

I could work on renaming and rearranging the whole top menu in a much more cohesive way.

Please tell us before what you have in mind, so the shock is less harsh when one of us will see you have completely thrown out these little menu bits we had crafted with love years ago.

@Frenzie
Copy link
Member

Frenzie commented Mar 14, 2024

I made these changes because, honestly, the top menu is like the Wild West, if anyone else is happy and on board, I could work on renaming and rearranging the whole top menu in a much more cohesive way.

That's a slightly hurtful statement. :-) The top menu does have a cohesive vision. Some remote parts like the screensaver menu might fall outside that vision to some extent, perhaps mainly because of sabotage, better known as welcome user contributions.[1] This PR actually brings it in line with how it's supposed to be, although it's also attempting some sabotage in the form of capitalization. ;-)

As @poire-z said, we'd definitely prefer to discuss changes first to discuss various rationales and solutions to problems.

[1] This is why screenshots are important, and perhaps I should insist on them more even if I already feel like a big nag about it, and your PDF is great! It fulfills the same role: seeing the visual/organizational impact at a glance, rather than obscured by code. That also immediately opens it up for comments by people who can't test the code quite as easily for various reasons.

@Commodore64user
Copy link
Contributor Author

First and foremost, I'm sorry to everyone as I am really not trying to hurt anyones feelings here.

Please tell us before what you have in mind, so the shock is less harsh when one of us will see you have completely thrown out these little menu bits we had crafted with love years ago.

My idea, was to make a tree like the one in the pdf before actually making any changes. I worked in this Lock Screen menu as it was in desperate need and, to use it as a portfolio to sell you all the idea of a 'koreader utopia'. 😅

Some remote parts like the screensaver menu might fall outside that vision to some extent, perhaps mainly because of sabotage, better known as welcome user contributions.[1] This PR actually brings it in line with how it's supposed to be, although it's also attempting some sabotage in the form of capitalization. ;-)

I understand that, one person does something today, another one adds something tomorrow and suddenly things can get a bit... tangled; It is the nature of open source, both its power and weakness. Nevertheless, I am grateful to everyone who contributes to make it better.

[1] This is why screenshots are important, and perhaps I should insist on them more even if I already feel like a big nag about it, and your PDF is great! It fulfills the same role: seeing the visual/organizational impact at a glance, rather than obscured by code.

This right here is true, the reason for not having screenshots is thus: I am running this on a kindle 4 and I could not figure out how to take screenshots on it, the method Amazon uses (press keyboard and menu keys at the same time) does not appear to work when koreader is running, so we were left just with the tree.

If one of you wants to run it on your emulator and grab them, it would be highly appreciated.

@yparitcher
Copy link
Member

+1 for screensaver not lock screen

@Commodore64user
Copy link
Contributor Author

So everyone is on the same page, the tree goes like this:

cog > screen > lock screen > screensaver

in this context, lock screen refers to the whole screen whilst the e-reader is… locked. The lock screen includes two items, the screen saver (i.e the image) and a custom message. Both things cannot be called the same thing, as they are not the same thing.

@Frenzie
Copy link
Member

Frenzie commented Mar 14, 2024

This right here is true, the reason for not having screenshots is thus

No no, like I said, your alternative works just as well! :-D I'm just trying to explain it's a major contributor to missing changes that wouldn't slip by otherwise, particularly in hidden corners.

in this context, lock screen refers to the whole screen whilst the e-reader is… locked. The lock screen includes two items, the screen saver (i.e the image) and a custom message. Both things cannot be called the same thing, as they are not the same thing.

Other menus have resolved that as for example FontFont settings.

@Commodore64user
Copy link
Contributor Author

Other menus have resolved...

You Dare Use My Own Spells Against Me? I jest, point is, remember when I said the menu was like the Wild West? let me give you a few examples:

page with bookmark > Bookmarks and page with bookmark > Settings > Bookmarks
two menus with the same name. I know how they work, but two things should never have the same name.

here's another one
magnifying glass > Settings, page with bookmark > Settings, cog > status bar > Settings.
I rest my case.

I don't understand why everyone is so appalled by the term 'Lock Screen' when that is what that screen is, according to the OED, Lock Screen is defined as: (a) Computing. a process or command which temporarily disables the visual interface of a computer; (b) a display screen which replaces the usual visual interface of a device, limiting its functionality until a password or code is entered.

@yparitcher
Copy link
Member

As there is no password or code needed I see it as a screensaver not a lock screen as in cog > screen > screensaver
under screensaver i would have 1. image (what you call screensaver) (I would also merge custom image here) 2. delay 3. message.

And as the OED puts it: screensaver, A piece of software which, after a set period of inactivity, automatically reduces screen brightness to zero or replaces whatever is displayed on the screen with an (animated or changing) image or a blank screen; an image or graphics sequence displayed by such a program.

@Commodore64user
Copy link
Contributor Author

Commodore64user commented Mar 14, 2024

well the definition of Lock Screen has two parts, @yparitcher you seem to have completely ignored the first one. and regarding part two, just because a door lock is not in its locked position, does not make it, not a door lock. The screen is lock until the 'unlock' button is pressed.

you also forgot to add this bit: Screensavers were originally used to prevent damage to the screen, which could be caused by displaying a static image for an extended period of time, which I find kind of ironic because well... we are displaying a static image. But this is more a fun fact, not an argument to sustain my lock screen position.

Edit:

(I would also merge custom image here)

I am not making changes to functionality, if you would like to contribute with the code, feel free to paste here and I'll happily add it.
And no, message does not go there, sorry. you are just describing the mess from before.

@Frenzie
Copy link
Member

Frenzie commented Mar 14, 2024

You Dare Use My Own Spells Against Me? I jest, point is, remember when I said the menu was like the Wild West? let me give you a few examples:

page with bookmark > Bookmarks and page with bookmark > Settings > Bookmarks two menus with the same name. I know how they work, but two things should never have the same name.

One is by design, the other is arguably something that slipped by in some manner. As stated, some parts will be slightly inconsistent for some reason or another. I don't think this is quite as inconsistent as you claim, but I would indeed prefer to also name it "Bookmark settings".

The screen is lock until the 'unlock' button is pressed.

But there is no lock. It's just a screensaver.

@Frenzie
Copy link
Member

Frenzie commented Mar 14, 2024

I don't think this is quite as inconsistent as you claim

Concretely, ScreensaverScreensaver would be silly.

But:

  • Bookmarks
  • Settings (same level as bookmarks) → Bookmarks

Is not abiding by the current (post-2017ish) design, but it's not inherently silly.

Sentence case added
if G_reader_settings:isTrue("screensaver_stretch_images") and percentage then
return T(_("Stretch to fit screen (with limit: %1 %)"), percentage)
end
return _("Stretch cover to fit screen")
Copy link
Contributor

Choose a reason for hiding this comment

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

(When playing, I was expecting that enabling this one, the 3 others (Black/White/Current) would be disabled. But no, they can still be enabled, and may have some effect because of the stretching % limit.)

frontend/ui/elements/screensaver_menu.lua Outdated Show resolved Hide resolved
frontend/ui/elements/screensaver_menu.lua Outdated Show resolved Hide resolved
frontend/ui/elements/screensaver_menu.lua Outdated Show resolved Hide resolved
Comment on lines 148 to 153
text = _("Background fill"),
help_text = _([[This option will only become available, if you have selected 'Put screen to sleep in current state'
as screensaver and have 'Sleep screen message' on.]]),
enabled_func = function()
return G_reader_settings:readSetting("screensaver_type") == "disable" and G_reader_settings:isTrue("screensaver_show_message")
end,
Copy link
Contributor

Choose a reason for hiding this comment

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

Genuine experience with this:
I was testing things and I didn't manage to get this menu enabled. Until I read that help_text.
I was naively expecting that background mentionned here is the background of the InfoMessage (white text on black, or black text on a white background color). But it is the background of the full screen, that we may indeed want it fill instead of "Leave screen as-is". But then, we're not letting "screen as-is" :)
I would somehow expect setting the full screen background to white or black to be inside the Wallpaper>: setting a fully unicolor wallpaper.
But may be it's technically more complicated - so, really not caring, just mentionning my first time experience.

Copy link
Contributor

Choose a reason for hiding this comment

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

Indentation issue here too. Better checks elsewhere too.

Copy link
Member

Choose a reason for hiding this comment

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

I suspect this problem (the logic, not the indentation) was already there?

Copy link
Contributor

Choose a reason for hiding this comment

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

May be. But the wording (and may be the absence of any enabled_func) made it less surprising:
image

frontend/ui/elements/screensaver_menu.lua Outdated Show resolved Hide resolved
@@ -43,7 +42,6 @@ return {
enabled_func = function()
return G_reader_settings:readSetting("screensaver_type") == "cover"
or G_reader_settings:readSetting("screensaver_type") == "random_image"
or G_reader_settings:readSetting("screensaver_type") == "image_file"
Copy link
Contributor

Choose a reason for hiding this comment

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

You are removing all references to G_reader_settings:readSetting("screensaver_type") possible being "image_file".
What will happen to people who have it set as "image_file"?
Does it need a migration?
And I would rather keep image_file (which I think more people may use) than document_cover.

frontend/ui/elements/screensaver_menu.lua Outdated Show resolved Hide resolved
@@ -463,6 +467,7 @@ function Screensaver:setup(event, event_message)
self.screensaver_type = "random_image"
end
end
-- NB Kept around to support old settings.
Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, ok, this is our way to not migrate it. Fine.

Copy link
Member

Choose a reason for hiding this comment

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

I could do it the other way if you prefer.

Copy link
Contributor

Choose a reason for hiding this comment

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

No real preference.
I guess that if an image is indeed a document, we can set that document as the sleep screen.
While having an EPUB or PDF set as "image_file" would feel more odd.

It's just that we'll mostly use it with images, and setting that image (a document)'s cover feels stranger mentionning a non-image document's cover.

@Frenzie
Copy link
Member

Frenzie commented Apr 8, 2024

I added a migration. It can migrate in reverse if you prefer.

@poire-z
Copy link
Contributor

poire-z commented Apr 8, 2024

I added a migration. It can migrate in reverse if you prefer.

Again, no real preference. Fine with me as-is. Trusting you on all the logic.

@Frenzie Frenzie merged commit 279f16a into koreader:master Apr 8, 2024
2 of 3 checks passed
@Frenzie
Copy link
Member

Frenzie commented Apr 8, 2024

Thanks for all the work @Commodore64user!

@Commodore64user
Copy link
Contributor Author

You didn’t actually merge that: ‘Delay screen update after wake-up‘, are you serious?

you did a lot of work too so thanks @Frenzie

@Commodore64user Commodore64user deleted the Lock-Screen-menu branch April 8, 2024 21:17
@Commodore64user
Copy link
Contributor Author

@Frenzie there is still one instance of "screensaver"... and that ridiculous name from hell

@Frenzie
Copy link
Member

Frenzie commented Apr 8, 2024

Where does it say screensaver?

Frenzie added a commit to Frenzie/koreader that referenced this pull request Apr 8, 2024
…/plural

Concretely 1 second, %1 seconds since koreader#11549 added `1 second` all by itself.
@Commodore64user
Copy link
Contributor Author

there

help_text = _("This option will only become available, if you have selected 'Leave screen as-is' as screensaver and have 'Sleep screen message' on."),

text = _("Delay screen update after wake-up"),

@Frenzie
Copy link
Member

Frenzie commented Apr 8, 2024

wake-up screen delay which is grammatically correct, for perspective, if you have a wake up alarm set to 7 am on weekdays and delayed by one hour on weekends, you don’t have an “alarm wake-up delay” on Saturdays.

The problem with this reasoning is that it's like saying he ran up the hill yesterday is grammatically correct when he'll run up the hill tomorrow.

The correct analogy is that you might indeed have an eye opening delay after waking up on a Saturday.

Frenzie added a commit that referenced this pull request Apr 9, 2024
…/plural (#11643)

Concretely 1 second, %1 seconds since #11549 added `1 second` all by itself.
This was referenced May 8, 2024
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.

None yet

7 participants