mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
added custom window frame to the emote popup
This commit is contained in:
parent
4743e9f86c
commit
e8a948cffc
|
@ -6,6 +6,7 @@
|
||||||
#include "messages/messagebuilder.hpp"
|
#include "messages/messagebuilder.hpp"
|
||||||
#include "providers/twitch/twitchchannel.hpp"
|
#include "providers/twitch/twitchchannel.hpp"
|
||||||
#include "singletons/accountmanager.hpp"
|
#include "singletons/accountmanager.hpp"
|
||||||
|
#include "widgets/notebook.hpp"
|
||||||
|
|
||||||
using namespace chatterino::providers::twitch;
|
using namespace chatterino::providers::twitch;
|
||||||
using namespace chatterino::messages;
|
using namespace chatterino::messages;
|
||||||
|
@ -14,7 +15,7 @@ namespace chatterino {
|
||||||
namespace widgets {
|
namespace widgets {
|
||||||
|
|
||||||
EmotePopup::EmotePopup(singletons::ThemeManager &themeManager)
|
EmotePopup::EmotePopup(singletons::ThemeManager &themeManager)
|
||||||
: BaseWindow(themeManager, 0)
|
: BaseWindow(themeManager, nullptr, true)
|
||||||
{
|
{
|
||||||
this->viewEmotes = new ChannelView();
|
this->viewEmotes = new ChannelView();
|
||||||
this->viewEmojis = new ChannelView();
|
this->viewEmojis = new ChannelView();
|
||||||
|
@ -27,13 +28,15 @@ EmotePopup::EmotePopup(singletons::ThemeManager &themeManager)
|
||||||
this->viewEmotes->setEnableScrollingToBottom(false);
|
this->viewEmotes->setEnableScrollingToBottom(false);
|
||||||
this->viewEmojis->setEnableScrollingToBottom(false);
|
this->viewEmojis->setEnableScrollingToBottom(false);
|
||||||
|
|
||||||
this->setLayout(new QVBoxLayout(this));
|
auto *layout = new QVBoxLayout(this);
|
||||||
|
this->getLayoutContainer()->setLayout(layout);
|
||||||
|
|
||||||
QTabWidget *tabs = new QTabWidget(this);
|
Notebook2 *notebook = new Notebook2(this);
|
||||||
this->layout()->addWidget(tabs);
|
layout->addWidget(notebook);
|
||||||
this->layout()->setMargin(0);
|
layout->setMargin(0);
|
||||||
tabs->addTab(this->viewEmotes, "Emotes");
|
|
||||||
tabs->addTab(this->viewEmojis, "Emojis");
|
notebook->addPage(this->viewEmotes, "Emotes");
|
||||||
|
notebook->addPage(this->viewEmojis, "Emojis");
|
||||||
|
|
||||||
this->loadEmojis();
|
this->loadEmojis();
|
||||||
|
|
||||||
|
|
|
@ -36,11 +36,16 @@ Notebook2::Notebook2(QWidget *parent)
|
||||||
QObject::connect(shortcut_prev, &QShortcut::activated, [this] { this->selectPreviousTab(); });
|
QObject::connect(shortcut_prev, &QShortcut::activated, [this] { this->selectPreviousTab(); });
|
||||||
}
|
}
|
||||||
|
|
||||||
NotebookTab2 *Notebook2::addPage(QWidget *page, bool select)
|
NotebookTab2 *Notebook2::addPage(QWidget *page, QString title, bool select)
|
||||||
{
|
{
|
||||||
auto *tab = new NotebookTab2(this);
|
auto *tab = new NotebookTab2(this);
|
||||||
tab->page = page;
|
tab->page = page;
|
||||||
|
|
||||||
|
if (!title.isEmpty()) {
|
||||||
|
tab->setTitle(title);
|
||||||
|
tab->useDefaultTitle = false;
|
||||||
|
}
|
||||||
|
|
||||||
Item item;
|
Item item;
|
||||||
item.page = page;
|
item.page = page;
|
||||||
item.tab = tab;
|
item.tab = tab;
|
||||||
|
|
|
@ -21,7 +21,7 @@ class Notebook2 : public BaseWidget
|
||||||
public:
|
public:
|
||||||
explicit Notebook2(QWidget *parent);
|
explicit Notebook2(QWidget *parent);
|
||||||
|
|
||||||
NotebookTab2 *addPage(QWidget *page, bool select = false);
|
NotebookTab2 *addPage(QWidget *page, QString title = QString(), bool select = false);
|
||||||
void removePage(QWidget *page);
|
void removePage(QWidget *page);
|
||||||
void removeCurrentPage();
|
void removeCurrentPage();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue