MudBlazor / ThemeManager

ThemeManager built to showcase MudBlazor theming.
MIT License
203 stars 59 forks source link

Color picker keep show up #23

Open kamazheng opened 6 months ago

kamazheng commented 6 months ago

The color picker not hidden after color selected: (.Net 8)

@using MudBlazor.ThemeManager
@inherits LayoutComponentBase

<MudThemeProvider Theme="_themeManager.Theme" />
<MudDialogProvider />
<MudSnackbarProvider />
<MudThemeManagerButton OnClick="@((e) => OpenThemeManager(true))" />
<MudThemeManager Open="_themeManagerOpen" OpenChanged="OpenThemeManager" Theme="_themeManager" ThemeChanged="UpdateTheme" />
<MudDrawer @bind-Open="_themeManagerOpen" ClipMode="_themeManager.DrawerClipMode" Elevation="_themeManager.DrawerElevation"></MudDrawer>

<MudLayout>
    <MudAppBar Elevation="_themeManager.AppBarElevation">
        <MudIconButton Icon="@Icons.Material.Filled.Menu" Color="Color.Inherit" Edge="Edge.Start" OnClick="@((e) => DrawerToggle())" />
        <MudText Typo="Typo.h5" Class="ml-3">Application</MudText>
        <MudSpacer />
        <MudIconButton Icon="@Icons.Material.Filled.MoreVert" Color="Color.Inherit" Edge="Edge.End"/>
    </MudAppBar>
    <MudDrawer @bind-Open="_drawerOpen" ClipMode="DrawerClipMode.Always" Elevation="2">
        <NavMenu />
    </MudDrawer>
    <MudMainContent Class="mt-16 pa-4">
        @Body
    </MudMainContent>
</MudLayout>

@code {

    private ThemeManagerTheme _themeManager = new ThemeManagerTheme();
    public bool _themeManagerOpen = false;

    void OpenThemeManager(bool value)
    {
        _themeManagerOpen = value;
    }

    void UpdateTheme(ThemeManagerTheme value)
    {
        _themeManager = value;
        StateHasChanged();
    }

    protected override void OnInitialized()
    {
        StateHasChanged();
    }

    private bool _drawerOpen = true;

    private void DrawerToggle()
    {
        _drawerOpen = !_drawerOpen;
    }
}

image

ikingsbear commented 5 months ago

same problem,did you solve that problem?

Lonnewolf46 commented 5 months ago

Same issue here, Net .7 on WebAssembly project.

ikingsbear commented 5 months ago

收到你的Email了

henon commented 5 months ago

收到你的Email了

Please communicate in English, thanks.

viniciusmiguel commented 4 months ago

Same issue here, net 8, server side.

viniciusmiguel commented 4 months ago

I am looking into the code for a fix but it looks like this repository does not represent the nuget package being distributed anymore.

ScarletKuro commented 4 months ago

I am looking into the code for a fix but it looks like this repository does not represent the nuget package being distributed anymore.

I think the latest changes are in this branch: https://github.com/MudBlazor/ThemeManager/tree/hotfix. I'm not sure why, but I can see that the 1.0.9 version is present there. I don't think we have anyone currently maintaining this since it was previously handled by @Garderoben.

ScarletKuro commented 4 months ago

@henon maybe you want to merge the hotfix to main and remove the hotfix. Also I can add same CI/CD as I did for https://github.com/MudBlazor/MudBlazor.Icons but I don't have access to the settings of this repo at all

upd: nvm about merging, it looks pretty de-sync and the code in main was suppose to be the "new" theme manager, but it's pretty unfinished, so i guess just swap hotfix to be main and old main rename to "wip"?

henon commented 4 months ago

so i guess just swap hotfix to be main and old main rename to "wip"?

ok

ScarletKuro commented 4 months ago

upd: nvm about merging, it looks pretty de-sync and the code in main was suppose to be the "new" theme manager, but it's pretty unfinished, so i guess just swap hotfix to be main and old main rename to "wip"?

Swapped. Now the main code is located in the "main" branch, while the old main is renamed to "wip"

henon commented 4 months ago

Thanks a lot @ScarletKuro

ScarletKuro commented 4 months ago

Ok, I set up CI/CD and released version 1.1.0 with small improvements, like replacing async void with async Task. If someone wants to contribute, feel free to do so as it will be easier to deliver the changes now. Previously, someone with access had to manually upload the package, which was always delayed with no ETA.