mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-07-26 15:33:02 +02:00
Ctrl+Click to open subsection in a new window.
This commit is contained in:
parent
3bc20c3550
commit
e9e187c58b
1 changed files with 13 additions and 5 deletions
|
@ -7,6 +7,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
*/
|
*/
|
||||||
#include "history/view/history_view_subsection_tabs.h"
|
#include "history/view/history_view_subsection_tabs.h"
|
||||||
|
|
||||||
|
#include "base/qt/qt_key_modifiers.h"
|
||||||
#include "core/ui_integration.h"
|
#include "core/ui_integration.h"
|
||||||
#include "data/stickers/data_custom_emoji.h"
|
#include "data/stickers/data_custom_emoji.h"
|
||||||
#include "data/data_channel.h"
|
#include "data/data_channel.h"
|
||||||
|
@ -35,6 +36,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "ui/dynamic_image.h"
|
#include "ui/dynamic_image.h"
|
||||||
#include "ui/dynamic_thumbnails.h"
|
#include "ui/dynamic_thumbnails.h"
|
||||||
#include "window/window_peer_menu.h"
|
#include "window/window_peer_menu.h"
|
||||||
|
#include "window/window_separate_id.h"
|
||||||
#include "window/window_session_controller.h"
|
#include "window/window_session_controller.h"
|
||||||
#include "styles/style_chat.h"
|
#include "styles/style_chat.h"
|
||||||
|
|
||||||
|
@ -209,13 +211,19 @@ void SubsectionTabs::setupSlider(
|
||||||
not_null<Ui::SubsectionSlider*> slider,
|
not_null<Ui::SubsectionSlider*> slider,
|
||||||
bool vertical) {
|
bool vertical) {
|
||||||
slider->sectionActivated() | rpl::start_with_next([=](int active) {
|
slider->sectionActivated() | rpl::start_with_next([=](int active) {
|
||||||
|
const auto newWindow = base::IsCtrlPressed();
|
||||||
if (active >= 0
|
if (active >= 0
|
||||||
&& active < _slice.size()
|
&& active < _slice.size()
|
||||||
&& _active != _slice[active].thread) {
|
&& (newWindow || _active != _slice[active].thread)) {
|
||||||
|
const auto thread = _slice[active].thread;
|
||||||
|
if (newWindow) {
|
||||||
|
_controller->showInNewWindow(Window::SeparateId(thread));
|
||||||
|
} else {
|
||||||
auto params = Window::SectionShow();
|
auto params = Window::SectionShow();
|
||||||
params.way = Window::SectionShow::Way::ClearStack;
|
params.way = Window::SectionShow::Way::ClearStack;
|
||||||
params.animated = anim::type::instant;
|
params.animated = anim::type::instant;
|
||||||
_controller->showThread(_slice[active].thread, {}, params);
|
_controller->showThread(thread, ShowAtUnreadMsgId, params);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}, slider->lifetime());
|
}, slider->lifetime());
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue