Moved out media group layout geometry to separate module.

This commit is contained in:
23rd
2026-08-08 21:31:41 +03:00
parent 344b43ed96
commit b988b6254e
3 changed files with 52 additions and 0 deletions

View 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

View 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

View File

@@ -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