<commit_before>#include "TooltipWidget.hpp"

#include "BaseTheme.hpp"
#include "singletons/Fonts.hpp"

#include <QDebug>
#include <QDesktopWidget>
#include <QStyle>
#include <QVBoxLayout>

#ifdef USEWINSDK
#    include <Windows.h>
#endif

namespace chatterino {

TooltipWidget *TooltipWidget::instance()
{
    static TooltipWidget *tooltipWidget = new TooltipWidget();
    return tooltipWidget;
}

TooltipWidget::TooltipWidget(BaseWidget *parent)
    : BaseWindow(BaseWindow::TopMost, parent)
    , displayImage_(new QLabel())
    , displayText_(new QLabel())
{
    this->setStyleSheet("color: #fff; background: rgba(11, 11, 11, 0.8)");
    this->setAttribute(Qt::WA_TranslucentBackground);
    //this->setWindowOpacity(0.8);
    this->updateFont();
    this->setStayInScreenRect(true);

    this->setAttribute(Qt::WA_ShowWithoutActivating);
    this->setWindowFlags(Qt::Tool | Qt::FramelessWindowHint |
                         Qt::X11BypassWindowManagerHint |
                         Qt::BypassWindowManagerHint);

    displayImage_->hide();
    displayImage_->setAlignment(Qt::AlignHCenter);
    displayImage_->setStyleSheet("background: transparent");
    displayText_->setAlignment(Qt::AlignHCenter);
    displayText_->setText("tooltip text");
    displayText_->setStyleSheet("background: transparent");
    auto layout = new QVBoxLayout();
    layout->setContentsMargins(10, 5, 10, 5);<commit_msg>Simplify Tooltip flags on Linux for Sway (#1824)<commit_after>#include "TooltipWidget.hpp"

#include "BaseTheme.hpp"
#include "singletons/Fonts.hpp"

#include <QDebug>
#include <QDesktopWidget>
#include <QStyle>
#include <QVBoxLayout>

#ifdef USEWINSDK
#    include <Windows.h>
#endif

namespace chatterino {

TooltipWidget *TooltipWidget::instance()
{
    static TooltipWidget *tooltipWidget = new TooltipWidget();
    return tooltipWidget;
}

TooltipWidget::TooltipWidget(BaseWidget *parent)
    : BaseWindow(BaseWindow::TopMost, parent)
    , displayImage_(new QLabel())
    , displayText_(new QLabel())
{
    this->setStyleSheet("color: #fff; background: rgba(11, 11, 11, 0.8)");
    this->setAttribute(Qt::WA_TranslucentBackground);
    //this->setWindowOpacity(0.8);
    this->updateFont();
    this->setStayInScreenRect(true);

    this->setAttribute(Qt::WA_ShowWithoutActivating);
#ifdef Q_OS_LINUX
    this->setWindowFlags(Qt::ToolTip);
#else
    this->setWindowFlags(Qt::Tool | Qt::FramelessWindowHint |
                         Qt::X11BypassWindowManagerHint |
                         Qt::BypassWindowManagerHint);
#endif

    displayImage_->hide();
    displayImage_->setAlignment(Qt::AlignHCenter);
    displayImage_->setStyleSheet("background: transparent");
    displayText_->setAlignment(Qt::AlignHCenter);
    displayText_->setText("tooltip text");
    displayText_->setStyleSheet("background: transparent");
    auto layout = new QVBoxLayout();
    layout->setContentsMargins(10, 5, 10, 5);
{'fraction_non_alphanumeric': 0.13422588396841745, 'fraction_numerical': 0.013731548232063165, 'mean_word_length': 4.69140625, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 42, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '791726', 'n_tokens_mistral': 920, 'n_tokens_neox': 881, 'n_words': 153}