Skip to content

set_theme does not change the theme. #1631

@wyhaya

Description

@wyhaya

Describe the bug

.with_theme(Theme::Dark)
// or
.set_theme(Theme::Dark)

Returned Ok(()), but nothing changed.

Steps To Reproduce

// winit example
let webview = WebViewBuilder::new()
      .with_url("https://tailwindcss.com/")
      .with_theme(Theme::Dark)
      .build_as_child(&window)
      .unwrap();

// or

let webview = self.webview.as_ref().unwrap();
webview.set_theme(Theme::Dark);

// We use `tailwindcss.com` for testing because it uses the auto theme.

Expected behavior

The theme should be updated and return Ok

Screenshots

theme.mov

Platform and Versions (please complete the following information):
OS: Windows 11, Windows 10
Rustc: 1.91.1

Additional context

This is a bug I found in Tauri. When I call app.setTheme, nothing happens, so I came here.

✅ macOS
✅ Linux
❌ Windows

I think it used to be good because it worked fine before, but I'm not sure when it broke.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions