mirror of
https://hubproxy.babadafafafafa.cn/https://github.com/telegramdesktop/tdesktop
synced 2026-09-20 08:03:45 +08:00
Moved out media group layout geometry to separate module.
This commit is contained in:
28
Telegram/SourceFiles/ui/grouped_layout_geometry.cpp
Normal file
28
Telegram/SourceFiles/ui/grouped_layout_geometry.cpp
Normal file
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
This file is part of Telegram Desktop,
|
||||
the official desktop application for the Telegram messaging service.
|
||||
|
||||
For license and copyright information please follow this link:
|
||||
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
*/
|
||||
#include "ui/grouped_layout_geometry.h"
|
||||
|
||||
#include "ui/grouped_layout.h"
|
||||
|
||||
namespace Ui {
|
||||
|
||||
std::vector<QRect> LayoutMediaGroupGeometry(
|
||||
const std::vector<QSize> &sizes,
|
||||
int maxWidth,
|
||||
int minWidth,
|
||||
int spacing) {
|
||||
const auto layout = LayoutMediaGroup(sizes, maxWidth, minWidth, spacing);
|
||||
auto result = std::vector<QRect>();
|
||||
result.reserve(layout.size());
|
||||
for (const auto &part : layout) {
|
||||
result.push_back(part.geometry);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
} // namespace Ui
|
||||
22
Telegram/SourceFiles/ui/grouped_layout_geometry.h
Normal file
22
Telegram/SourceFiles/ui/grouped_layout_geometry.h
Normal file
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
This file is part of Telegram Desktop,
|
||||
the official desktop application for the Telegram messaging service.
|
||||
|
||||
For license and copyright information please follow this link:
|
||||
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <QtCore/QRect>
|
||||
|
||||
namespace Ui {
|
||||
|
||||
// LayoutMediaGroup without the per-item sides, so that targets which do
|
||||
// not link lib_ui, like td_export, can use the same album geometry.
|
||||
[[nodiscard]] std::vector<QRect> LayoutMediaGroupGeometry(
|
||||
const std::vector<QSize> &sizes,
|
||||
int maxWidth,
|
||||
int minWidth,
|
||||
int spacing);
|
||||
|
||||
} // namespace Ui
|
||||
@@ -636,6 +636,8 @@ PRIVATE
|
||||
ui/empty_userpic.h
|
||||
ui/grouped_layout.cpp
|
||||
ui/grouped_layout.h
|
||||
ui/grouped_layout_geometry.cpp
|
||||
ui/grouped_layout_geometry.h
|
||||
ui/new_badges.cpp
|
||||
ui/new_badges.h
|
||||
ui/peer/color_sample.cpp
|
||||
|
||||
Reference in New Issue
Block a user