mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-02-25 01:50:36 +00:00
Enable third column by default in Mac App Store build.
This commit is contained in:
parent
3bb9e8c7eb
commit
82aa64ca0a
@ -13,6 +13,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "support/support_common.h"
|
||||
#include "storage/serialize_common.h"
|
||||
#include "boxes/send_files_box.h"
|
||||
#include "base/platform/base_platform_info.h"
|
||||
|
||||
namespace Main {
|
||||
namespace {
|
||||
@ -38,10 +39,17 @@ Settings::Variables::Variables()
|
||||
, selectorTab(ChatHelpers::SelectorTab::Emoji)
|
||||
, floatPlayerColumn(Window::Column::Second)
|
||||
, floatPlayerCorner(RectPart::TopRight)
|
||||
, dialogsWidthRatio(ThirdColumnByDefault()
|
||||
? kDefaultBigDialogsWidthRatio
|
||||
: kDefaultDialogsWidthRatio)
|
||||
, sendSubmitWay(Ui::InputSubmitSettings::Enter)
|
||||
, supportSwitch(Support::SwitchSettings::Next) {
|
||||
}
|
||||
|
||||
bool Settings::ThirdColumnByDefault() {
|
||||
return Platform::IsMacStoreBuild();
|
||||
}
|
||||
|
||||
QByteArray Settings::serialize() const {
|
||||
const auto autoDownload = _variables.autoDownload.serialize();
|
||||
auto size = sizeof(qint32) * 38;
|
||||
|
@ -254,11 +254,14 @@ public:
|
||||
_variables.videoPipGeometry = geometry;
|
||||
}
|
||||
|
||||
[[nodiscard]] static bool ThirdColumnByDefault();
|
||||
|
||||
private:
|
||||
struct Variables {
|
||||
Variables();
|
||||
|
||||
static constexpr auto kDefaultDialogsWidthRatio = 5. / 14;
|
||||
static constexpr auto kDefaultBigDialogsWidthRatio = 0.275;
|
||||
static constexpr auto kDefaultThirdColumnWidth = 0;
|
||||
|
||||
bool lastSeenWarningSeen = false;
|
||||
@ -273,8 +276,7 @@ private:
|
||||
bool thirdSectionInfoEnabled = true; // per-window
|
||||
bool smallDialogsList = false; // per-window
|
||||
int thirdSectionExtendedBy = -1; // per-window
|
||||
rpl::variable<float64> dialogsWidthRatio
|
||||
= kDefaultDialogsWidthRatio; // per-window
|
||||
rpl::variable<float64> dialogsWidthRatio; // per-window
|
||||
rpl::variable<int> thirdColumnWidth
|
||||
= kDefaultThirdColumnWidth; // per-window
|
||||
Ui::InputSubmitSettings sendSubmitWay;
|
||||
|
@ -398,15 +398,21 @@ void MainWindow::initSize() {
|
||||
? primaryScreen->availableGeometry()
|
||||
: QRect(0, 0, st::windowDefaultWidth, st::windowDefaultHeight);
|
||||
bool maximized = false;
|
||||
const auto initialWidth = Main::Settings::ThirdColumnByDefault()
|
||||
? st::windowBigDefaultWidth
|
||||
: st::windowDefaultWidth;
|
||||
const auto initialHeight = Main::Settings::ThirdColumnByDefault()
|
||||
? st::windowBigDefaultHeight
|
||||
: st::windowDefaultHeight;
|
||||
auto geometry = QRect(
|
||||
available.x() + std::max(
|
||||
(available.width() - st::windowDefaultWidth) / 2,
|
||||
(available.width() - initialWidth) / 2,
|
||||
0),
|
||||
available.y() + std::max(
|
||||
(available.height() - st::windowDefaultHeight) / 2,
|
||||
(available.height() - initialHeight) / 2,
|
||||
0),
|
||||
st::windowDefaultWidth,
|
||||
st::windowDefaultHeight);
|
||||
initialWidth,
|
||||
initialHeight);
|
||||
if (position.w && position.h) {
|
||||
for (auto screen : QGuiApplication::screens()) {
|
||||
if (position.moncrc == screenNameChecksum(screen->name())) {
|
||||
|
@ -14,6 +14,8 @@ windowMinWidth: 380px;
|
||||
windowMinHeight: 480px;
|
||||
windowDefaultWidth: 800px;
|
||||
windowDefaultHeight: 600px;
|
||||
windowBigDefaultWidth: 1024px;
|
||||
windowBigDefaultHeight: 768px;
|
||||
|
||||
columnMinimalWidthLeft: 260px;
|
||||
columnMaximalWidthLeft: 540px;
|
||||
|
Loading…
Reference in New Issue
Block a user