summaryrefslogtreecommitdiff
path: root/freefilesync/debian/patches/ffs_traditional_view.patch
diff options
context:
space:
mode:
Diffstat (limited to 'freefilesync/debian/patches/ffs_traditional_view.patch')
-rw-r--r--freefilesync/debian/patches/ffs_traditional_view.patch118
1 files changed, 52 insertions, 66 deletions
diff --git a/freefilesync/debian/patches/ffs_traditional_view.patch b/freefilesync/debian/patches/ffs_traditional_view.patch
index 173842f..ff78325 100644
--- a/freefilesync/debian/patches/ffs_traditional_view.patch
+++ b/freefilesync/debian/patches/ffs_traditional_view.patch
@@ -1,7 +1,11 @@
-diff -x '.git*' -x '*.orig' -x '*.rej' -aur 11.2-1/FreeFileSync/Source/ui/file_grid.cpp 11.2-1-trad3/FreeFileSync/Source/ui/file_grid.cpp
---- 11.2-1/FreeFileSync/Source/ui/file_grid.cpp 2020-10-02 14:39:05.289463269 -0400
-+++ 11.2-1-trad3/FreeFileSync/Source/ui/file_grid.cpp 2020-10-02 20:48:25.047194116 -0400
-@@ -446,8 +446,10 @@
+Version: 11.3
+Date: 2020-11-01
+Author: bgstack15@gmail.com
+Message: restore a traditional view to FreeFileSync
+diff -x '*.orig' -x '*.rej' -aur 11.3-0/FreeFileSync/Source/ui/file_grid.cpp 11.3-1/FreeFileSync/Source/ui/file_grid.cpp
+--- 11.3-0/FreeFileSync/Source/ui/file_grid.cpp 2020-11-01 17:14:27.531500950 -0500
++++ 11.3-1/FreeFileSync/Source/ui/file_grid.cpp 2020-11-01 22:52:14.590746142 -0500
+@@ -493,8 +493,10 @@
case ItemPathFormat::name:
return utfTo<std::wstring>(fsObj->getItemName<side>());
case ItemPathFormat::relative:
@@ -12,20 +16,11 @@ diff -x '.git*' -x '*.orig' -x '*.rej' -aur 11.2-1/FreeFileSync/Source/ui/file_g
return AFS::getDisplayPath(fsObj->getAbstractPath<side>());
}
assert(false);
-@@ -529,7 +531,8 @@
- //----------------------------------------------------------------------------------
- wxDCPenChanger dummy(dc, wxPen(row == pdi.groupLastRow - 1 /*last group item*/ ?
- getColorGridLine() : getDefaultBackgroundColorAlternating(pdi.groupIdx % 2 != 0), fastFromDIP(1)));
-- dc.DrawLine(rect.GetBottomLeft(), rect.GetBottomRight() + wxPoint(1, 0));
-+ if (itemPathFormat_ != ItemPathFormat::traditional && itemPathFormat_ != ItemPathFormat::tradrel)
-+ dc.DrawLine(rect.GetBottomLeft(), rect.GetBottomRight() + wxPoint(1, 0));
- }
-
-
-@@ -628,6 +631,24 @@
+@@ -654,6 +656,27 @@
else //=> BaseFolderPair
groupParentFolder = AFS::getDisplayPath(pdi.fsObj->base().getAbstractPath<side>());
break;
++
+ case ItemPathFormat::traditional:
+ if (auto groupFolder = dynamic_cast<const FolderPair*>(pdi.folderGroupObj))
+ {
@@ -36,6 +31,7 @@ diff -x '.git*' -x '*.orig' -x '*.rej' -aur 11.2-1/FreeFileSync/Source/ui/file_g
+ else //=> BaseFolderPair
+ groupParentFolder = AFS::getDisplayPath(pdi.fsObj->base().getAbstractPath<side>());
+ break;
++
+ case ItemPathFormat::tradrel:
+ if (pdi.folderGroupObj)
+ {
@@ -44,25 +40,26 @@ diff -x '.git*' -x '*.orig' -x '*.rej' -aur 11.2-1/FreeFileSync/Source/ui/file_g
+ utfTo<std::wstring>(pdi.folderGroupObj ->template getItemName<side>());
+ }
+ break;
++
}
//path components should follow the app layout direction and are NOT a single piece of text!
-@@ -655,6 +676,31 @@
- int widthGroupName = groupName .empty() ? 0 : (iconSize + gridGap_ + getTextExtentBuffered(dc, groupName).x + 2 * gridGap_);
- int widthGroupItems = widthGroupSep + (drawFileIcons ? iconSize + gridGap_ : 0) + groupItemNamesWidth;
+@@ -684,6 +707,31 @@
+ int groupItemsWidth = groupSepWidth + (drawFileIcons ? gapSize_ + iconSize : 0) + gapSize_ + groupItemNamesWidth;
+ const int groupItemsMinWidth = groupSepWidth + (drawFileIcons ? gapSize_ + iconSize : 0) + gapSize_ + ellipsisWidth;
-+ // start trad patch
++ // start trad patch
+
-+ //add slashes for better readability
-+ assert(!contains(groupParentFolder, L'/') || !contains(groupParentFolder, L'\\'));
-+ const wchar_t groupParentSep = contains(groupParentFolder, L'/') ? L'/' : (contains(groupParentFolder, L'\\') ? L'\\' : FILE_NAME_SEPARATOR);
++ // rearrange this one section
++ //add slashes for better readability + a wide gap for disambiguation
++ assert(!contains(groupParentFolder, L'/') || !contains(groupParentFolder, L'\\'));
++ const wchar_t groupParentSep = contains(groupParentFolder, L'/') ? L'/' : (contains(groupParentFolder, L'\\') ? L'\\' : FILE_NAME_SEPARATOR);
+
+ switch (itemPathFormat_)
+ {
+ case ItemPathFormat::traditional:
+ case ItemPathFormat::tradrel:
-+ widthGroupParent -= widthGroupName - getTextExtentBuffered(dc, utfTo<std::wstring>(FILE_NAME_SEPARATOR)).x;
-+
++ groupParentWidth -= groupNameWidth - getTextExtentBuffered(dc, utfTo<std::wstring>(FILE_NAME_SEPARATOR)).x;
+ if (!endsWith(groupParentFolder, L'/' ) && //e.g. ftp://server/
+ !endsWith(groupParentFolder, L'\\') && /*e.g. C:\ */
+ groupParentFolder.size() > 0 )
@@ -77,83 +74,72 @@ diff -x '.git*' -x '*.orig' -x '*.rej' -aur 11.2-1/FreeFileSync/Source/ui/file_g
+ // but with the "add slashes" paragraph 1 moved to above this switch statement!
+
//not enough space? => collapse
- if (int excessWidth = gridGap_ + widthGroupParent + widthGroupName + widthGroupItems - maxWidth;
+ if (int excessWidth = groupParentWidth + groupNameWidth + groupItemsWidth - maxWidth;
excessWidth > 0)
-@@ -664,10 +710,6 @@
+@@ -693,10 +741,6 @@
//1. render group components on two rows
stackedGroupRender = true;
-- //add slashes for better readability
+- //add slashes for better readability + a wide gap for disambiguation
- assert(!contains(groupParentFolder, L'/') || !contains(groupParentFolder, L'\\'));
- const wchar_t groupParentSep = contains(groupParentFolder, L'/') ? L'/' : (contains(groupParentFolder, L'\\') ? L'\\' : FILE_NAME_SEPARATOR);
-
if (!endsWith(groupParentFolder, L'/' ) && //e.g. ftp://server/
!endsWith(groupParentFolder, L'\\')) /*e.g. C:\ */
groupParentFolder += groupParentSep;
-@@ -725,6 +767,11 @@
+@@ -755,6 +799,11 @@
+ }
}
}
-
++
+ // end of original section, and back to the trad patch!
+ break;
+ }
+ // and end the addition for trad patch
-+
+
return
{
- itemName,
-@@ -793,6 +840,9 @@
+@@ -873,6 +922,9 @@
rectGroup = rectGroupParent = rectGroupName = rectTmp;
- rectGroupParent.width = widthGroupParent;
+ rectGroupParent.width = groupParentWidth;
+ // re-add back the width of groupname so that the directory name is clickable
+ if (itemPathFormat_ == ItemPathFormat::traditional || itemPathFormat_ == ItemPathFormat::tradrel)
-+ rectGroupParent.width += widthGroupName;
- rectGroupName .width = widthGroupName;
++ rectGroupParent.width += groupNameWidth;
+ rectGroupName .width = groupNameWidth;
if (stackedGroupRender)
-@@ -829,7 +879,8 @@
- if (row == pdi.groupLastRow - 1 /*last group item*/) //restore the group separation line we just cleared
- {
- wxDCPenChanger dummy(dc, wxPen(getColorGridLine(), fastFromDIP(1)));
-- dc.DrawLine(rectGroup.GetBottomLeft(), rectGroup.GetBottomRight() + wxPoint(1, 0));
-+ if (itemPathFormat_ != ItemPathFormat::traditional && itemPathFormat_ != ItemPathFormat::tradrel)
-+ dc.DrawLine(rectGroup.GetBottomLeft(), rectGroup.GetBottomRight() + wxPoint(1, 0));
- }
- }
+@@ -922,6 +974,7 @@
+ rectNav.width = fastFromDIP(20);
-@@ -844,7 +895,7 @@
- dc.GradientFillLinear(rectNav, getColorSelectionGradientFrom(), backCol, wxEAST);
- }
+ if (row == pdi.groupLastRow - 1 /*last group item*/) //preserve the group separation line!
++ if (itemPathFormat_ != ItemPathFormat::traditional && itemPathFormat_ != ItemPathFormat::tradrel)
+ rectNav.height -= fastFromDIP(1);
+
+ wxColor backCol = *wxWHITE;
+@@ -930,7 +983,7 @@
+ dc.GradientFillLinear(rectNav, getColorSelectionGradientFrom(), backCol, wxEAST);
+ }
- if (!groupName.empty() && row == groupFirstRow)
+ if (!(itemPathFormat_ == ItemPathFormat::traditional || itemPathFormat_ == ItemPathFormat::tradrel) && !groupName.empty() && row == groupFirstRow)
{
- wxDCTextColourChanger textColorGroupName(dc);
- if (static_cast<HoverAreaGroup>(rowHover) == HoverAreaGroup::groupName)
-@@ -865,9 +916,9 @@
- drawCellText(dc, rectGroupName, groupName, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL, &getTextExtentBuffered(dc, groupName));
+ wxRect rectGroupNameBack = rectGroupName;
+ rectGroupNameBack.width += 2 * gapSize_; //include gap left of vline
+@@ -972,10 +1025,10 @@
+ drawCellText(dc, rectGroupName, groupName, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL, &getTextExtentBuffered(dc, groupName));
}
- if (!groupParentFolder.empty() &&
+ if (itemPathFormat_ == ItemPathFormat::traditional || itemPathFormat_ == ItemPathFormat::tradrel || (!groupParentFolder.empty() &&
(( stackedGroupRender && row == groupFirstRow + 1) ||
-- (!stackedGroupRender && row == groupFirstRow)))
-+ (!stackedGroupRender && row == groupFirstRow))))
+ (!stackedGroupRender && row == groupFirstRow)) &&
+- (groupName.empty() || !pdi.folderGroupObj->isEmpty<side>()))
++ (groupName.empty() || !pdi.folderGroupObj->isEmpty<side>())))
{
- drawCellText(dc, rectGroupParent, groupParentFolder, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL, &getTextExtentBuffered(dc, groupParentFolder));
- }
-@@ -876,7 +927,8 @@
- if (!groupParentFolder.empty() || !groupName.empty())
- {
- wxDCPenChanger dummy(dc, wxPen(getColorGridLine(), fastFromDIP(1)));
-- dc.DrawLine(rectGroupItems.GetTopLeft(), rectGroupItems.GetBottomLeft() + wxPoint(0, 1)); //draws half-open range!
-+ if (itemPathFormat_ != ItemPathFormat::traditional && itemPathFormat_ != ItemPathFormat::tradrel)
-+ dc.DrawLine(rectGroupItems.GetTopLeft(), rectGroupItems.GetBottomLeft() + wxPoint(0, 1)); //draws half-open range!
- rectGroupItems.x += fastFromDIP(1) + gridGap_;
- rectGroupItems.width -= fastFromDIP(1) + gridGap_;
- }
-@@ -1040,6 +1092,10 @@
+ wxRect rectGroupParentText = rectGroupParent;
+ rectGroupParentText.x += gapSize_;
+@@ -1166,6 +1219,10 @@
return _("Relative path");
case ItemPathFormat::full:
return _("Full path");
bgstack15