summaryrefslogtreecommitdiff
path: root/wx+
diff options
context:
space:
mode:
authorB. Stack <bgstack15@gmail.com>2023-07-24 15:08:16 -0400
committerB. Stack <bgstack15@gmail.com>2023-07-24 15:08:16 -0400
commit69e12f5bd10459ff7c239b82519107ae2a755bc0 (patch)
tree8b22393241df7e46686c9426140582bd747a6d5a /wx+
parentadd upstream 12.4 (diff)
downloadFreeFileSync-69e12f5bd10459ff7c239b82519107ae2a755bc0.tar.gz
FreeFileSync-69e12f5bd10459ff7c239b82519107ae2a755bc0.tar.bz2
FreeFileSync-69e12f5bd10459ff7c239b82519107ae2a755bc0.zip
add upstream 12.5
Diffstat (limited to 'wx+')
-rw-r--r--wx+/bitmap_button.h4
-rw-r--r--wx+/grid.cpp18
-rw-r--r--wx+/no_flicker.h2
-rw-r--r--wx+/popup_dlg.cpp4
-rw-r--r--wx+/taskbar.h12
5 files changed, 23 insertions, 17 deletions
diff --git a/wx+/bitmap_button.h b/wx+/bitmap_button.h
index 188ee607..bbae6397 100644
--- a/wx+/bitmap_button.h
+++ b/wx+/bitmap_button.h
@@ -44,8 +44,8 @@ void setImage(wxStaticBitmap& staticBmp, const wxImage& img);
wxImage renderPressedButton(const wxSize& sz);
-inline wxColor getColorToggleButtonBorder(){ return {0x79, 0xbc, 0xed}; } //medium blue
-inline wxColor getColorToggleButtonFill (){ return {0xcc, 0xe4, 0xf8}; } //light blue
+inline wxColor getColorToggleButtonBorder() { return {0x79, 0xbc, 0xed}; } //medium blue
+inline wxColor getColorToggleButtonFill () { return {0xcc, 0xe4, 0xf8}; } //light blue
diff --git a/wx+/grid.cpp b/wx+/grid.cpp
index 8d3dbea9..68f40fb6 100644
--- a/wx+/grid.cpp
+++ b/wx+/grid.cpp
@@ -129,17 +129,23 @@ void GridData::renderCell(wxDC& dc, const wxRect& rect, size_t row, ColumnType c
int GridData::getBestSize(wxDC& dc, size_t row, ColumnType colType)
{
- return dc.GetTextExtent(getValue(row, colType)).GetWidth() + 2 * getColumnGapLeft() + 1; //gap on left and right side + border
+ return dc.GetTextExtent(getValue(row, colType)).GetWidth() + 2 * getColumnGapLeft() + fastFromDIP(1); //gap on left and right side + border
}
wxRect GridData::drawCellBorder(wxDC& dc, const wxRect& rect) //returns remaining rectangle
{
- wxDCPenChanger dummy2(dc, wxPen(getColorGridLine(), fastFromDIP(1)));
- dc.DrawLine(rect.GetBottomLeft(), rect.GetBottomRight());
- dc.DrawLine(rect.GetBottomRight(), rect.GetTopRight() + wxPoint(0, -1));
+ //following code is adapted from clearArea():
+ assert(getColorGridLine().IsSolid());
+ //wxDC::DrawRectangle() just widens inner area if wxTRANSPARENT_PEN is used!
+ //bonus: wxTRANSPARENT_PEN is about 2x faster than redundantly drawing with col!
+ wxDCPenChanger areaPen (dc, *wxTRANSPARENT_PEN);
+ wxDCBrushChanger areaBrush(dc, getColorGridLine());
- return wxRect(rect.GetTopLeft(), wxSize(rect.width - 1, rect.height - 1));
+ dc.DrawRectangle(rect.x + rect.width - fastFromDIP(1), rect.y, fastFromDIP(1), rect.height); //right border
+ dc.DrawRectangle(rect.x, rect.y + rect.height - fastFromDIP(1), rect.width, fastFromDIP(1)); //bottom border
+
+ return wxRect(rect.GetTopLeft(), wxSize(rect.width - fastFromDIP(1), rect.height - fastFromDIP(1)));
}
@@ -439,7 +445,7 @@ class Grid::RowLabelWin : public SubWindow
public:
explicit RowLabelWin(Grid& parent) :
SubWindow(parent),
- rowHeight_(parent.GetCharHeight() + 2 + 1) {} //default height; don't call any functions on "parent" other than those from wxWindow during construction!
+ rowHeight_(parent.GetCharHeight() + fastFromDIP(2) + fastFromDIP(1)) {} //default height; don't call any functions on "parent" other than those from wxWindow during construction!
//2 for some more space, 1 for bottom border (gives 15 + 2 + 1 on Windows, 17 + 2 + 1 on Ubuntu)
int getBestWidth(ptrdiff_t rowFrom, ptrdiff_t rowTo)
diff --git a/wx+/no_flicker.h b/wx+/no_flicker.h
index 8a461db3..3d7c0ee0 100644
--- a/wx+/no_flicker.h
+++ b/wx+/no_flicker.h
@@ -55,7 +55,7 @@ void setTextWithUrls(wxRichTextCtrl& richCtrl, const wxString& newText)
for (auto it = newText.begin();;)
{
- const std::wstring_view urlPrefix = L"https://";
+ constexpr std::wstring_view urlPrefix = L"https://";
const auto itUrl = std::search(it, newText.end(), urlPrefix.begin(), urlPrefix.end());
if (it != itUrl)
blocks.emplace_back(BlockType::text, wxString(it, itUrl));
diff --git a/wx+/popup_dlg.cpp b/wx+/popup_dlg.cpp
index 9f29badc..5254ff29 100644
--- a/wx+/popup_dlg.cpp
+++ b/wx+/popup_dlg.cpp
@@ -123,10 +123,10 @@ public:
case DialogInfoType::info:
break;
case DialogInfoType::warning:
- taskbar_->setStatus(Taskbar::STATUS_WARNING);
+ taskbar_->setStatus(Taskbar::Status::warning);
break;
case DialogInfoType::error:
- taskbar_->setStatus(Taskbar::STATUS_ERROR);
+ taskbar_->setStatus(Taskbar::Status::error);
break;
}
}
diff --git a/wx+/taskbar.h b/wx+/taskbar.h
index 985d89b4..f660013e 100644
--- a/wx+/taskbar.h
+++ b/wx+/taskbar.h
@@ -21,13 +21,13 @@ public:
Taskbar(wxWindow* window); //throw TaskbarNotAvailable
~Taskbar();
- enum Status
+ enum class Status
{
- STATUS_NORMAL,
- STATUS_INDETERMINATE,
- STATUS_WARNING,
- STATUS_ERROR,
- STATUS_PAUSED
+ normal,
+ indeterminate,
+ warning,
+ error,
+ paused,
};
void setStatus(Status status); //noexcept
bgstack15