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

[Feature Request] Dark / Light Theme switch #396

Open
PerfectlyFineCode opened this issue Jul 27, 2024 · 0 comments
Open

[Feature Request] Dark / Light Theme switch #396

PerfectlyFineCode opened this issue Jul 27, 2024 · 0 comments
Labels
kind:enhancement New feature or request status:help-wanted This issue could use help from the external contributors

Comments

@PerfectlyFineCode
Copy link

I would love a light / dark switch in the preview to switch between the themes instead of having to explicitly define the theme in design by:

<Design.DesignStyle>
    <Style Selector="Window">
        <Setter Property="RequestedThemeVariant" Value="Dark" />
    </Style>
</Design.DesignStyle>

Example of how it could look

demo

@ForNeVeR ForNeVeR added kind:enhancement New feature or request status:help-wanted This issue could use help from the external contributors labels Jul 27, 2024
nirzaf added a commit to nirzaf/AvaloniaRider that referenced this issue Aug 22, 2024
Fixes ForNeVeR#396

Add a light/dark theme switch in the preview to switch between themes without explicitly defining the theme in design.

* **New Action Class**: Add `ToggleThemeAction` in `src/rider/main/kotlin/me/fornever/avaloniarider/idea/editor/actions/ToggleThemeAction.kt` to handle theme switching.
* **Toolbar Update**: Update `AvaloniaPreviewEditorBase` in `src/rider/main/kotlin/me/fornever/avaloniarider/idea/editor/AvaloniaPreviewEditorBase.kt` to include `ToggleThemeAction` in the toolbar.
* **Settings Update**: Modify `AvaloniaProjectSettings` in `src/rider/main/kotlin/me/fornever/avaloniarider/idea/settings/AvaloniaProjectSettings.kt` to include a new property `isDarkTheme` to store the current theme state.
* **Preview Image View Update**: Update `PreviewImageView` in `src/rider/main/kotlin/me/fornever/avaloniarider/idea/editor/PreviewImageView.kt` to use the `isDarkTheme` property from `AvaloniaProjectSettings` to determine the theme.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:enhancement New feature or request status:help-wanted This issue could use help from the external contributors
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants