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

fix theme #39

Merged
merged 2 commits into from
Jul 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion player/player.view.tree
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ $optimade_cifplayer_player $mol_view
<= Theme $mol_theme_auto
-
auto /
<= external_theme_auto null
<= dir_light null
<= ambient_light null
^ atom_boxes /
Expand Down Expand Up @@ -104,7 +105,7 @@ $optimade_cifplayer_player $mol_view
<= Zoom_down $mol_button_minor
click? <=> zoom_down? null
sub / <= Zoom_down_icon $mol_icon_magnify_minus_outline
<= Lights $mol_lights_toggle
^ lights_toggle / <= Lights $mol_lights_toggle
<= Overlays $mol_view
sub <= overlays_sub /
<= Switch_overlay $mol_switch
Expand Down
13 changes: 11 additions & 2 deletions player/player.view.web.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,17 @@ namespace $.$$ {

export class $optimade_cifplayer_player extends $.$optimade_cifplayer_player {

theme() {
return '$mol_theme_' + (this.externals()?.theme || 'dark')
@ $mol_mem
external_theme_auto() {
const external = this.externals()?.theme
if( !external ) return

this.$.$mol_lights( external == 'light' ? true : false )
}

@ $mol_mem
lights_toggle() {
return this.externals()?.theme ? [] : super.lights_toggle()
}

@ $mol_mem
Expand Down
Loading