@@ -608,7 +608,7 @@ impl ChewingTextService {
608608 unsafe {
609609 chewing_free ( ptr. cast ( ) ) ;
610610 }
611- self . show_message ( context, & text, Duration :: from_secs ( 2 ) ) ?;
611+ self . show_message ( context, & text, Duration :: from_millis ( 500 ) ) ?;
612612 }
613613
614614 Ok ( true )
@@ -648,7 +648,7 @@ impl ChewingTextService {
648648 CHINESE_MODE => HSTRING :: from ( "中文模式" ) ,
649649 _ => unreachable ! ( ) ,
650650 } ;
651- self . show_message ( context, & msg, Duration :: from_secs ( 2 ) ) ?;
651+ self . show_message ( context, & msg, Duration :: from_millis ( 500 ) ) ?;
652652 self . last_keydown_code = 0 ;
653653 return Ok ( true ) ;
654654 } else {
@@ -661,7 +661,7 @@ impl ChewingTextService {
661661 CHINESE_MODE => HSTRING :: from ( "中文模式" ) ,
662662 _ => unreachable ! ( ) ,
663663 } ;
664- self . show_message ( context, & msg, Duration :: from_secs ( 2 ) ) ?;
664+ self . show_message ( context, & msg, Duration :: from_millis ( 500 ) ) ?;
665665 self . last_keydown_code = 0 ;
666666 return Ok ( true ) ;
667667 }
@@ -677,7 +677,7 @@ impl ChewingTextService {
677677 CHINESE_MODE => HSTRING :: from ( "中文模式" ) ,
678678 _ => unreachable ! ( ) ,
679679 } ;
680- self . show_message ( context, & msg, Duration :: from_secs ( 2 ) ) ?;
680+ self . show_message ( context, & msg, Duration :: from_millis ( 500 ) ) ?;
681681 self . last_keydown_code = 0 ;
682682 return Ok ( true ) ;
683683 }
@@ -949,6 +949,9 @@ impl ChewingTextService {
949949 }
950950
951951 fn show_message ( & mut self , context : & ITfContext , text : & HSTRING , dur : Duration ) -> Result < ( ) > {
952+ if !self . cfg . show_notification {
953+ return Ok ( ( ) ) ;
954+ }
952955 unsafe {
953956 let view = context. GetActiveView ( ) ?;
954957 let hwnd = view. GetWnd ( ) ?;
@@ -966,7 +969,10 @@ impl ChewingTextService {
966969 message_window. set_font_color ( self . cfg . font_fg_color ) ;
967970 message_window. set_text ( text. clone ( ) ) ?;
968971
969- let rect = self . get_selection_rect ( context) ?;
972+ let mut rect = self . get_selection_rect ( context) ?;
973+ // TODO: bound the position to the screen
974+ rect. bottom += 50 ;
975+ rect. left += 50 ;
970976 message_window. r#move ( rect. left , rect. bottom ) ;
971977 message_window. show ( ) ;
972978
0 commit comments