@@ -258,14 +258,6 @@ private void OnLoaded(object sender, RoutedEventArgs _)
258258 }
259259 } ;
260260
261- // QueryTextBox.Text change detection (modified to only work when character count is 1 or higher)
262- QueryTextBox . TextChanged += ( s , e ) => UpdateClockPanelVisibility ( ) ;
263-
264- // Detecting ResultContextMenu.Visibility changes
265- DependencyPropertyDescriptor
266- . FromProperty ( VisibilityProperty , typeof ( ResultListBox ) )
267- . AddValueChanged ( ResultContextMenu , ( s , e ) => UpdateClockPanelVisibility ( ) ) ;
268-
269261 // Initialize query state
270262 if ( _settings . ShowHomePage && string . IsNullOrEmpty ( _viewModel . QueryText ) )
271263 {
@@ -317,7 +309,6 @@ private void OnDeactivated(object sender, EventArgs e)
317309 _settings . WindowLeft = Left ;
318310 _settings . WindowTop = Top ;
319311
320- _viewModel . ClockPanelOpacity = 0.0 ;
321312 _viewModel . SearchIconOpacity = 0.0 ;
322313
323314 // This condition stops extra hide call when animator is on,
@@ -903,46 +894,6 @@ private void InitProgressbarAnimation()
903894
904895 _viewModel . ProgressBarVisibility = Visibility . Hidden ;
905896 }
906-
907- private void UpdateClockPanelVisibility ( )
908- {
909- if ( QueryTextBox == null || ResultContextMenu == null || ClockPanel == null )
910- {
911- return ;
912- }
913-
914- // ✅ Conditions for showing ClockPanel (No query input / ResultContextMenu is closed)
915- var shouldShowClock = QueryTextBox . Text . Length == 0 &&
916- ResultContextMenu . Visibility != Visibility . Visible ;
917-
918- // ✅ 1. When ResultContextMenu opens, immediately set Visibility.Hidden (force hide without animation)
919- if ( ResultContextMenu . Visibility == Visibility . Visible )
920- {
921- _viewModel . ClockPanelVisibility = Visibility . Hidden ;
922- _viewModel . ClockPanelOpacity = 0.0 ; // Set to 0 in case Opacity animation affects it
923- return ;
924- }
925-
926- // ✅ 2. When ResultContextMenu is closed, keep it Hidden if there's text in the query (remember previous state)
927- else if ( QueryTextBox . Text . Length > 0 )
928- {
929- _viewModel . ClockPanelVisibility = Visibility . Hidden ;
930- _viewModel . ClockPanelOpacity = 0.0 ;
931- return ;
932- }
933-
934- // ✅ 3. Hide ClockPanel
935- if ( ( ! shouldShowClock ) && _viewModel . ClockPanelVisibility == Visibility . Visible )
936- {
937- _viewModel . ClockPanelVisibility = Visibility . Hidden ;
938- }
939-
940- // ✅ 4. Show ClockPanel
941- else if ( shouldShowClock && _viewModel . ClockPanelVisibility != Visibility . Visible )
942- {
943- _viewModel . ClockPanelVisibility = Visibility . Visible ;
944- }
945- }
946897 #endregion
947898
948899 #region QueryTextBox Event
0 commit comments