summaryrefslogtreecommitdiff
path: root/freefilesync/debian/patches/ffs_traditional_view.patch
diff options
context:
space:
mode:
authorB Stack <bgstack15@gmail.com>2020-11-06 16:28:57 +0000
committerB Stack <bgstack15@gmail.com>2020-11-06 16:28:57 +0000
commitc3c4444d4764866601f096f62f3ac56ef1c82bc9 (patch)
treeb8d1e5633195915c008301ae4f71c1a0198c2c4b /freefilesync/debian/patches/ffs_traditional_view.patch
parentMerge branch 'ublock-origin-bump' into 'master' (diff)
parentffs 11.3-2 with fixed trad patch (diff)
downloadstackrpms-c3c4444d4764866601f096f62f3ac56ef1c82bc9.tar.gz
stackrpms-c3c4444d4764866601f096f62f3ac56ef1c82bc9.tar.bz2
stackrpms-c3c4444d4764866601f096f62f3ac56ef1c82bc9.zip
Merge branch 'freefilesync-bump' into 'master'
ffs 11.3-2 with fixed trad patch See merge request bgstack15/stackrpms!203
Diffstat (limited to 'freefilesync/debian/patches/ffs_traditional_view.patch')
-rw-r--r--freefilesync/debian/patches/ffs_traditional_view.patch144
1 files changed, 128 insertions, 16 deletions
diff --git a/freefilesync/debian/patches/ffs_traditional_view.patch b/freefilesync/debian/patches/ffs_traditional_view.patch
index ff78325..f627a0a 100644
--- a/freefilesync/debian/patches/ffs_traditional_view.patch
+++ b/freefilesync/debian/patches/ffs_traditional_view.patch
@@ -1,10 +1,11 @@
Version: 11.3
-Date: 2020-11-01
+Date: 2020-11-05
Author: bgstack15@gmail.com
Message: restore a traditional view to FreeFileSync
+The Nov 5 patch removes the lines between groups, and also fixes the relative paths in "Trad. Rel" view.
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
+--- 11.3-1/FreeFileSync/Source/ui/file_grid.cpp 2020-11-02 11:38:14.806496077 -0500
++++ 11.3-2/FreeFileSync/Source/ui/file_grid.cpp 2020-11-05 11:11:46.146360956 -0500
@@ -493,8 +493,10 @@
case ItemPathFormat::name:
return utfTo<std::wstring>(fsObj->getItemName<side>());
@@ -16,7 +17,22 @@ diff -x '*.orig' -x '*.rej' -aur 11.3-0/FreeFileSync/Source/ui/file_grid.cpp 11.
return AFS::getDisplayPath(fsObj->getAbstractPath<side>());
}
assert(false);
-@@ -654,6 +656,27 @@
+@@ -547,8 +549,13 @@
+ else
+ GridData::renderRowBackgound(dc, rect, row, true /*enabled*/, true /*selected*/, rowHover);
+
++ // trad patch section for removing lines around items in grid
++ int lineWidth { fastFromDIP(1) } ;
++ if (itemPathFormat_ == ItemPathFormat::traditional || itemPathFormat_ == ItemPathFormat::tradrel)
++ lineWidth = 0;
++
+ //----------------------------------------------------------------------------------
+- const wxRect rectLine(rect.x, rect.y + rect.height - fastFromDIP(1), rect.width, fastFromDIP(1));
++ const wxRect rectLine(rect.x, rect.y + rect.height - lineWidth, rect.width, lineWidth);
+ clearArea(dc, rectLine, row == pdi.groupLastRow - 1 /*last group item*/ ?
+ getColorGridLine() : getDefaultBackgroundColorAlternating(pdi.groupIdx % 2 != 0));
+ }
+@@ -654,6 +661,26 @@
else //=> BaseFolderPair
groupParentFolder = AFS::getDisplayPath(pdi.fsObj->base().getAbstractPath<side>());
break;
@@ -35,16 +51,27 @@ diff -x '*.orig' -x '*.rej' -aur 11.3-0/FreeFileSync/Source/ui/file_grid.cpp 11.
+ case ItemPathFormat::tradrel:
+ if (pdi.folderGroupObj)
+ {
-+ groupName = utfTo<std::wstring>(pdi.folderGroupObj ->template getItemName <side>());
-+ groupParentFolder = utfTo<std::wstring>(pdi.folderGroupObj->parent().template getRelativePath<side>()) + \
-+ utfTo<std::wstring>(pdi.folderGroupObj ->template getItemName<side>());
++ groupName = utfTo<std::wstring>(pdi.folderGroupObj->template getItemName <side>());
++ groupParentFolder = utfTo<std::wstring>(pdi.folderGroupObj->template getRelativePath<side>());
+ }
+ break;
+
}
//path components should follow the app layout direction and are NOT a single piece of text!
-@@ -684,6 +707,31 @@
+@@ -679,11 +706,42 @@
+ int groupNameWidth = groupName.empty() ? 0 : (gapSize_ + iconSize + gapSize_ + getTextExtentBuffered(dc, groupName).x);
+ const int groupNameMinWidth = groupName.empty() ? 0 : (gapSize_ + iconSize + gapSize_ + ellipsisWidth);
+
+- const int groupSepWidth = (groupParentFolder.empty() && groupName.empty()) ? 0 : (2 * gapSize_ + fastFromDIP(1));
++ // trad patch section for removing lines around items in grid
++ // code duplication because this is a different scope!
++ int lineWidth { fastFromDIP(1) } ;
++ if (itemPathFormat_ == ItemPathFormat::traditional || itemPathFormat_ == ItemPathFormat::tradrel)
++ lineWidth = 0;
++
++ const int groupSepWidth = (groupParentFolder.empty() && groupName.empty()) ? 0 : (2 * gapSize_ + lineWidth);
+
int groupItemsWidth = groupSepWidth + (drawFileIcons ? gapSize_ + iconSize : 0) + gapSize_ + groupItemNamesWidth;
const int groupItemsMinWidth = groupSepWidth + (drawFileIcons ? gapSize_ + iconSize : 0) + gapSize_ + ellipsisWidth;
@@ -76,7 +103,7 @@ diff -x '*.orig' -x '*.rej' -aur 11.3-0/FreeFileSync/Source/ui/file_grid.cpp 11.
//not enough space? => collapse
if (int excessWidth = groupParentWidth + groupNameWidth + groupItemsWidth - maxWidth;
excessWidth > 0)
-@@ -693,10 +741,6 @@
+@@ -693,10 +751,6 @@
//1. render group components on two rows
stackedGroupRender = true;
@@ -87,7 +114,7 @@ diff -x '*.orig' -x '*.rej' -aur 11.3-0/FreeFileSync/Source/ui/file_grid.cpp 11.
if (!endsWith(groupParentFolder, L'/' ) && //e.g. ftp://server/
!endsWith(groupParentFolder, L'\\')) /*e.g. C:\ */
groupParentFolder += groupParentSep;
-@@ -755,6 +799,11 @@
+@@ -755,6 +809,11 @@
}
}
}
@@ -99,7 +126,7 @@ diff -x '*.orig' -x '*.rej' -aur 11.3-0/FreeFileSync/Source/ui/file_grid.cpp 11.
return
{
-@@ -873,6 +922,9 @@
+@@ -873,6 +932,9 @@
rectGroup = rectGroupParent = rectGroupName = rectTmp;
rectGroupParent.width = groupParentWidth;
@@ -109,15 +136,40 @@ diff -x '*.orig' -x '*.rej' -aur 11.3-0/FreeFileSync/Source/ui/file_grid.cpp 11.
rectGroupName .width = groupNameWidth;
if (stackedGroupRender)
-@@ -922,6 +974,7 @@
+@@ -896,6 +958,11 @@
+ rectGroupItems.width = 0;
+ }
+
++ // trad patch section for removing lines around items in grid
++ int lineWidth { fastFromDIP(1) } ;
++ if (itemPathFormat_ == ItemPathFormat::traditional || itemPathFormat_ == ItemPathFormat::tradrel)
++ lineWidth = 0;
++
+ //-------------------------------------------------------------------------
+ {
+ //clear background below parent path => harmonize with renderRowBackgound()
+@@ -906,8 +973,8 @@
+ wxRect rectGroupBack = rectGroup;
+ rectGroupBack.width += 2 * gapSize_; //include gap before vline
+
+- if (row == pdi.groupLastRow - 1 /*last group item*/) //preserve the group separation line!
+- rectGroupBack.height -= fastFromDIP(1);
++ if (row == pdi.groupLastRow - 1 /*last group item*/) //preserve the group separation line!
++ rectGroupBack.height -= lineWidth;
+
+ clearArea(dc, rectGroupBack, getDefaultBackgroundColorAlternating(pdi.groupIdx % 2 == 0));
+ //clearArea() is surprisingly expensive => call just once!
+@@ -922,7 +989,8 @@
rectNav.width = fastFromDIP(20);
if (row == pdi.groupLastRow - 1 /*last group item*/) //preserve the group separation line!
+- rectNav.height -= fastFromDIP(1);
+ if (itemPathFormat_ != ItemPathFormat::traditional && itemPathFormat_ != ItemPathFormat::tradrel)
- rectNav.height -= fastFromDIP(1);
++ rectNav.height -= lineWidth;
wxColor backCol = *wxWHITE;
-@@ -930,7 +983,7 @@
+ dc.GetPixel(rectNav.GetTopRight(), &backCol); //e.g. selected row!
+@@ -930,11 +998,11 @@
dc.GradientFillLinear(rectNav, getColorSelectionGradientFrom(), backCol, wxEAST);
}
@@ -126,7 +178,12 @@ diff -x '*.orig' -x '*.rej' -aur 11.3-0/FreeFileSync/Source/ui/file_grid.cpp 11.
{
wxRect rectGroupNameBack = rectGroupName;
rectGroupNameBack.width += 2 * gapSize_; //include gap left of vline
-@@ -972,10 +1025,10 @@
+- rectGroupNameBack.height -= fastFromDIP(1); //harmonize with item separation lines
++ rectGroupNameBack.height -= lineWidth; //harmonize with item separation lines
+
+ //mouse highlight: group name
+ wxDCTextColourChanger textColorGroupName(dc);
+@@ -972,10 +1040,10 @@
drawCellText(dc, rectGroupName, groupName, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL, &getTextExtentBuffered(dc, groupName));
}
@@ -139,7 +196,42 @@ diff -x '*.orig' -x '*.rej' -aur 11.3-0/FreeFileSync/Source/ui/file_grid.cpp 11.
{
wxRect rectGroupParentText = rectGroupParent;
rectGroupParentText.x += gapSize_;
-@@ -1166,6 +1219,10 @@
+@@ -994,16 +1062,16 @@
+ rectGroupItems.x += 2 * gapSize_;
+ rectGroupItems.width -= 2 * gapSize_;
+
+- wxDCPenChanger dummy(dc, wxPen(getColorGridLine(), fastFromDIP(1)));
++ wxDCPenChanger dummy(dc, wxPen(getColorGridLine(), lineWidth));
+ dc.DrawLine(rectGroupItems.GetTopLeft(), rectGroupItems.GetBottomLeft() + wxPoint(0, 1)); //draws half-open range!
+
+- rectGroupItems.x += fastFromDIP(1);
+- rectGroupItems.width -= fastFromDIP(1);
++ rectGroupItems.x += lineWidth;
++ rectGroupItems.width -= lineWidth;
+ }
+ //-------------------------------------------------------------------------
+
+ wxRect rectItemsBack = rectGroupItems;
+- rectItemsBack.height -= fastFromDIP(1); //preserve item separation lines!
++ rectItemsBack.height -= lineWidth; //preserve item separation lines!
+
+ //mouse highlight: item name
+ wxDCTextColourChanger textColorGroupItems(dc);
+@@ -1134,7 +1202,12 @@
+ groupNameWidth] = getGroupRenderLayout(dc, row, pdi, insanelyHugeWidth);
+ assert(!stackedGroupRender);
+
+- const int groupSepWidth = (groupParentFolder.empty() && groupName.empty()) ? 0 : (2 * gapSize_ + fastFromDIP(1));
++ // trad patch section for removing lines around items in grid
++ int lineWidth { fastFromDIP(1) } ;
++ if (itemPathFormat_ == ItemPathFormat::traditional || itemPathFormat_ == ItemPathFormat::tradrel)
++ lineWidth = 0;
++
++ const int groupSepWidth = (groupParentFolder.empty() && groupName.empty()) ? 0 : (2 * gapSize_ + lineWidth);
+ const int fileIconWidth = getIconManager().getIconBuffer() ? gapSize_ + getIconManager().getIconSize() : 0;
+ const int ellipsisWidth = getTextExtentBuffered(dc, ELLIPSIS).x;
+ const int itemWidth = itemName.empty() ? 0 :
+@@ -1166,6 +1239,10 @@
return _("Relative path");
case ItemPathFormat::full:
return _("Full path");
@@ -150,6 +242,26 @@ diff -x '*.orig' -x '*.rej' -aur 11.3-0/FreeFileSync/Source/ui/file_grid.cpp 11.
}
assert(false);
break;
+@@ -1423,7 +1500,8 @@
+ GridData::renderRowBackgound(dc, rect, row, true /*enabled*/, true /*selected*/, rowHover);
+
+ //----------------------------------------------------------------------------------
+- const wxRect rectLine(rect.x, rect.y + rect.height - fastFromDIP(1), rect.width, fastFromDIP(1));
++ // just hardcoding this in this trad patch, because itempathFormat_ is not available in this scope.
++ const wxRect rectLine(rect.x, rect.y + rect.height - 0, rect.width, 0);
+ clearArea(dc, rectLine, row == pdi.groupLastRow - 1 /*last group item*/ ?
+ getColorGridLine() : getDefaultBackgroundColorAlternating(pdi.groupIdx % 2 != 0));
+ }
+@@ -1447,7 +1525,8 @@
+ {
+ wxRect rectBack = rect;
+ if (row == pdi.groupLastRow - 1 /*last group item*/) //preserve the group separation line!
+- rectBack.height -= fastFromDIP(1);
++ // just hardcoding this in this trad patch, because itempathFormat_ is not available in this scope.
++ rectBack.height -= 0;
+
+ clearArea(dc, rectBack, col);
+ }
diff -x '.git*' -x '*.orig' -x '*.rej' -aur 11.2-1/FreeFileSync/Source/ui/file_grid_attr.h 11.2-1-trad3/FreeFileSync/Source/ui/file_grid_attr.h
--- 11.2-1/FreeFileSync/Source/ui/file_grid_attr.h 2020-10-02 14:39:05.313463564 -0400
+++ 11.2-1-trad3/FreeFileSync/Source/ui/file_grid_attr.h 2020-10-02 20:21:48.863111642 -0400
bgstack15