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