Browse Source

Explorer interface view style toolbar button now shows icon for the current style, instead of the next style

Source commit: cf5ccf2a114e7e77fa53248861f5c25a93817d22
Martin Prikryl 1 year ago
parent
commit
4b85233168
1 changed files with 4 additions and 2 deletions
  1. 4 2
      source/forms/NonVisual.cpp

+ 4 - 2
source/forms/NonVisual.cpp

@@ -267,8 +267,10 @@ void __fastcall TNonVisualDataModule::ExplorerActionsUpdate(
   UPD(RemoteSelectAllAction2, DirView(osRemote)->FilesCount)
 
   //style
-  UPDACT(RemoteCycleStyleAction,
-    RemoteCycleStyleAction->ImageIndex = 8 + (DirView(osRemote)->DirViewStyle + 1) % 4)
+  #define STYLEIMAGE(STYLE) Style == dvs ## STYLE ? Remote ## STYLE ## Action->ImageIndex :
+  UPDACT(RemoteCycleStyleAction, int Style = DirView(osRemote)->DirViewStyle;
+    RemoteCycleStyleAction->ImageIndex = (STYLEIMAGE(Icon) STYLEIMAGE(SmallIcon) STYLEIMAGE(List) STYLEIMAGE(Report) RemoteIconAction->ImageIndex))
+  #undef STYLEIMAGE
   #define STYLEACTION(SIDE, STYLE) UPDACT(SIDE ## STYLE ## Action, \
     SIDE ## STYLE ## Action->Checked = (DirView(os ## SIDE)->DirViewStyle == dvs ## STYLE))
   STYLEACTION(Remote, Icon)