mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Added "new-windows-size-as-first" option.
This commit is contained in:
parent
19ab740da2
commit
909f3bf011
3 changed files with 19 additions and 3 deletions
|
@ -26,6 +26,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
#include "media/player/media_player_instance.h"
|
#include "media/player/media_player_instance.h"
|
||||||
#include "webview/webview_embed.h"
|
#include "webview/webview_embed.h"
|
||||||
|
#include "window/main_window.h"
|
||||||
#include "window/window_peer_menu.h"
|
#include "window/window_peer_menu.h"
|
||||||
#include "window/window_session_controller.h"
|
#include "window/window_session_controller.h"
|
||||||
#include "window/window_controller.h"
|
#include "window/window_controller.h"
|
||||||
|
@ -155,6 +156,7 @@ void SetupExperimental(
|
||||||
addToggle(Window::Notifications::kOptionGNotification);
|
addToggle(Window::Notifications::kOptionGNotification);
|
||||||
addToggle(Core::kOptionFreeType);
|
addToggle(Core::kOptionFreeType);
|
||||||
addToggle(Data::kOptionExternalVideoPlayer);
|
addToggle(Data::kOptionExternalVideoPlayer);
|
||||||
|
addToggle(Window::kOptionNewWindowsSizeAsFirst);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
|
@ -72,7 +72,15 @@ using Core::WindowPosition;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
base::options::toggle OptionNewWindowsSizeAsFirst({
|
||||||
|
.id = kOptionNewWindowsSizeAsFirst,
|
||||||
|
.name = "Adjust size of new chat windows.",
|
||||||
|
.description = "Open new windows with a size of the main window.",
|
||||||
|
});
|
||||||
|
|
||||||
|
} // namespace.
|
||||||
|
|
||||||
|
const char kOptionNewWindowsSizeAsFirst[] = "new-windows-size-as-first";
|
||||||
|
|
||||||
const QImage &Logo() {
|
const QImage &Logo() {
|
||||||
static const auto result = QImage(u":/gui/art/logo_256.png"_q);
|
static const auto result = QImage(u":/gui/art/logo_256.png"_q);
|
||||||
|
@ -616,8 +624,12 @@ WindowPosition MainWindow::nextInitialChildPosition(bool primary) {
|
||||||
const auto adjust = [&](int value) {
|
const auto adjust = [&](int value) {
|
||||||
return primary ? value : (value * 3 / 4);
|
return primary ? value : (value * 3 / 4);
|
||||||
};
|
};
|
||||||
const auto width = adjust(st::windowDefaultWidth);
|
const auto width = OptionNewWindowsSizeAsFirst.value()
|
||||||
const auto height = adjust(st::windowDefaultHeight);
|
? Core::App().settings().windowPosition().w
|
||||||
|
: adjust(st::windowDefaultWidth);
|
||||||
|
const auto height = OptionNewWindowsSizeAsFirst.value()
|
||||||
|
? Core::App().settings().windowPosition().h
|
||||||
|
: adjust(st::windowDefaultHeight);
|
||||||
const auto skip = ChildSkip();
|
const auto skip = ChildSkip();
|
||||||
const auto delta = _lastChildIndex
|
const auto delta = _lastChildIndex
|
||||||
? (_lastMyChildCreatePosition - position)
|
? (_lastMyChildCreatePosition - position)
|
||||||
|
|
|
@ -54,6 +54,8 @@ struct CounterLayerArgs {
|
||||||
required<style::color> fg;
|
required<style::color> fg;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
extern const char kOptionNewWindowsSizeAsFirst[];
|
||||||
|
|
||||||
[[nodiscard]] QImage GenerateCounterLayer(CounterLayerArgs &&args);
|
[[nodiscard]] QImage GenerateCounterLayer(CounterLayerArgs &&args);
|
||||||
[[nodiscard]] QImage WithSmallCounter(QImage image, CounterLayerArgs &&args);
|
[[nodiscard]] QImage WithSmallCounter(QImage image, CounterLayerArgs &&args);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue