fortrangoingonforty/sniffly / da6bc7d

Browse files

add blue accent to open-dir button for empty tabs

Authored by espadonne
SHA
da6bc7d0f8401f58db4ac161282c1d34ab2e6e8b
Parents
54ad479
Tree
c3f679b

1 changed file

StatusFile+-
M src/gui/gtk_app.f90 22 2
src/gui/gtk_app.f90modified
@@ -81,6 +81,9 @@ module gtk_app
8181
   type(c_ptr), save :: open_finder_btn_ptr = c_null_ptr
8282
   type(c_ptr), save :: delete_btn_ptr = c_null_ptr
8383
 
84
+  ! Open directory button pointer (for pulsing on empty tabs)
85
+  type(c_ptr), save :: open_dir_btn_ptr = c_null_ptr
86
+
8487
   ! Drawing area pointer (for redrawing treemap)
8588
   type(c_ptr), save :: drawing_area_ptr = c_null_ptr
8689
 
@@ -139,6 +142,7 @@ contains
139142
     back_btn_ptr = c_null_ptr
140143
     forward_btn_ptr = c_null_ptr
141144
     cancel_scan_btn_ptr = c_null_ptr
145
+    open_dir_btn_ptr = c_null_ptr
142146
   end subroutine sniffly_app_quit
143147
 
144148
   ! Set the directory path to scan (call before sniffly_app_run)
@@ -170,6 +174,7 @@ contains
170174
     path_entry_ptr = c_null_ptr
171175
     back_btn_ptr = c_null_ptr
172176
     forward_btn_ptr = c_null_ptr
177
+    open_dir_btn_ptr = c_null_ptr
173178
     main_window_ptr = c_null_ptr
174179
 
175180
     ! Return FALSE (0) to allow the window to close
@@ -233,6 +238,7 @@ contains
233238
 
234239
     ! Create Open Directory button with folder icon
235240
     open_dir_btn = gtk_button_new()
241
+    open_dir_btn_ptr = open_dir_btn  ! Store for later access (pulsing on empty tabs)
236242
     call gtk_button_set_icon_name(open_dir_btn, "folder-open"//c_null_char)
237243
     call gtk_widget_set_tooltip_text(open_dir_btn, "Open Directory (Ctrl+O)"//c_null_char)
238244
     call g_signal_connect(open_dir_btn, "clicked"//c_null_char, &
@@ -896,12 +902,26 @@ contains
896902
     print *, "  Active tab index: ", active_tab_index
897903
     print *, "  Tab has_data: ", tab%has_data
898904
 
899
-    ! Only update if tab has data
905
+    ! Check if tab has data
900906
     if (.not. tab%has_data) then
901
-      print *, "  Tab has no data yet - skipping UI update"
907
+      print *, "  Tab has no data yet - showing empty tab UI"
908
+
909
+      ! Add blue suggested-action class to open-dir button to draw attention
910
+      if (c_associated(open_dir_btn_ptr)) then
911
+        call gtk_widget_add_css_class(open_dir_btn_ptr, "suggested-action"//c_null_char)
912
+      end if
913
+
914
+      ! Update status bar to guide user
915
+      call sniffly_update_status("No directory selected - click the folder icon to choose a directory")
916
+
902917
       return
903918
     end if
904919
 
920
+    ! Tab has data - remove suggested-action class from open-dir button
921
+    if (c_associated(open_dir_btn_ptr)) then
922
+      call gtk_widget_remove_css_class(open_dir_btn_ptr, "suggested-action"//c_null_char)
923
+    end if
924
+
905925
     ! Get the current view node
906926
     current_view => tab%current_view_node
907927
     if (.not. associated(current_view)) then