mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
added custom window frame title
This commit is contained in:
parent
fa3c812697
commit
1290d28b1a
|
@ -19,6 +19,7 @@
|
|||
#include <gdiplus.h>
|
||||
#include <windowsx.h>
|
||||
#pragma comment(lib, "Dwmapi.lib")
|
||||
#pragma comment(lib, "Gdi32.lib")
|
||||
|
||||
#include <QHBoxLayout>
|
||||
#include <QVBoxLayout>
|
||||
|
@ -70,11 +71,14 @@ void BaseWindow::init()
|
|||
layout->addLayout(buttonLayout);
|
||||
|
||||
// title
|
||||
// QLabel *title = new QLabel(" Chatterino");
|
||||
QLabel *title = new QLabel("");
|
||||
QSizePolicy policy(QSizePolicy::MinimumExpanding, QSizePolicy::Preferred);
|
||||
QLabel *title = new QLabel(" Chatterino");
|
||||
QObject::connect(this, &QWidget::windowTitleChanged,
|
||||
[title](const QString &text) { title->setText(" " + text); });
|
||||
|
||||
QSizePolicy policy(QSizePolicy::Ignored, QSizePolicy::Preferred);
|
||||
policy.setHorizontalStretch(1);
|
||||
title->setBaseSize(0, 0);
|
||||
// title->setBaseSize(0, 0);
|
||||
title->setScaledContents(true);
|
||||
title->setSizePolicy(policy);
|
||||
buttonLayout->addWidget(title);
|
||||
this->ui.titleLabel = title;
|
||||
|
@ -106,7 +110,7 @@ void BaseWindow::init()
|
|||
this->ui.buttons.push_back(_maxButton);
|
||||
this->ui.buttons.push_back(_exitButton);
|
||||
|
||||
buttonLayout->addStretch(1);
|
||||
// buttonLayout->addStretch(1);
|
||||
buttonLayout->addWidget(_minButton);
|
||||
buttonLayout->addWidget(_maxButton);
|
||||
buttonLayout->addWidget(_exitButton);
|
||||
|
@ -167,6 +171,11 @@ void BaseWindow::themeRefreshEvent()
|
|||
palette.setColor(QPalette::Foreground, this->themeManager.window.text);
|
||||
this->setPalette(palette);
|
||||
|
||||
QPalette palette_title;
|
||||
palette_title.setColor(QPalette::Foreground,
|
||||
this->themeManager.isLightTheme() ? "#333" : "#ccc");
|
||||
this->ui.titleLabel->setPalette(palette_title);
|
||||
|
||||
for (RippleEffectButton *button : this->ui.buttons) {
|
||||
button->setMouseEffectColor(this->themeManager.window.text);
|
||||
}
|
||||
|
@ -185,7 +194,7 @@ void BaseWindow::addTitleBarButton(const TitleBarButton::Style &style,
|
|||
button->setScaleIndependantSize(30, 30);
|
||||
|
||||
this->ui.buttons.push_back(button);
|
||||
this->ui.titlebarBox->insertWidget(2, button);
|
||||
this->ui.titlebarBox->insertWidget(1, button);
|
||||
button->setButtonStyle(style);
|
||||
|
||||
QObject::connect(button, &TitleBarButton::clicked, this, [onClicked] { onClicked(); });
|
||||
|
@ -197,7 +206,7 @@ RippleEffectLabel *BaseWindow::addTitleBarLabel(std::function<void()> onClicked)
|
|||
button->setScaleIndependantHeight(30);
|
||||
|
||||
this->ui.buttons.push_back(button);
|
||||
this->ui.titlebarBox->insertWidget(2, button);
|
||||
this->ui.titlebarBox->insertWidget(1, button);
|
||||
|
||||
QObject::connect(button, &RippleEffectLabel::clicked, this, [onClicked] { onClicked(); });
|
||||
|
||||
|
|
|
@ -48,6 +48,8 @@ EmotePopup::EmotePopup(singletons::ThemeManager &themeManager)
|
|||
|
||||
void EmotePopup::loadChannel(ChannelPtr _channel)
|
||||
{
|
||||
this->setWindowTitle("Emotes from " + _channel->name);
|
||||
|
||||
TwitchChannel *channel = dynamic_cast<TwitchChannel *>(_channel.get());
|
||||
|
||||
if (channel == nullptr) {
|
||||
|
|
|
@ -342,8 +342,10 @@ void NotebookTab2::leaveEvent(QEvent *)
|
|||
|
||||
void NotebookTab2::dragEnterEvent(QDragEnterEvent *)
|
||||
{
|
||||
if (this->notebook->getAllowUserTabManagement()) {
|
||||
this->notebook->select(this->page);
|
||||
}
|
||||
}
|
||||
|
||||
void NotebookTab2::mouseMoveEvent(QMouseEvent *event)
|
||||
{
|
||||
|
|
|
@ -19,6 +19,8 @@ SelectChannelDialog::SelectChannelDialog()
|
|||
: BaseWindow((QWidget *)nullptr, true)
|
||||
, selectedChannel(Channel::getEmpty())
|
||||
{
|
||||
this->setWindowTitle("Select a channel to join");
|
||||
|
||||
this->tabFilter.dialog = this;
|
||||
|
||||
util::LayoutCreator<QWidget> layoutWidget(this->getLayoutContainer());
|
||||
|
|
|
@ -100,6 +100,8 @@ Window::Window(singletons::ThemeManager &_themeManager, WindowType _type)
|
|||
// static int index = 0;
|
||||
// ircManager.addFakeMessage(cheerMessages[index++ % cheerMessages.size()]);
|
||||
// });
|
||||
|
||||
this->setWindowTitle("Chatterino 2 Development Build");
|
||||
}
|
||||
|
||||
Window::WindowType Window::getType()
|
||||
|
|
Loading…
Reference in a new issue