2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

New main menu in DialogsWidget.

Also "flip_horizontal" and "flip_vertical" modifiers support added.
Also moving parts of MainWindow to Window::MainWindow.
This commit is contained in:
John Preston
2016-11-04 14:14:47 +03:00
parent 0cbb0014db
commit 3a599e0752
86 changed files with 565 additions and 774 deletions

View File

@@ -25,7 +25,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
namespace base {
template <typename T, size_t N>
inline constexpr size_t array_size(T(&)[N]) {
inline constexpr size_t array_size(const T(&)[N]) {
return N;
}
@@ -35,6 +35,27 @@ inline T take(T &source, T &&new_value = T()) {
return std_::move(new_value);
}
namespace internal {
template <typename D, typename T>
inline constexpr D up_cast_helper(std_::true_type, T object) {
return object;
}
template <typename D, typename T>
inline constexpr D up_cast_helper(std_::false_type, T object) {
return nullptr;
}
} // namespace internal
template <typename D, typename T>
inline constexpr D up_cast(T object) {
using DV = std_::decay_simple_t<decltype(*D())>;
using TV = std_::decay_simple_t<decltype(*T())>;
return internal::up_cast_helper<D>(std_::integral_constant<bool, std_::is_base_of<DV, TV>::value || std_::is_same<DV, TV>::value>(), object);
}
} // namespace base
template <typename Enum>