Skip to content

Commit

Permalink
Merge pull request #39 from stan-donarise/master
Browse files Browse the repository at this point in the history
fix theme
  • Loading branch information
blokhin authored Jul 7, 2024
2 parents 220c325 + cc8ac94 commit ed72d02
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
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

0 comments on commit ed72d02

Please sign in to comment.