@@ -6,7 +6,9 @@ use notation_bevy::prelude::{MarkDownAsset, KbPageId, KbPage, KbContent, KbPanel
66use notation_bevy:: prelude:: { NotationState , NotationAssets , NotationTheme } ;
77
88use notation_bevy:: kb:: markdown_page:: MarkDownPage ;
9+ use notation_bevy:: tab:: tab_control:: TabControl ;
910
11+ use crate :: guitar:: page:: GuitarPage ;
1012use crate :: theory:: scale:: ScalePage ;
1113use crate :: theory:: sound:: { SoundPage , SoundSection } ;
1214
@@ -17,6 +19,7 @@ pub struct IndexPanel {
1719 pub welcome : MarkDownPage ,
1820 pub sound : SoundPage ,
1921 pub scale : ScalePage ,
22+ pub guitar : GuitarPage ,
2023}
2124
2225impl Default for IndexPanel {
@@ -29,6 +32,7 @@ Caused by:
2932 In CommandEncoder::copy_buffer_to_texture
3033 Copy error
3134 copy of Y 0..256 would end up overruning the bounds of the Destination texture of Y size 128
35+ TODO: Check whether still needed after upgrade bevy and bevy_egui
3236 */
3337 skip_frames : 2 ,
3438
@@ -40,6 +44,7 @@ Caused by:
4044 welcome : MarkDownPage :: new ( Self :: PATH_WELCOME ) ,
4145 sound : SoundPage :: new ( Self :: PATH_SOUND ) ,
4246 scale : ScalePage :: new ( Self :: PATH_SCALE ) ,
47+ guitar : GuitarPage :: new ( Self :: PATH_GUITAR ) ,
4348 }
4449 }
4550}
@@ -48,13 +53,16 @@ impl IndexPanel {
4853 pub const WELCOME : KbPageId = KbPageId :: MarkDown ( Self :: PATH_WELCOME ) ;
4954 pub const SOUND : KbPageId = KbPageId :: Custom ( "sound" ) ;
5055 pub const SCALE : KbPageId = KbPageId :: Custom ( "scale" ) ;
56+ pub const GUITAR : KbPageId = KbPageId :: Custom ( "guitar" ) ;
5157
5258 pub const PATH_WELCOME : & ' static str = "kb/welcome.md" ;
5359 pub const PATH_SOUND : & ' static str = "kb/sound.md" ;
5460 pub const PATH_SCALE : & ' static str = "kb/scale.md" ;
61+ pub const PATH_GUITAR : & ' static str = "kb/guitar.md" ;
5562
5663 pub const LINK_SOUND : & ' static str = ":kb:sound" ;
5764 pub const LINK_SCALE : & ' static str = ":kb:scale" ;
65+ pub const LINK_GUITAR : & ' static str = ":kb:guitar" ;
5866 pub const LINK_SOUND_SINGLE_STRING : & ' static str = ":kb:sound:single_string" ;
5967
6068 pub const LINK_MIDI_PLAY : & ' static str = ":midi:play" ;
@@ -76,12 +84,14 @@ impl KbPanel for IndexPanel {
7684 ( Self :: WELCOME , "Welcome" ) ,
7785 ( Self :: SOUND , "Sound" ) ,
7886 ( Self :: SCALE , "Scale" ) ,
87+ ( Self :: GUITAR , "Guitar" ) ,
7988 ]
8089 }
8190 fn get_page_mut ( & mut self , page_id : KbPageId ) -> & mut dyn KbPage {
8291 match page_id {
8392 Self :: SOUND => & mut self . sound as & mut dyn KbPage ,
8493 Self :: SCALE => & mut self . scale as & mut dyn KbPage ,
94+ Self :: GUITAR => & mut self . guitar as & mut dyn KbPage ,
8595 _ => & mut self . welcome as & mut dyn KbPage ,
8696 }
8797 }
@@ -109,6 +119,7 @@ impl IndexPanel {
109119 state : Res < NotationState > ,
110120 mut theme : ResMut < NotationTheme > ,
111121 mut settings : ResMut < NotationSettings > ,
122+ index : Res < IndexPanel > ,
112123 ) {
113124 theme. sizes . melody . note_height = 8.0 ;
114125 theme. sizes . melody . semitone_height = 8.0 ;
@@ -122,8 +133,9 @@ impl IndexPanel {
122133 if state. window_width > state. window_height {
123134 let width = state. window_width / 3.0 + theme. sizes . layout . page_margin ;
124135 settings. hide_guitar_view = false ;
125- settings. override_guitar_width = Some ( width) ;
126136 settings. hide_chords_view = true ;
137+ settings. override_guitar_width = Some ( width) ;
138+ settings. layout . override_tab_width = None ;
127139 } else {
128140 settings. hide_guitar_view = true ;
129141 settings. hide_chords_view = false ;
0 commit comments