Git Product home page Git Product logo

Comments (36)

lucasfernog avatar lucasfernog commented on August 15, 2024 1

Oh but I should call that function right

from tauri.

lucasfernog avatar lucasfernog commented on August 15, 2024 1

Anyway we do need to bump boscop to 0.6.0, and put a color config under tauri.conf.json > tauri > window.

from tauri.

zserge avatar zserge commented on August 15, 2024 1

There was a color setting in the earlier webview, it was able to only set the color of the background main window (the webview itself is transparent). Maybe it wouldn't be hard to bring it back to the current webview (but please, no transparent windows - they are not supported on all platforms very well and make things really confusing).
The primary use case for that originally was to initialize window with some color before webview content loads up (so that for dark content there was no white flickering). And the reason why it has been removed from the new webview is becuase on Windows for example that didn't help much.
In my mind, the content you are running inside the webview is responsible for the background color and the rest of the "look-and-feel" of the webview, which is transparent by default on most platforms I guess.

from tauri.

nothingismagick avatar nothingismagick commented on August 15, 2024 1

@Laegel - this seems like something that we should address in the docs for now - that device themes can mess up if you don't explicitly declare a background color.

I guess here: https://tauri.studio/docs/usage/identity

Then when we finally move to the official webview via our bindings, color is supported there and we've added the flag to the config we can add that to our documentation as well.

from tauri.

lucasfernog avatar lucasfernog commented on August 15, 2024

What OS are you using? I'm sure that happens if you're using some kind of GTK theme, don't know if that's the case for you.

from tauri.

nothingismagick avatar nothingismagick commented on August 15, 2024

And what happens if you set a non transparent background color in your CSS, like for example white?

from tauri.

lucasfernog avatar lucasfernog commented on August 15, 2024

The original (I have the arc gtk theme, that's why it's kind of messed up):
2019-12-16_816x848_screenshot

With body{background:blue} CSS
2019-12-16_744x769_screenshot

from tauri.

nklayman avatar nklayman commented on August 15, 2024

Is there a way to override it? I don't think we should set color based on gtk theme.

from tauri.

lucasfernog avatar lucasfernog commented on August 15, 2024

Well, we're using GTK's webview, so I think we can't do anything.

from tauri.

nklayman avatar nklayman commented on August 15, 2024

Could we inject a stylesheet that sets it to white? I feel like your app should look the same as in a browser.

from tauri.

jbolda avatar jbolda commented on August 15, 2024

I think each browser has their own base stylesheet, but they aren't perfectly consistent.

from tauri.

tensor-programming avatar tensor-programming commented on August 15, 2024

This may have been resolved with some of the recent patches. I've noticed that the old react apps had a sort of grey background. Seems that they now are showing a white one instead.

from tauri.

nothingismagick avatar nothingismagick commented on August 15, 2024

@nklayman - can you confirm that @tensor-programming is right about this?

from tauri.

nklayman avatar nklayman commented on August 15, 2024

I still have the off-colored background.

from tauri.

lucasfernog avatar lucasfernog commented on August 15, 2024

I think we should file an issue about this on Boscop/web-view, maybe there's a C API to disable the theme. You can see that it's a theming issue by starting the app with another theme:

$ GTK_THEME=Adwaita:dark ./src-tauri/target/debug/app

from tauri.

nothingismagick avatar nothingismagick commented on August 15, 2024

have you tried with the latest 0.6 version of boscop - was just released a few days ago.

from tauri.

nothingismagick avatar nothingismagick commented on August 15, 2024

https://github.com/Boscop/web-view/blob/0ef21b66820965e3da7f7343565978174176db6a/webview-sys/webview_gtk.c#L186-L192

from tauri.

lucasfernog avatar lucasfernog commented on August 15, 2024

Same results with boscop/web-view 0.6.0

from tauri.

nothingismagick avatar nothingismagick commented on August 15, 2024

but we should def release a new version with boscop 0.6

from tauri.

lucasfernog avatar lucasfernog commented on August 15, 2024

set_color() works as expected (it sets the background color of the web-view) but GTK still uses the theme colors e.g. the font color is still the same obviously. So it doesn't help us much.

from tauri.

nothingismagick avatar nothingismagick commented on August 15, 2024

you know, maybe this is known. i looked at the examples at boscop, and it seems that they all have a background color set. ;)

from tauri.

lucasfernog avatar lucasfernog commented on August 15, 2024

IMO the GTK theme is the user's choice and we should leave it as is, if the app doesn't look good with the installed theme, he needs to set it manually.

from tauri.

nothingismagick avatar nothingismagick commented on August 15, 2024

def something for the docs. filing an issue at tauri.studio

from tauri.

nklayman avatar nklayman commented on August 15, 2024

Could we apply a default background-color:white to the body tag?

from tauri.

lucasfernog avatar lucasfernog commented on August 15, 2024

That won't fix the problem because the font color would still be messed up, as I said.

from tauri.

nklayman avatar nklayman commented on August 15, 2024

Ohh, my bad, didn't see that. I didn't have any font color issues so I thought it was just the background color.

from tauri.

lucasfernog avatar lucasfernog commented on August 15, 2024

If you use another GTK theme, you'll see different behaviors.

from tauri.

lucasfernog avatar lucasfernog commented on August 15, 2024

@nothingismagick the Windows theme also impacts the webview.

from tauri.

nothingismagick avatar nothingismagick commented on August 15, 2024

🤦‍♂

from tauri.

lucasfernog avatar lucasfernog commented on August 15, 2024

I'm not sure if this is good or bad news lol but we really need to look for a "disable theme" option upstream, if that's possible.

from tauri.

nothingismagick avatar nothingismagick commented on August 15, 2024

I bet @zserge knows how we could go about doing blocking that kind of behavior.

from tauri.

nothingismagick avatar nothingismagick commented on August 15, 2024

Isn't there or wasn't there a "color" flag?

from tauri.

Laegel avatar Laegel commented on August 15, 2024

Shouldn't we force it to white (the background color you can expect when you start working on a HTML app) and let users modify it optionally? Or is it going to be an issue even if we've defined an initial background color?

from tauri.

nklayman avatar nklayman commented on August 15, 2024

For some reason this is no longer an issue with Vue cli.

from tauri.

nothingismagick avatar nothingismagick commented on August 15, 2024

So close the issue?

from tauri.

nklayman avatar nklayman commented on August 15, 2024

Yep, just confirmed that the background is white.

from tauri.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.