mirror of
https://github.com/RGBCube/serenity
synced 2025-06-01 09:18:11 +00:00
LibGUI+Userland: Stop returning Layout from Widget::(try_)set_layout()
Nobody uses this return value any more. It also lets us remove a whole bunch of `(void)` casts. :^)
This commit is contained in:
parent
77ad0fdb07
commit
6b66e39df4
20 changed files with 47 additions and 48 deletions
|
@ -83,19 +83,18 @@ public:
|
|||
void set_layout(NonnullRefPtr<Layout>);
|
||||
|
||||
template<class T, class... Args>
|
||||
ErrorOr<NonnullRefPtr<T>> try_set_layout(Args&&... args)
|
||||
ErrorOr<void> try_set_layout(Args&&... args)
|
||||
{
|
||||
auto layout = TRY(T::try_create(forward<Args>(args)...));
|
||||
set_layout(*layout);
|
||||
return layout;
|
||||
return {};
|
||||
}
|
||||
|
||||
template<class T, class... Args>
|
||||
inline T& set_layout(Args&&... args)
|
||||
inline void set_layout(Args&&... args)
|
||||
{
|
||||
auto layout = T::construct(forward<Args>(args)...);
|
||||
set_layout(*layout);
|
||||
return layout;
|
||||
}
|
||||
|
||||
UISize min_size() const { return m_min_size; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue