2121using  ISavable  =  Flow . Launcher . Plugin . ISavable ; 
2222using  System . IO ; 
2323using  System . Collections . Specialized ; 
24+ using  CommunityToolkit . Mvvm . Input ; 
2425
2526namespace  Flow . Launcher . ViewModel 
2627{ 
27-     public  class  MainViewModel  :  BaseModel ,  ISavable 
28+     public  partial   class  MainViewModel  :  BaseModel ,  ISavable 
2829    { 
2930        #region Private Fields
3031
@@ -82,6 +83,7 @@ public MainViewModel(Settings settings)
8283            _selectedResults  =  Results ; 
8384
8485            InitializeKeyCommands ( ) ; 
86+ 
8587            RegisterViewUpdate ( ) ; 
8688            RegisterResultsUpdatedEvent ( ) ; 
8789
@@ -154,6 +156,8 @@ private void RegisterResultsUpdatedEvent()
154156            } 
155157        } 
156158
159+ 
160+ 
157161        private  void  InitializeKeyCommands ( ) 
158162        { 
159163            EscCommand  =  new  RelayCommand ( _ => 
@@ -307,7 +311,7 @@ private void InitializeKeyCommands()
307311                            Notification . Show ( 
308312                                InternationalizationManager . Instance . GetTranslation ( "success" ) , 
309313                                InternationalizationManager . Instance . GetTranslation ( "completedSuccessfully" ) 
310-                                  ) ; 
314+                             ) ; 
311315                        } ) ,  TaskScheduler . Default ) 
312316                    . ConfigureAwait ( false ) ; 
313317            } ) ; 
@@ -318,9 +322,9 @@ private void InitializeKeyCommands()
318322        #region ViewModel Properties
319323
320324        public  ResultsViewModel  Results  {  get ;  private  set ;  } 
321-          
325+ 
322326        public  ResultsViewModel  ContextMenu  {  get ;  private  set ;  } 
323-          
327+ 
324328        public  ResultsViewModel  History  {  get ;  private  set ;  } 
325329
326330        public  bool  GameModeStatus  {  get ;  set ;  } 
@@ -336,6 +340,74 @@ public string QueryText
336340            } 
337341        } 
338342
343+ 
344+         public  double  Top 
345+         { 
346+             get  =>  _settings . WindowTop ; 
347+             set 
348+             { 
349+                 _settings . WindowTop  =  value ; 
350+                 OnPropertyChanged ( ) ; 
351+             } 
352+         } 
353+         public  double  Left 
354+         { 
355+             get  =>  _settings . WindowLeft ; 
356+             set 
357+             { 
358+                 _settings . WindowLeft  =  value ; 
359+                 OnPropertyChanged ( ) ; 
360+             } 
361+         } 
362+ 
363+         [ RelayCommand ] 
364+         private  void  IncreaseWidth ( ) 
365+         { 
366+             if  ( MainWindowWidth  +  100  >  1920  ||  _settings . WindowSize  ==  1920 ) 
367+             { 
368+                _settings . WindowSize  =  1920 ;         
369+             } 
370+             else  
371+             {  
372+                 _settings . WindowSize  +=  100 ; 
373+                 Left  -=  50 ; 
374+             } 
375+             OnPropertyChanged ( ) ; 
376+         } 
377+ 
378+         [ RelayCommand ] 
379+         private  void  DecreaseWidth ( ) 
380+         { 
381+             if  ( MainWindowWidth  -  100  <  400  ||  _settings . WindowSize  ==  400 ) 
382+             { 
383+                 _settings . WindowSize  =  400 ; 
384+             } 
385+             else 
386+             {  
387+                 Left  +=  50 ; 
388+                 _settings . WindowSize  -=  100 ; 
389+             } 
390+             OnPropertyChanged ( ) ; 
391+         } 
392+ 
393+         [ RelayCommand ] 
394+         private  void  IncreaseMaxResult ( ) 
395+         { 
396+             if  ( _settings . MaxResultsToShow  ==  17 ) 
397+                 return ; 
398+ 
399+             _settings . MaxResultsToShow  +=  1 ; 
400+         } 
401+ 
402+         [ RelayCommand ] 
403+         private  void  DecreaseMaxResult ( ) 
404+         { 
405+             if  ( _settings . MaxResultsToShow  ==  2 ) 
406+                 return ; 
407+ 
408+             _settings . MaxResultsToShow  -=  1 ; 
409+         } 
410+ 
339411        /// <summary> 
340412        /// we need move cursor to end when we manually changed query 
341413        /// but we don't want to move cursor to end when query is updated from TextBox 
@@ -411,7 +483,11 @@ private ResultsViewModel SelectedResults
411483
412484        public  Visibility  SearchIconVisibility  {  get ;  set ;  } 
413485
414-         public  double  MainWindowWidth  =>  _settings . WindowSize ; 
486+         public  double  MainWindowWidth 
487+         { 
488+             get  =>  _settings . WindowSize ; 
489+             set  =>  _settings . WindowSize  =  value ; 
490+         } 
415491
416492        public  string  PluginIconPath  {  get ;  set ;  }  =  null ; 
417493
@@ -592,7 +668,7 @@ private async void QueryResults()
592668                PluginIconPath  =  null ; 
593669                SearchIconVisibility  =  Visibility . Visible ; 
594670            } 
595-              
671+ 
596672
597673            if  ( query . ActionKeyword  ==  Plugin . Query . GlobalPluginWildcardSign ) 
598674            { 
@@ -903,18 +979,18 @@ public void ResultCopy(string stringToCopy)
903979
904980                        Clipboard . SetFileDropList ( paths ) ; 
905981                        App . API . ShowMsg ( 
906-                             App . API . GetTranslation ( "copy" )   
907-                                  + "  "  
908-                                  +  ( isFile ?  App . API . GetTranslation ( "fileTitle" )  :  App . API . GetTranslation ( "folderTitle" ) ) ,   
982+                             App . API . GetTranslation ( "copy" ) 
983+                             +  " "  
984+                             +  ( isFile   ?  App . API . GetTranslation ( "fileTitle" )  :  App . API . GetTranslation ( "folderTitle" ) ) , 
909985                            App . API . GetTranslation ( "completedSuccessfully" ) ) ; 
910986                    } 
911987                    else 
912988                    { 
913989                        Clipboard . SetDataObject ( copyText . ToString ( ) ) ; 
914990                        App . API . ShowMsg ( 
915-                             App . API . GetTranslation ( "copy" )   
916-                                  +  " "   
917-                                  +  App . API . GetTranslation ( "textTitle" ) ,   
991+                             App . API . GetTranslation ( "copy" ) 
992+                             +  " " 
993+                             +  App . API . GetTranslation ( "textTitle" ) , 
918994                            App . API . GetTranslation ( "completedSuccessfully" ) ) ; 
919995                    } 
920996                } 
0 commit comments