mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-01 14:21:16 +00:00
C++: use default operator==
Since we now use C++20, we can simplify our code a bit
This commit is contained in:
parent
36e07b8801
commit
319704d3fb
8 changed files with 13 additions and 75 deletions
|
@ -54,6 +54,7 @@ using ItemTreeNode = cbindgen_private::ItemTreeNode<uint8_t>;
|
|||
using cbindgen_private::KeyboardModifiers;
|
||||
using cbindgen_private::KeyEvent;
|
||||
using cbindgen_private::PointerEvent;
|
||||
using cbindgen_private::StandardListViewItem;
|
||||
|
||||
/// Internal function that checks that the API that must be called from the main
|
||||
/// thread is indeed called from the main thread, or abort the program otherwise
|
||||
|
@ -393,18 +394,6 @@ inline LayoutInfo LayoutInfo::merge(const LayoutInfo &other) const
|
|||
std::max(preferred, other.preferred),
|
||||
std::min(stretch, other.stretch) };
|
||||
}
|
||||
|
||||
/// FIXME! this should be done by cbindgen
|
||||
inline bool operator==(const LayoutInfo &a, const LayoutInfo &b)
|
||||
{
|
||||
return a.min == b.min && a.max == b.max && a.min_percent == b.min_percent
|
||||
&& a.max_percent == b.max_percent && a.preferred == b.preferred
|
||||
&& a.stretch == b.stretch;
|
||||
}
|
||||
inline bool operator!=(const LayoutInfo &a, const LayoutInfo &b)
|
||||
{
|
||||
return !(a == b);
|
||||
}
|
||||
}
|
||||
|
||||
namespace private_api {
|
||||
|
@ -821,20 +810,6 @@ cbindgen_private::NativeStyleMetrics::~NativeStyleMetrics()
|
|||
}
|
||||
#endif // !defined(DOXYGEN)
|
||||
|
||||
using cbindgen_private::StandardListViewItem;
|
||||
namespace cbindgen_private {
|
||||
inline bool operator==(const StandardListViewItem &a, const StandardListViewItem &b)
|
||||
{
|
||||
static_assert(sizeof(StandardListViewItem) == sizeof(std::tuple<SharedString>),
|
||||
"must update to cover all fields");
|
||||
return a.text == b.text;
|
||||
}
|
||||
inline bool operator!=(const StandardListViewItem &a, const StandardListViewItem &b)
|
||||
{
|
||||
return !(a == b);
|
||||
}
|
||||
}
|
||||
|
||||
namespace private_api {
|
||||
// Code generated by SixtyFPS <= 0.1.5 uses this enum with VersionCheckHelper
|
||||
enum class [[deprecated]] VersionCheck { Major = SIXTYFPS_VERSION_MAJOR,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue