@@ -3,9 +3,10 @@ use crate::{
33 cmdbar:: CommandBar ,
44 components:: {
55 event_pump, CommandBlocking , CommandInfo , CommitComponent ,
6- Component , DrawableComponent , ExternalEditorComponent ,
7- HelpComponent , InspectCommitComponent , MsgComponent ,
8- ResetComponent , StashMsgComponent , TagCommitComponent ,
6+ Component , CreateBranchComponent , DrawableComponent ,
7+ ExternalEditorComponent , HelpComponent ,
8+ InspectCommitComponent , MsgComponent , ResetComponent ,
9+ StashMsgComponent , TagCommitComponent ,
910 } ,
1011 input:: { Input , InputEvent , InputState } ,
1112 keys:: { KeyConfig , SharedKeyConfig } ,
@@ -41,6 +42,7 @@ pub struct App {
4142 inspect_commit_popup : InspectCommitComponent ,
4243 external_editor_popup : ExternalEditorComponent ,
4344 tag_commit_popup : TagCommitComponent ,
45+ create_branch_popup : CreateBranchComponent ,
4446 cmdbar : RefCell < CommandBar > ,
4547 tab : usize ,
4648 revlog : Revlog ,
@@ -101,6 +103,11 @@ impl App {
101103 theme. clone ( ) ,
102104 key_config. clone ( ) ,
103105 ) ,
106+ create_branch_popup : CreateBranchComponent :: new (
107+ queue. clone ( ) ,
108+ theme. clone ( ) ,
109+ key_config. clone ( ) ,
110+ ) ,
104111 do_quit : false ,
105112 cmdbar : RefCell :: new ( CommandBar :: new (
106113 theme. clone ( ) ,
@@ -331,6 +338,7 @@ impl App {
331338 inspect_commit_popup,
332339 external_editor_popup,
333340 tag_commit_popup,
341+ create_branch_popup,
334342 help,
335343 revlog,
336344 status_tab,
@@ -459,6 +467,9 @@ impl App {
459467 InternalEvent :: TagCommit ( id) => {
460468 self . tag_commit_popup . open ( id) ?;
461469 }
470+ InternalEvent :: CreateBranch => {
471+ self . create_branch_popup . open ( ) ?;
472+ }
462473 InternalEvent :: TabSwitch => self . set_tab ( 0 ) ?,
463474 InternalEvent :: InspectCommit ( id, tags) => {
464475 self . inspect_commit_popup . open ( id, tags) ?;
@@ -527,6 +538,7 @@ impl App {
527538 || self . inspect_commit_popup . is_visible ( )
528539 || self . external_editor_popup . is_visible ( )
529540 || self . tag_commit_popup . is_visible ( )
541+ || self . create_branch_popup . is_visible ( )
530542 }
531543
532544 fn draw_popups < B : Backend > (
@@ -552,6 +564,7 @@ impl App {
552564 self . msg . draw ( f, size) ?;
553565 self . external_editor_popup . draw ( f, size) ?;
554566 self . tag_commit_popup . draw ( f, size) ?;
567+ self . create_branch_popup . draw ( f, size) ?;
555568
556569 Ok ( ( ) )
557570 }
0 commit comments