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.patch113
1 files changed, 38 insertions, 75 deletions
diff --git a/freefilesync/debian/patches/ffs_traditional_view.patch b/freefilesync/debian/patches/ffs_traditional_view.patch
index 1790069..5e6e7ff 100644
--- a/freefilesync/debian/patches/ffs_traditional_view.patch
+++ b/freefilesync/debian/patches/ffs_traditional_view.patch
@@ -4,7 +4,7 @@ Author: bgstack15
Message: restore a traditional view to FreeFileSync, and disable "welcomeShownVersion" About dialog
--- a/FreeFileSync/Source/ui/file_grid.cpp
+++ b/FreeFileSync/Source/ui/file_grid.cpp
-@@ -465,8 +465,10 @@
+@@ -487,8 +487,10 @@ private:
case ItemPathFormat::name:
return utfTo<std::wstring>(fsObj->getItemName<side>());
case ItemPathFormat::relative:
@@ -15,22 +15,19 @@ Message: restore a traditional view to FreeFileSync, and disable "welcomeShownVe
return AFS::getDisplayPath(fsObj->getAbstractPath<side>());
}
-@@ -526,8 +528,13 @@
+@@ -548,6 +550,11 @@ private:
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) } ;
++ int lineWidth { dipToWxsize(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);
+ const wxRect rectLine(rect.x, rect.y + rect.height - dipToWxsize(1), rect.width, dipToWxsize(1));
clearArea(dc, rectLine, row == pdi.groupLastRow - 1 /*last group item*/ ?
- getColorGridLine() : getDefaultBackgroundColorAlternating(pdi.groupIdx % 2 != 0));
- }
-@@ -636,6 +643,26 @@
+@@ -658,6 +665,26 @@ private:
else //=> BaseFolderPair
groupParentFolder = AFS::getDisplayPath(pdi.fsObj->base().getAbstractPath<side>());
break;
@@ -57,14 +54,14 @@ Message: restore a traditional view to FreeFileSync, and disable "welcomeShownVe
}
//path components should follow the app layout direction and are NOT a single piece of text!
-@@ -661,11 +688,38 @@
+@@ -683,11 +710,38 @@ private:
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));
+- const int groupSepWidth = (groupParentFolder.empty() && groupName.empty()) ? 0 : (2 * gapSize_ + dipToWxsize(1));
+ // trad patch section for removing lines around items in grid
+ // code duplication because this is a different scope!
-+ int lineWidth { fastFromDIP(1) } ;
++ int lineWidth { dipToWxsize(1) } ;
+ if (itemPathFormat_ == ItemPathFormat::traditional || itemPathFormat_ == ItemPathFormat::tradrel)
+ lineWidth = 0;
+
@@ -97,7 +94,7 @@ Message: restore a traditional view to FreeFileSync, and disable "welcomeShownVe
//not enough space? => collapse
if (int excessWidth = groupParentWidth + groupNameWidth + groupItemsWidth - maxWidth;
excessWidth > 0)
-@@ -732,6 +786,11 @@
+@@ -754,6 +808,11 @@ private:
}
}
@@ -109,7 +106,7 @@ Message: restore a traditional view to FreeFileSync, and disable "welcomeShownVe
return
{
itemName,
-@@ -872,6 +931,9 @@
+@@ -894,6 +953,9 @@ private:
rectGroup = rectGroupParent = rectGroupName = rectTmp;
rectGroupParent.width = groupParentWidth;
@@ -119,31 +116,29 @@ Message: restore a traditional view to FreeFileSync, and disable "welcomeShownVe
rectGroupName .width = groupNameWidth;
if (stackedGroupRender)
-@@ -895,6 +957,11 @@
+@@ -917,6 +979,11 @@ private:
rectGroupItems.width = 0;
}
+ // trad patch section for removing lines around items in grid
-+ int lineWidth { fastFromDIP(1) } ;
++ int lineWidth { dipToWxsize(1) } ;
+ if (itemPathFormat_ == ItemPathFormat::traditional || itemPathFormat_ == ItemPathFormat::tradrel)
+ lineWidth = 0;
+
//-------------------------------------------------------------------------
{
//clear background below parent path => harmonize with renderRowBackgound()
-@@ -905,8 +972,9 @@
- wxRect rectGroupBack = rectGroup;
+@@ -928,7 +995,8 @@ private:
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!
-+ if (itemPathFormat_ != ItemPathFormat::traditional && itemPathFormat_ != ItemPathFormat::tradrel)
-+ rectGroupBack.height -= lineWidth;
+ if (row == pdi.groupLastRow - 1 /*last group item*/) //preserve the group separation line!
+- rectGroupBack.height -= dipToWxsize(1);
++ if (itemPathFormat_ != ItemPathFormat::traditional && itemPathFormat_ != ItemPathFormat::tradrel)
++ rectGroupBack.height -= dipToWxsize(1);
clearArea(dc, rectGroupBack, getDefaultBackgroundColorAlternating(pdi.groupIdx % 2 == 0));
//clearArea() is surprisingly expensive => call just once!
-@@ -914,9 +982,9 @@
+@@ -936,9 +1004,9 @@ private:
//accessibility: always set *both* foreground AND background colors!
}
@@ -155,7 +150,7 @@ Message: restore a traditional view to FreeFileSync, and disable "welcomeShownVe
(groupName.empty() || !pdi.folderGroupObj->isEmpty<side>())) //don't show for missing folders
{
tryDrawNavMarker(rectGroupParent);
-@@ -928,14 +996,14 @@
+@@ -950,7 +1018,7 @@ private:
drawCellText(dc, rectGroupParentText, groupParentFolder, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL, &getTextExtentBuffered(dc, groupParentFolder));
}
@@ -164,50 +159,22 @@ Message: restore a traditional view to FreeFileSync, and disable "welcomeShownVe
row == groupFirstRow)
{
wxRect rectGroupNameBack = rectGroupName;
-
- if (!itemName.empty())
- rectGroupNameBack.width += 2 * gapSize_; //include gap left of item vline
-- rectGroupNameBack.height -= fastFromDIP(1); //harmonize with item separation lines
-+ rectGroupNameBack.height -= lineWidth; //harmonize with item separation lines
-
- wxDCTextColourChanger textColorGroupName(dc);
- //folder background: coordinate with renderRowBackgound()
-@@ -979,16 +1047,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)); //DrawLine() doesn't draw last pixel!
-
-- 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!
-
- drawCudHighlight(rectItemsBack, pdi.fsObj->getSyncOperation());
- tryDrawNavMarker(rectGroupItems);
-@@ -1119,7 +1187,12 @@
+@@ -1142,7 +1210,13 @@ private:
groupNameWidth] = getGroupRenderLayout(dc, row, pdi, insanelyHugeWidth);
assert(!stackedGroupRender);
-- const int groupSepWidth = (groupParentFolder.empty() && groupName.empty()) ? 0 : (2 * gapSize_ + fastFromDIP(1));
+- const int groupSepWidth = (groupParentFolder.empty() && groupName.empty()) ? 0 : (2 * gapSize_ + dipToWxsize(1));
+ // trad patch section for removing lines around items in grid
-+ int lineWidth { fastFromDIP(1) } ;
++ int lineWidth { dipToWxsize(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 groupSepWidth = (groupParentFolder.empty() && groupName.empty()) ? 0 : (2 * gapSize_ + lineWidth);
++
+ const int fileIconWidth = getIconManager().getIconBuffer() ? gapSize_ + getIconManager().getIconWxsize() : 0;
const int ellipsisWidth = getTextExtentBuffered(dc, ELLIPSIS).x;
const int itemWidth = itemName.empty() ? 0 :
-@@ -1151,6 +1224,10 @@
+@@ -1174,6 +1248,10 @@ private:
return _("Relative path");
case ItemPathFormat::full:
return _("Full path");
@@ -218,29 +185,25 @@ Message: restore a traditional view to FreeFileSync, and disable "welcomeShownVe
}
assert(false);
break;
-@@ -1408,7 +1485,8 @@
+@@ -1431,6 +1509,7 @@ private:
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);
++ // trad patch: we might need to convert these dipToWxsize to lineWidth calculated based on if-traditional logic.
+ const wxRect rectLine(rect.x, rect.y + rect.height - dipToWxsize(1), rect.width, dipToWxsize(1));
clearArea(dc, rectLine, row == pdi.groupLastRow - 1 /*last group item*/ ?
getColorGridLine() : getDefaultBackgroundColorAlternating(pdi.groupIdx % 2 != 0));
- }
-@@ -1432,7 +1510,8 @@
+@@ -1455,6 +1534,7 @@ private:
{
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;
++ // trad patch: we might need to convert these dipToWxsize to lineWidth calculated based on if-traditional logic.
+ rectBack.height -= dipToWxsize(1);
clearArea(dc, rectBack, col);
- }
--- a/FreeFileSync/Source/ui/file_grid_attr.h
+++ b/FreeFileSync/Source/ui/file_grid_attr.h
-@@ -79,6 +79,8 @@
+@@ -79,6 +79,8 @@ enum class ItemPathFormat
name,
relative,
full,
@@ -251,7 +214,7 @@ Message: restore a traditional view to FreeFileSync, and disable "welcomeShownVe
const ItemPathFormat defaultItemPathFormatLeftGrid = ItemPathFormat::relative;
--- a/FreeFileSync/Source/ui/main_dlg.cpp
+++ b/FreeFileSync/Source/ui/main_dlg.cpp
-@@ -3002,6 +3002,8 @@
+@@ -3016,6 +3016,8 @@ void MainDialog::onGridLabelContextRim(G
addFormatEntry(_("Item name" ), ItemPathFormat::name);
addFormatEntry(_("Relative path"), ItemPathFormat::relative);
addFormatEntry(_("Full path" ), ItemPathFormat::full);
@@ -262,7 +225,7 @@ Message: restore a traditional view to FreeFileSync, and disable "welcomeShownVe
auto setIconSize = [&](GridIconSize sz, bool showIcons)
--- a/FreeFileSync/Source/config.cpp
+++ b/FreeFileSync/Source/config.cpp
-@@ -477,6 +477,12 @@
+@@ -476,6 +476,12 @@ void writeText(const ItemPathFormat& val
case ItemPathFormat::full:
output = "Full";
break;
@@ -275,7 +238,7 @@ Message: restore a traditional view to FreeFileSync, and disable "welcomeShownVe
}
}
-@@ -490,6 +496,10 @@
+@@ -489,6 +495,10 @@ bool readText(const std::string& input,
value = ItemPathFormat::relative;
else if (tmp == "Full")
value = ItemPathFormat::full;
@@ -288,7 +251,7 @@ Message: restore a traditional view to FreeFileSync, and disable "welcomeShownVe
return true;
--- a/FreeFileSync/Source/ui/file_view.cpp
+++ b/FreeFileSync/Source/ui/file_view.cpp
-@@ -798,6 +798,7 @@
+@@ -798,6 +798,7 @@ void FileView::sortView(ColumnTypeRim ty
break;
case ItemPathFormat::relative:
@@ -296,7 +259,7 @@ Message: restore a traditional view to FreeFileSync, and disable "welcomeShownVe
if ( ascending && onLeft) std::sort(sortedRef_.begin(), sortedRef_.end(), LessRelativeFolder<true, SelectSide::left >(folderPairs_));
else if ( ascending && !onLeft) std::sort(sortedRef_.begin(), sortedRef_.end(), LessRelativeFolder<true, SelectSide::right>(folderPairs_));
else if (!ascending && onLeft) std::sort(sortedRef_.begin(), sortedRef_.end(), LessRelativeFolder<false, SelectSide::left >(folderPairs_));
-@@ -805,6 +806,7 @@
+@@ -805,6 +806,7 @@ void FileView::sortView(ColumnTypeRim ty
break;
case ItemPathFormat::full:
bgstack15