textbrowser / dooble

Dooble is a scientific browser. Minimal, cute, unusually stable, and available almost everyware. Completed?
https://textbrowser.github.io/dooble/
Other
475 stars 37 forks source link

Change brightness of pages. Makeup for clowns. #228

Closed Ygarr closed 2 months ago

Ygarr commented 4 months ago

suggest to reduce eyestrain/eyeblinding especially at night, as here for example: wbbrowsfx

textbrowser commented 4 months ago

This a solvable through a modern Linux distribution as some include Night Lights and environment adaptability and sometimes darkness forever mode.

So here's what you have.

https://doc.qt.io/qt-6/qtwebengine-features.html

textbrowser commented 4 months ago

If you see a mechanism there, we consider. If not, it'll be a non-portable, non-fantastic solution of toying with colors and alphas and maybe transparencies and highlight and lowlight and silly tweaks which will blind.

textbrowser commented 4 months ago

Meanwhile there are inexpensive glasses which dim life for you. Or timely pauses in computing activities. Yah.

Ygarr commented 4 months ago

inexpensive glasses which dim life :'-(

Ygarr commented 4 months ago

non-portable, non-fantastic solution Perhaps it is truly not reasonable to use inside browser logic to implement this feature. ChatGPT said it is better to use javascript (and css) with Qt6 WebEngine unlike in my example (browser on JavaFx..)

textbrowser commented 4 months ago

WebEngine does not include a means of accessing a page's scrollbars. One needs JS for scrolling in that world. Chat is glue-less.

textbrowser commented 4 months ago

GPT believes JS would solve the problem in WebEngine?

textbrowser commented 4 months ago

GPT is wrong with 100% confidence of being correct with itself. Is non-artificially ignorant.

textbrowser commented 4 months ago

hello-darkness-my-old-friend

textbrowser commented 4 months ago

Happy you are?

Ygarr commented 4 months ago

Happy you are? It looks like inverted colors. But. I think i wil be happy in our context anyway. Thank you for your labour

textbrowser commented 4 months ago

Is dark mode. And available in right now. See Settings. There may be a means of offsetting colors but I do not know of it and it requires special focus on the person because dimming is a specialized concept. You wish to dim a page and that page or tab and perhaps others.

textbrowser commented 4 months ago

The thing you have pictured is like a thin sheet of somewhat-transparent paper over the document. So a background color adjustment would not work. You need a mask on the document having an adjustable opacity. I think it can be done. Create a label or frame or a plain widget and allow you to set its opacity from 0.0 to 1.0. I don't know if it gets strange. I played with opacity in Glitch and is interfering with styles although this widget would be separate of the Web engine so perhaps is possible and nice. But then you ask for dimness on URLs and default dims and dimness on tabs.

textbrowser commented 4 months ago

The widget must be set with a z-value greater than the page's z-value and it must resize on resize events and must consider special progress widgets so it must be between those custom widgets and the document. Like a cake. Cake dimming.

Ygarr commented 4 months ago

I also think that enought just everywhere in "night mode" mute slightly. And muting is just change white colors to gray.

Of course, there may be different nuances for different people. Not everyone can be satisfied. But this is just my vision for this problem.

Note: In java code there was solution is: " // Apply brightness reduction effect directly in Java code ColorAdjust colorAdjust = new ColorAdjust(); colorAdjust.setBrightness(-0.3); // Adjust brightness level as needed currentWebView.setEffect(colorAdjust);"

In Qt WebEngine may be here: https://stackoverflow.com/questions/28183738/transparent-background-in-qwebenginepage Also if make brightness with JavaScript may be this: https://wiki.qt.io/QtWebEngine/ScriptsAndExtensions

textbrowser commented 4 months ago

I know that you can set the background color of a page. QColor includes darker() and lighter(). This is not a good solution. Setting a darker or lighter background isn't guaranteed to succeed because the page can ignore it even after it's been loaded. And the darkness or lightness of a color is applied to the background. The film you see in your picture is applied everywhere. Over elements, over text, over images, over input fields, over buttons, over films, over everything. This implies that there is a slim cake layer obfuscating the beneath layer. Clown makeup.

JS is also not a solution because it's gimmicky.

textbrowser commented 4 months ago

I think my mask idea will work but I will not have it super splendid initially. It will be 50% or so opaque with a View option for all pages. Later opacity configurable and then a setting to disable it at the page but not URL. And maybe a shortcut for instant darkness. See you or not.

textbrowser commented 4 months ago

Maybe this future release will introduce your request. So in 2024 best not procrastinate.

textbrowser commented 4 months ago

OK, not possible with stacked widgets because of complex keyboard and mouse events.

textbrowser commented 4 months ago

suggest to reduce eyestrain/eyeblinding especially at night, as here for example: wbbrowsfx

Can you interact with this page beyond scroll?

Ygarr commented 4 months ago

suggest to reduce eyestrain/eyeblinding especially at night, as here for example: ![wbbrowsfx](https://private-user- Can you interact with this page beyond scroll? well, seems yes, rather yes

textbrowser commented 2 months ago

I think I got it. A somewhat transparent widget placed on the Web page having transparent mouse events. I did this elsewhere. Perhaps.

textbrowser commented 2 months ago

Done! Percents in names.

textbrowser commented 2 months ago

50 25

textbrowser commented 2 months ago

I'll add an option somewhere to enable this. 25% of black is good?

textbrowser commented 2 months ago

Notice the mouse cursors in the pictures. Transparent for mouse events.

textbrowser commented 2 months ago

Completed? Maybe.

textbrowser commented 2 months ago

Now is done. See ya.