Repos
C++
919 B24 lines Opens in site
Directory
Raw
Download
#include "screens/messages/ContentUnavailable.hpp"
#include "spec/SocialSpec.hpp"
#include "ui/Palette.hpp"
namespace dp {
using namespace ui;
ViewPtr ContentUnavailable::view(const std::string& icon, const std::string& title, const std::string& description) {
using M = spec::SocialMetrics;
return VStack({Icon(icon, M::kEmptyIcon)->foreground(Palette::gray()),
Text(title)->font(FontSpec::system(M::kEmptyTitle, Weight::Semibold))->foreground(Palette::fg1())
->multilineAlign(TextAlign::Center),
Text(description)->font(FontSpec::subheadline())->foreground(Palette::fg2())->multilineAlign(TextAlign::Center)},
M::kEmptySpacing, HAlign::Center)
->paddingH(M::kEmptyHintInset);
}
ViewPtr ContentUnavailable::listState(ViewPtr content) {
return content->maxWidth()->paddingTop(spec::SocialMetrics::kEmptyTop);
}
} // namespace dp