mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
CTRL+T opens new split in current page
This commit is contained in:
parent
5d30181d48
commit
3b9a9e8373
4 changed files with 31 additions and 0 deletions
|
@ -157,9 +157,11 @@ void ChatWidgetHeader::rightButtonClicked()
|
|||
|
||||
void ChatWidgetHeader::menuAddSplit()
|
||||
{
|
||||
printf("Add split for menu (NOT IMPLEMENTED KKarrot)\n");
|
||||
}
|
||||
void ChatWidgetHeader::menuCloseSplit()
|
||||
{
|
||||
printf("Close split\n");
|
||||
}
|
||||
void ChatWidgetHeader::menuMoveSplit()
|
||||
{
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
#include <QFormLayout>
|
||||
#include <QLayout>
|
||||
#include <QList>
|
||||
#include <QShortcut>
|
||||
#include <QStandardPaths>
|
||||
#include <QWidget>
|
||||
#include <boost/foreach.hpp>
|
||||
|
@ -41,6 +42,20 @@ Notebook::Notebook(QWidget *parent)
|
|||
[this](const bool &) { performLayout(); });
|
||||
SettingsManager::getInstance().hideUserButton.valueChanged.connect(
|
||||
[this](const bool &) { performLayout(); });
|
||||
|
||||
// Initialize notebook hotkeys
|
||||
{
|
||||
// CTRL+T: Create new split (Add page)
|
||||
auto shortcut = new QShortcut(QKeySequence("CTRL+T"), this);
|
||||
connect(shortcut, &QShortcut::activated, [this]() {
|
||||
printf("ctrL+t pressed\n"); //
|
||||
if (this->_selectedPage == nullptr) {
|
||||
return;
|
||||
}
|
||||
|
||||
this->_selectedPage->addChat();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
NotebookPage *Notebook::addPage(bool select)
|
||||
|
|
|
@ -49,6 +49,18 @@ NotebookTab *NotebookPage::getTab() const
|
|||
return _tab;
|
||||
}
|
||||
|
||||
void
|
||||
NotebookPage::addChat(bool openChannelNameDialog)
|
||||
{
|
||||
ChatWidget *w = new ChatWidget();
|
||||
|
||||
if (openChannelNameDialog) {
|
||||
w->showChangeChannelPopup();
|
||||
}
|
||||
|
||||
addToLayout(w, std::pair<int, int>(-1, -1));
|
||||
}
|
||||
|
||||
std::pair<int, int> NotebookPage::removeFromLayout(ChatWidget *widget)
|
||||
{
|
||||
// remove from chatWidgets vector
|
||||
|
|
|
@ -31,6 +31,8 @@ public:
|
|||
const std::vector<ChatWidget *> &getChatWidgets() const;
|
||||
NotebookTab *getTab() const;
|
||||
|
||||
void addChat(bool openChannelNameDialog = false);
|
||||
|
||||
static bool isDraggingSplit;
|
||||
static ChatWidget *draggingSplit;
|
||||
static std::pair<int, int> dropPosition;
|
||||
|
|
Loading…
Reference in a new issue