summaryrefslogtreecommitdiff
path: root/freefilesync/debian/patches/ffs_traditional_view.patch
blob: 5be22444fb5d49302e12c1f07137d898e68f9498 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
diff -x '.git*' -x '*.rej' -x '*.orig' -aur 11.2-2/FreeFileSync/Source/ui/file_grid.cpp 11.2-1-trad1/FreeFileSync/Source/ui/file_grid.cpp
--- 11.2-2/FreeFileSync/Source/ui/file_grid.cpp	2020-10-02 14:39:05.289463269 -0400
+++ 11.2-1-trad1/FreeFileSync/Source/ui/file_grid.cpp	2020-10-02 18:53:42.872947053 -0400
@@ -448,6 +448,7 @@
                             case ItemPathFormat::relative:
                                 return utfTo<std::wstring>(fsObj->getRelativePath<side>());
                             case ItemPathFormat::full:
+                            case ItemPathFormat::traditional:
                                 return AFS::getDisplayPath(fsObj->getAbstractPath<side>());
                         }
                         assert(false);
@@ -628,6 +629,16 @@
                 else //=> BaseFolderPair
                     groupParentFolder = AFS::getDisplayPath(pdi.fsObj->base().getAbstractPath<side>());
                 break;
+            case ItemPathFormat::traditional:
+                if (auto groupFolder = dynamic_cast<const FolderPair*>(pdi.folderGroupObj))
+                {
+                    groupName = utfTo<std::wstring>(groupFolder->template getItemName<side>());
+                    groupParentFolder = AFS::getDisplayPath(groupFolder->parent().template getAbstractPath<side>()) + \
+                        FILE_NAME_SEPARATOR + utfTo<std::wstring>(groupFolder->template getItemName<side>());
+                }
+                else //=> BaseFolderPair
+                    groupParentFolder = AFS::getDisplayPath(pdi.fsObj->base().getAbstractPath<side>());
+                break;
         }
 
         //path components should follow the app layout direction and are NOT a single piece of text!
@@ -655,6 +666,20 @@
         int widthGroupName   = groupName        .empty() ? 0 : (iconSize + gridGap_ + getTextExtentBuffered(dc, groupName).x + 2 * gridGap_);
         int widthGroupItems  = widthGroupSep + (drawFileIcons ? iconSize + gridGap_ : 0) + groupItemNamesWidth;
 
+        // start trad patch
+        switch (itemPathFormat_)
+        {
+            case ItemPathFormat::traditional:
+                //widthGroupName = 0;
+                widthGroupParent -= widthGroupName ;
+                break;
+            case ItemPathFormat::name:
+            case ItemPathFormat::relative:
+            case ItemPathFormat::full:
+            default:
+                // the insane logic of the new views
+                // but preserve the original tabbing, to make the patch easier.
+
         //not enough space? => collapse
         if (int excessWidth = gridGap_ + widthGroupParent + widthGroupName + widthGroupItems - maxWidth;
             excessWidth > 0)
@@ -725,6 +750,11 @@
             }
         }
 
+                // end of original section, and back to the trad patch!
+                break;
+        }
+        // and end the addition for trad patch
+
         return
         {
             itemName,
@@ -793,6 +823,9 @@
                     rectGroup = rectGroupParent = rectGroupName = rectTmp;
 
                     rectGroupParent.width = widthGroupParent;
+                    // re-add back the width of groupname so that the directory name is clickable
+                    if (itemPathFormat_ == ItemPathFormat::traditional)
+                        rectGroupParent.width += widthGroupName;
                     rectGroupName  .width = widthGroupName;
 
                     if (stackedGroupRender)
@@ -844,7 +877,7 @@
                             dc.GradientFillLinear(rectNav, getColorSelectionGradientFrom(), backCol, wxEAST);
                         }
 
-                        if (!groupName.empty() && row == groupFirstRow)
+                        if (!(itemPathFormat_ == ItemPathFormat::traditional) && !groupName.empty() && row == groupFirstRow)
                         {
                             wxDCTextColourChanger textColorGroupName(dc);
                             if (static_cast<HoverAreaGroup>(rowHover) == HoverAreaGroup::groupName)
@@ -865,9 +898,9 @@
                             drawCellText(dc, rectGroupName, groupName, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL, &getTextExtentBuffered(dc, groupName));
                         }
 
-                        if (!groupParentFolder.empty() &&
+                        if (itemPathFormat_ == ItemPathFormat::traditional || (!groupParentFolder.empty() &&
                             (( stackedGroupRender && row == groupFirstRow + 1) ||
-                             (!stackedGroupRender && row == groupFirstRow)))
+                             (!stackedGroupRender && row == groupFirstRow))))
                         {
                             drawCellText(dc, rectGroupParent, groupParentFolder, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL, &getTextExtentBuffered(dc, groupParentFolder));
                         }
@@ -1040,6 +1073,8 @@
                         return _("Relative path");
                     case ItemPathFormat::full:
                         return _("Full path");
+                    case ItemPathFormat::traditional:
+                        return _("Traditional");
                 }
                 assert(false);
                 break;
diff -x '.git*' -x '*.rej' -x '*.orig' -aur 11.2-2/FreeFileSync/Source/ui/file_grid_attr.h 11.2-1-trad1/FreeFileSync/Source/ui/file_grid_attr.h
--- 11.2-2/FreeFileSync/Source/ui/file_grid_attr.h	2020-10-02 14:39:05.313463564 -0400
+++ 11.2-1-trad1/FreeFileSync/Source/ui/file_grid_attr.h	2020-10-02 15:28:20.378038432 -0400
@@ -79,6 +79,7 @@
     name,
     relative,
     full,
+    traditional,
 };
 
 const ItemPathFormat defaultItemPathFormatLeftGrid  = ItemPathFormat::relative;
diff -x '.git*' -x '*.rej' -x '*.orig' -aur 11.2-2/FreeFileSync/Source/ui/main_dlg.cpp 11.2-1-trad1/FreeFileSync/Source/ui/main_dlg.cpp
--- 11.2-2/FreeFileSync/Source/ui/main_dlg.cpp	2020-10-02 18:54:21.781435371 -0400
+++ 11.2-1-trad1/FreeFileSync/Source/ui/main_dlg.cpp	2020-10-02 15:28:20.382038482 -0400
@@ -2710,6 +2710,7 @@
     addFormatEntry(_("Item name"    ), ItemPathFormat::name);
     addFormatEntry(_("Relative path"), ItemPathFormat::relative);
     addFormatEntry(_("Full path"    ), ItemPathFormat::full);
+    addFormatEntry(_("Traditional"  ), ItemPathFormat::traditional);
 
     //----------------------------------------------------------------------------------------------
     menu.addSeparator();
diff -x '.git*' -x '*.rej' -x '*.orig' -aur 11.2-2/FreeFileSync/Source/config.cpp 11.2-1-trad1/FreeFileSync/Source/config.cpp
--- 11.2-2/FreeFileSync/Source/config.cpp	2020-10-02 14:39:05.233462578 -0400
+++ 11.2-1-trad1/FreeFileSync/Source/config.cpp	2020-10-02 15:28:20.382038482 -0400
@@ -528,6 +528,9 @@
         case ItemPathFormat::full:
             output = "Full";
             break;
+        case ItemPathFormat::traditional:
+            output = "Traditional";
+            break;
     }
 }
 
@@ -541,6 +544,8 @@
         value = ItemPathFormat::relative;
     else if (tmp == "Full")
         value = ItemPathFormat::full;
+    else if (tmp == "Traditional")
+        value = ItemPathFormat::traditional;
     else
         return false;
     return true;
diff -x '.git*' -x '*.rej' -x '*.orig' -aur 11.2-2/FreeFileSync/Source/ui/file_view.cpp 11.2-1-trad1/FreeFileSync/Source/ui/file_view.cpp
--- 11.2-2/FreeFileSync/Source/ui/file_view.cpp	2020-10-02 14:39:05.305463465 -0400
+++ 11.2-1-trad1/FreeFileSync/Source/ui/file_view.cpp	2020-10-02 15:28:20.386038532 -0400
@@ -803,6 +803,7 @@
                     break;
 
                 case ItemPathFormat::full:
+                case ItemPathFormat::traditional:
                     if      ( ascending &&  onLeft) std::sort(sortedRef_.begin(), sortedRef_.end(), LessFullPath<true,   LEFT_SIDE>(folderPairs_));
                     else if ( ascending && !onLeft) std::sort(sortedRef_.begin(), sortedRef_.end(), LessFullPath<true,  RIGHT_SIDE>(folderPairs_));
                     else if (!ascending &&  onLeft) std::sort(sortedRef_.begin(), sortedRef_.end(), LessFullPath<false,  LEFT_SIDE>(folderPairs_));
bgstack15