oh no the bad commit descriptions are back D:
This commit is contained in:
@@ -79,15 +79,11 @@ ChannelView::ChannelView(BaseWidget *parent)
|
||||
this->updateTimer.start();
|
||||
});
|
||||
|
||||
auto _split = this->parent();
|
||||
auto _splitContainer = _split->parent();
|
||||
auto _notebook = _splitContainer->parent();
|
||||
auto _window = qobject_cast<Window*>(_notebook->parent());
|
||||
Window *_window = dynamic_cast<Window *>(this->window());
|
||||
|
||||
assert(_window);
|
||||
|
||||
_window->lostFocus.connect(
|
||||
[this] { TooltipWidget::getInstance()->hide(); });
|
||||
if (_window) {
|
||||
_window->lostFocus.connect([this] { TooltipWidget::getInstance()->hide(); });
|
||||
}
|
||||
}
|
||||
|
||||
ChannelView::~ChannelView()
|
||||
@@ -283,7 +279,7 @@ QString ChannelView::getSelectedText()
|
||||
text += "\n";
|
||||
|
||||
// middle lines
|
||||
for (i++; i < this->selection.max.messageIndex; i++) {
|
||||
for (i++; (int)i < this->selection.max.messageIndex; i++) {
|
||||
for (const messages::WordPart &part : messagesSnapshot[i]->getWordParts()) {
|
||||
if (!part.getCopyText().isEmpty()) {
|
||||
text += part.getCopyText();
|
||||
|
||||
@@ -45,8 +45,6 @@ inline void ezShortcut(Split *w, const char *key, T t)
|
||||
|
||||
} // namespace
|
||||
|
||||
static int index = 0;
|
||||
|
||||
Split::Split(ChannelManager &_channelManager, SplitContainer *parent, const std::string &_uuid)
|
||||
: BaseWidget(parent)
|
||||
, uuid(_uuid)
|
||||
|
||||
@@ -12,27 +12,29 @@ TooltipWidget::TooltipWidget(BaseWidget *parent)
|
||||
: BaseWidget(parent)
|
||||
, displayText(new QLabel())
|
||||
{
|
||||
QColor black(0,0,0);
|
||||
QColor white(255,255,255);
|
||||
QColor black(0, 0, 0);
|
||||
QColor white(255, 255, 255);
|
||||
|
||||
QPalette palette;
|
||||
palette.setColor(QPalette::WindowText,white);
|
||||
palette.setColor(QPalette::Background,black);
|
||||
palette.setColor(QPalette::WindowText, white);
|
||||
palette.setColor(QPalette::Background, black);
|
||||
this->setPalette(palette);
|
||||
this->setWindowOpacity(0.8);
|
||||
this->setFont(FontManager::getInstance().getFont(FontManager::Type::MediumSmall));
|
||||
this->setFont(FontManager::getInstance().getFont(FontManager::Type::MediumSmall,
|
||||
this->getDpiMultiplier()));
|
||||
|
||||
this->setAttribute(Qt::WA_ShowWithoutActivating);
|
||||
this->setWindowFlags(Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint);
|
||||
|
||||
displayText->setAlignment(Qt::AlignHCenter);
|
||||
auto layout = new QVBoxLayout();
|
||||
layout->setContentsMargins(10,5,10,5);
|
||||
layout->setContentsMargins(10, 5, 10, 5);
|
||||
layout->addWidget(displayText);
|
||||
this->setLayout(layout);
|
||||
|
||||
FontManager::getInstance().fontChanged.connect([this] {
|
||||
this->setFont(FontManager::getInstance().getFont(FontManager::Type::MediumSmall));
|
||||
this->setFont(FontManager::getInstance().getFont(FontManager::Type::MediumSmall,
|
||||
this->getDpiMultiplier()));
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#pragma once
|
||||
#include "widgets/basewidget.hpp"
|
||||
|
||||
#include <QWidget>
|
||||
#include <QLabel>
|
||||
#include <QWidget>
|
||||
|
||||
namespace chatterino {
|
||||
namespace widgets {
|
||||
@@ -16,11 +16,10 @@ public:
|
||||
void setText(QString text);
|
||||
void moveTo(QPoint point);
|
||||
|
||||
static TooltipWidget* getInstance()
|
||||
static TooltipWidget *getInstance()
|
||||
{
|
||||
static TooltipWidget *tooltipWidget = nullptr;
|
||||
if(tooltipWidget == nullptr)
|
||||
{
|
||||
if (tooltipWidget == nullptr) {
|
||||
tooltipWidget = new TooltipWidget();
|
||||
}
|
||||
return tooltipWidget;
|
||||
|
||||
@@ -19,10 +19,10 @@ Window::Window(const QString &windowName, ChannelManager &_channelManager,
|
||||
: BaseWidget(_colorScheme, nullptr)
|
||||
, settingRoot(fS("/windows/{}", windowName))
|
||||
, windowGeometry(this->settingRoot)
|
||||
, dpi(this->getDpiMultiplier())
|
||||
, channelManager(_channelManager)
|
||||
, colorScheme(_colorScheme)
|
||||
, notebook(this->channelManager, this, _isMainWindow, this->settingRoot)
|
||||
, dpi(this->getDpiMultiplier())
|
||||
{
|
||||
this->initAsWindow();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user