Construct WindowControlsLayout without variable

This commit is contained in:
Ilya Fedin 2020-11-12 11:28:31 +04:00 committed by John Preston
parent 5c8a19b7f7
commit e4b9900a06
3 changed files with 28 additions and 31 deletions

View file

@ -964,31 +964,30 @@ Window::ControlsLayout WindowControlsLayout() {
); );
} }
Window::ControlsLayout controls; return Window::ControlsLayout{
controls.left = controlsLeft; .left = controlsLeft,
controls.right = controlsRight; .right = controlsRight
};
return controls;
} }
#endif // !TDESKTOP_DISABLE_GTK_INTEGRATION #endif // !TDESKTOP_DISABLE_GTK_INTEGRATION
Window::ControlsLayout controls;
if (DesktopEnvironment::IsUnity()) { if (DesktopEnvironment::IsUnity()) {
controls.left = { return Window::ControlsLayout{
Window::Control::Close, .left = {
Window::Control::Minimize, Window::Control::Close,
Window::Control::Maximize, Window::Control::Minimize,
Window::Control::Maximize,
}
}; };
} else { } else {
controls.right = { return Window::ControlsLayout{
Window::Control::Minimize, .right = {
Window::Control::Maximize, Window::Control::Minimize,
Window::Control::Close, Window::Control::Maximize,
Window::Control::Close,
}
}; };
} }
return controls;
} }
} // namespace Platform } // namespace Platform

View file

@ -204,14 +204,13 @@ void IgnoreApplicationActivationRightNow() {
} }
Window::ControlsLayout WindowControlsLayout() { Window::ControlsLayout WindowControlsLayout() {
Window::ControlsLayout controls; return Window::ControlsLayout{
controls.left = { .left = {
Window::Control::Close, Window::Control::Close,
Window::Control::Minimize, Window::Control::Minimize,
Window::Control::Maximize, Window::Control::Maximize,
}
}; };
return controls;
} }
} // namespace Platform } // namespace Platform

View file

@ -325,14 +325,13 @@ bool ShowWindowMenu(QWindow *window) {
} }
Window::ControlsLayout WindowControlsLayout() { Window::ControlsLayout WindowControlsLayout() {
Window::ControlsLayout controls; return Window::ControlsLayout{
controls.right = { .right = {
Window::Control::Minimize, Window::Control::Minimize,
Window::Control::Maximize, Window::Control::Maximize,
Window::Control::Close, Window::Control::Close,
}
}; };
return controls;
} }
} // namespace Platform } // namespace Platform