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.patch97
1 files changed, 39 insertions, 58 deletions
diff --git a/freefilesync/debian/patches/ffs_traditional_view.patch b/freefilesync/debian/patches/ffs_traditional_view.patch
index 188a6a2..c18b860 100644
--- a/freefilesync/debian/patches/ffs_traditional_view.patch
+++ b/freefilesync/debian/patches/ffs_traditional_view.patch
@@ -8,24 +8,7 @@ Message:
"Wrap file grid folder paths instead of truncate" in the Latest Changes.
--- a/FreeFileSync/Source/ui/file_grid.cpp
+++ b/FreeFileSync/Source/ui/file_grid.cpp
-@@ -5,13 +5,13 @@
- // *****************************************************************************
-
- #include "file_grid.h"
--//#include <set>
-+#include <set>
- #include <wx/dc.h>
- #include <wx/settings.h>
- #include <wx/timer.h>
- #include <zen/i18n.h>
--//#include <zen/file_error.h>
--//#include <zen/format_unit.h>
-+#include <zen/file_error.h>
-+#include <zen/format_unit.h>
- #include <zen/scope_guard.h>
- #include <wx+/tooltip.h>
- #include <wx+/rtl.h>
-@@ -308,8 +308,7 @@ struct SharedComponents //...between left, center, and right grids
+@@ -295,8 +295,7 @@ struct SharedComponents //...between lef
NavigationMarker navMarker;
std::unique_ptr<GridEventManager> evtMgr;
GridViewType gridViewType = GridViewType::action;
@@ -35,12 +18,12 @@ Message:
};
//########################################################################################################
-@@ -352,57 +351,18 @@ public:
+@@ -339,57 +338,19 @@ public:
const FileSystemObject* getFsObject(size_t row) const { return getDataView().getFsObject(row); }
-- const wxSize& getTextExtentBuffered(wxDC& dc, const std::wstring_view& text)
-+ const wxSize& getTextExtentBuffered(wxDC& dc, const std::wstring& text)
+- const wxSize& getTextExtentBuffered(const wxReadOnlyDC& dc, const std::wstring_view& text)
++ const wxSize& getTextExtentBuffered(const wxDC& dc, const std::wstring& text)
{
auto& compExtentsBuf = sharedComp_.ref().compExtentsBuf_;
//- only used for parent path names and file names on view => should not grow "too big"
@@ -50,14 +33,14 @@ Message:
auto it = compExtentsBuf.find(text);
if (it == compExtentsBuf.end())
- it = compExtentsBuf.emplace(text, dc.GetTextExtent(copyStringTo<wxString>(text))).first;
-- //GetTextExtent() returns (0, 0) for empty string!
+ it = compExtentsBuf.emplace(text, dc.GetTextExtent(text)).first;
+ //GetTextExtent() returns (0, 0) for empty string!
return it->second;
}
- //- trim while leaving path components intact
- //- *always* returns at least one component, even if > maxWidth
-- size_t getPathTrimmedSize(wxDC& dc, const std::wstring_view& itemPath, int maxWidth)
+- size_t getPathTrimmedSize(const wxReadOnlyDC& dc, const std::wstring_view& itemPath, int maxWidth)
- {
- if (itemPath.size() <= 1)
- return itemPath.size();
@@ -92,10 +75,10 @@ Message:
- }
- }
-
- private:
- size_t getRowCount() const override { return getDataView().rowsOnView(); }
-
-@@ -527,8 +487,10 @@ private:
+ //improve readability (while lacking cell borders)
+ const wxColor& getDefaultBackgroundColorAlternating(bool wantStandardColor)
+ {
+@@ -523,8 +484,10 @@ private:
case ItemPathFormat::name:
return utfTo<std::wstring>(fsObj->getItemName<side>());
case ItemPathFormat::relative:
@@ -106,7 +89,7 @@ Message:
return AFS::getDisplayPath(fsObj->getAbstractPath<side>());
}
-@@ -588,11 +550,14 @@ private:
+@@ -584,11 +547,14 @@ private:
else
GridData::renderRowBackgound(dc, rect, row, true /*enabled*/, true /*selected*/, rowHover);
@@ -124,7 +107,7 @@ Message:
getColorGridLine() : getDefaultBackgroundColorAlternating(pdi.groupIdx % 2 != 0));
}
-@@ -614,18 +579,18 @@ private:
+@@ -610,18 +576,18 @@ private:
if (itemNamesWidth < 0)
{
itemNamesWidth = 0;
@@ -146,7 +129,7 @@ Message:
if (!itemWidths.empty())
{
-@@ -643,15 +608,17 @@ private:
+@@ -639,15 +605,17 @@ private:
}
@@ -163,12 +146,12 @@ Message:
int groupParentWidth;
int groupNameWidth;
};
-- GroupRowLayout getGroupRowLayout(wxDC& dc, size_t row, const FileView::PathDrawInfo& pdi, int maxWidth)
+- GroupRowLayout getGroupRowLayout(const wxReadOnlyDC& dc, size_t row, const FileView::PathDrawInfo& pdi, int maxWidth)
+ GroupRenderLayout getGroupRenderLayout(wxDC& dc, size_t row, const FileView::PathDrawInfo& pdi, int maxWidth)
{
assert(pdi.fsObj);
-@@ -659,15 +626,14 @@ private:
+@@ -655,15 +623,14 @@ private:
const int iconSize = getIconManager().getIconWxsize();
//--------------------------------------------------------------------
@@ -186,7 +169,7 @@ Message:
std::wstring itemName;
if (itemPathFormat_ == ItemPathFormat::name || //hack: show folder name in item colum since groupName/groupParentFolder are unused!
-@@ -699,140 +665,166 @@ private:
+@@ -695,140 +662,166 @@ private:
else //=> BaseFolderPair
groupParentFolder = AFS::getDisplayPath(pdi.fsObj->base().getAbstractPath<side>());
break;
@@ -443,7 +426,7 @@ Message:
void renderCell(wxDC& dc, const wxRect& rect, size_t row, ColumnType colType, bool enabled, bool selected, HoverArea rowHover) override
{
//-----------------------------------------------
-@@ -949,43 +941,62 @@ break2:
+@@ -945,43 +938,62 @@ break2:
};
//-------------------------------------------------------------------------
@@ -514,7 +497,7 @@ Message:
clearArea(dc, rectGroupBack, getDefaultBackgroundColorAlternating(pdi.groupIdx % 2 == 0));
//clearArea() is surprisingly expensive => call just once!
-@@ -993,31 +1004,22 @@ break2:
+@@ -989,31 +1001,22 @@ break2:
//accessibility: always set *both* foreground AND background colors!
}
@@ -554,7 +537,7 @@ Message:
{
wxRect rectGroupNameBack = rectGroupName;
-@@ -1062,7 +1064,7 @@ break2:
+@@ -1058,7 +1061,7 @@ break2:
if (!itemName.empty())
{
//draw group/items separation line
@@ -563,7 +546,7 @@ Message:
{
rectGroupItems.x += 2 * gapSize_;
rectGroupItems.width -= 2 * gapSize_;
-@@ -1165,15 +1167,18 @@ break2:
+@@ -1160,15 +1163,18 @@ break2:
if (const FileView::PathDrawInfo pdi = getDataView().getDrawInfo(row);
pdi.fsObj)
{
@@ -587,7 +570,7 @@ Message:
if (groupNameCellBeginX <= cellRelativePosX && cellRelativePosX < groupNameCellBeginX + groupNameWidth + 2 * gapSize_ /*include gap before vline*/)
return static_cast<HoverArea>(HoverAreaGroup::groupName);
-@@ -1196,13 +1201,22 @@ break2:
+@@ -1191,13 +1197,22 @@ break2:
/* ________________________ ___________________________________ _____________________________________________________
| (gap | group parent) | | (gap | icon | gap | group name) | | (2x gap | vline) | (gap | icon) | gap | item name |
------------------------ ----------------------------------- ----------------------------------------------------- */
@@ -614,27 +597,25 @@ Message:
const int fileIconWidth = getIconManager().getIconBuffer() ? gapSize_ + getIconManager().getIconWxsize() : 0;
const int ellipsisWidth = getTextExtentBuffered(dc, ELLIPSIS).x;
const int itemWidth = itemName.empty() ? 0 :
-@@ -1234,6 +1248,10 @@ break2:
- return _("Relative path");
- case ItemPathFormat::full:
- return _("Full path");
-+ case ItemPathFormat::traditional:
-+ return _("Traditional");
-+ case ItemPathFormat::tradrel:
-+ return _("Trad. relative");
+@@ -1228,6 +1243,8 @@ break2:
+ case ItemPathFormat::name: return _("Item name");
+ case ItemPathFormat::relative: return _("Relative path");
+ case ItemPathFormat::full: return _("Full path");
++ case ItemPathFormat::traditional: return _("Traditional");
++ case ItemPathFormat::tradrel: return _("Trad. relative");
}
assert(false);
break;
-@@ -1348,8 +1366,6 @@ break2:
- const int gapSize_ = dipToWxsize(FILE_GRID_GAP_SIZE_DIP);
- const int gapSizeWide_ = dipToWxsize(FILE_GRID_GAP_SIZE_WIDE_DIP);
+@@ -1344,8 +1361,6 @@ break2:
+ wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT),
+ wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW), 5 /*contrastRatioMin*/); //W3C recommends >= 4.5
- const int charHeight_ = refGrid().getMainWin().GetCharHeight();
-
+
ItemPathFormat itemPathFormat_ = ItemPathFormat::full;
- std::vector<unsigned char> failedLoads_; //effectively a vector<bool> of size "number of rows"
-@@ -1358,11 +1374,6 @@ break2:
+@@ -1355,11 +1370,6 @@ break2:
const std::wstring bslashBidi_ = (wxTheApp->GetLayoutDirection() == wxLayout_RightToLeft ? RTL_MARK : LTR_MARK) + std::wstring(L"\\");
//no need for LTR/RTL marks on both sides: text follows main direction if slash is between two strong characters with different directions
@@ -646,7 +627,7 @@ Message:
std::vector<int> groupItemNamesWidthBuf_; //buffer! groupItemNamesWidths essentially only depends on (groupIdx, side)
uint64_t viewUpdateIdLast_ = 0; //
};
-@@ -1498,6 +1509,7 @@ private:
+@@ -1495,6 +1505,7 @@ private:
GridData::renderRowBackgound(dc, rect, row, true /*enabled*/, true /*selected*/, rowHover);
//----------------------------------------------------------------------------------
@@ -654,7 +635,7 @@ Message:
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));
-@@ -1522,6 +1534,7 @@ private:
+@@ -1519,6 +1530,7 @@ private:
{
wxRect rectBack = rect;
if (row == pdi.groupLastRow - 1 /*last group item*/) //preserve the group separation line!
@@ -675,7 +656,7 @@ Message:
const ItemPathFormat defaultItemPathFormatLeftGrid = ItemPathFormat::relative;
--- a/FreeFileSync/Source/ui/main_dlg.cpp
+++ b/FreeFileSync/Source/ui/main_dlg.cpp
-@@ -3016,6 +3016,8 @@ void MainDialog::onGridLabelContextRim(G
+@@ -3034,6 +3034,8 @@ void MainDialog::onGridLabelContextRim(G
addFormatEntry(_("Item name" ), ItemPathFormat::name);
addFormatEntry(_("Relative path"), ItemPathFormat::relative);
addFormatEntry(_("Full path" ), ItemPathFormat::full);
@@ -686,7 +667,7 @@ Message:
auto setIconSize = [&](GridIconSize sz, bool showIcons)
--- a/FreeFileSync/Source/config.cpp
+++ b/FreeFileSync/Source/config.cpp
-@@ -476,6 +476,12 @@ void writeText(const ItemPathFormat& val
+@@ -506,6 +506,12 @@ void writeText(const ItemPathFormat& val
case ItemPathFormat::full:
output = "Full";
break;
@@ -699,7 +680,7 @@ Message:
}
}
-@@ -489,6 +495,10 @@ bool readText(const std::string& input,
+@@ -519,6 +525,10 @@ bool readText(const std::string& input,
value = ItemPathFormat::relative;
else if (tmp == "Full")
value = ItemPathFormat::full;
@@ -712,7 +693,7 @@ Message:
return true;
--- a/FreeFileSync/Source/ui/file_view.cpp
+++ b/FreeFileSync/Source/ui/file_view.cpp
-@@ -798,6 +798,7 @@ void FileView::sortView(ColumnTypeRim ty
+@@ -795,6 +795,7 @@ void FileView::sortView(ColumnTypeRim ty
break;
case ItemPathFormat::relative:
@@ -720,7 +701,7 @@ Message:
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 @@ void FileView::sortView(ColumnTypeRim ty
+@@ -802,6 +803,7 @@ void FileView::sortView(ColumnTypeRim ty
break;
case ItemPathFormat::full:
bgstack15