<commit_before>#ifndef RAZORBAR_CPP
#define RAZORBAR_CPP

#include "razor.h"
#include "razorbar.h"
/**
 * @file razorbar.cpp
 * @brief implements Razorbar, the bar-menu on the bottom
 * @author Christopher "VdoP" Regali
 */


/**
 * @brief constructor
 */
Razorbar::Razorbar()
{
    /*QDialog* bla = new QDialog(NULL,Qt::FramelessWindowHint | Qt::Dialog);
    bla->show();
    */
    qDebug() << "blobb" << Razor::getInstance().get_looknfeel()->getInt("razorbar_height");
    setWindowFlags(Qt::FramelessWindowHint | Qt::Dialog | Qt::WindowStaysOnTopHint);
    // this enables to view tooltips if they are set in the subwidgets
    setAttribute(Qt::WA_AlwaysShowToolTips);

    qDebug() << "Razorbar: initializing.." << height();
    setAttribute(Qt::WA_X11NetWmWindowTypeDock);
    Layout = new QHBoxLayout;
    setScaledContents(true);
    Layout->setSpacing(1);
    Layout->setMargin(1);
    makeUp();
    show();
    //Razor::getInstance().get_Xfitman()->moveWindowtoDesktop(effectiveWinId(),1);
}

/**
 * @brief adds a widget to the bar
 */
void Razorbar::addWidget(QWidget* _widget,int _stretch, Qt::Alignment _align)
{
    //add the new widget
    Layout->addWidget(_widget, _stretch, _align);
    // DEBUG: _widget->setStyleSheet("background-color: red");
    //_widget->setFixedSize(height()-1, height()-1);
    // set the new / old layout
    setLayout(Layout);
    //save this widget in the barItems list
    barItems.append(_widget);

}

/**
 * @brief makes up our style
 */
void Razorbar::makeUp()
{
    setFixedHeight(Razor::getInstance().get_looknfeel()->getInt("razorbar_height"));

    // width handling - current approach:
    // if there is only one physicall screen used - all size width
    // if there are more screens/monitors only the main monitor will contain
    // the panel (full width). It prevents over-monitors-broken task manager
    // TODO: it canm be configured in the theme of course. But no high priority.
    QDesktopWidget * dw = QApplication::desktop();
    if (dw->screenCount() == 1)
        setFixedWidth(dw->width());<commit_msg>do not set layout too many times<commit_after>#ifndef RAZORBAR_CPP
#define RAZORBAR_CPP

#include "razor.h"
#include "razorbar.h"
/**
 * @file razorbar.cpp
 * @brief implements Razorbar, the bar-menu on the bottom
 * @author Christopher "VdoP" Regali
 */


/**
 * @brief constructor
 */
Razorbar::Razorbar()
{
    /*QDialog* bla = new QDialog(NULL,Qt::FramelessWindowHint | Qt::Dialog);
    bla->show();
    */
    qDebug() << "blobb" << Razor::getInstance().get_looknfeel()->getInt("razorbar_height");
    setWindowFlags(Qt::FramelessWindowHint | Qt::Dialog | Qt::WindowStaysOnTopHint);
    // this enables to view tooltips if they are set in the subwidgets
    setAttribute(Qt::WA_AlwaysShowToolTips);

    qDebug() << "Razorbar: initializing.." << height();
    setAttribute(Qt::WA_X11NetWmWindowTypeDock);
    Layout = new QHBoxLayout;
    setScaledContents(true);
    Layout->setSpacing(1);
    Layout->setMargin(1);
    setLayout(Layout);

    makeUp();
    show();
    //Razor::getInstance().get_Xfitman()->moveWindowtoDesktop(effectiveWinId(),1);
}

/**
 * @brief adds a widget to the bar
 */
void Razorbar::addWidget(QWidget* _widget,int _stretch, Qt::Alignment _align)
{
    //add the new widget
    Layout->addWidget(_widget, _stretch, _align);
    //save this widget in the barItems list
    barItems.append(_widget);

}

/**
 * @brief makes up our style
 */
void Razorbar::makeUp()
{
    setFixedHeight(Razor::getInstance().get_looknfeel()->getInt("razorbar_height"));

    // width handling - current approach:
    // if there is only one physicall screen used - all size width
    // if there are more screens/monitors only the main monitor will contain
    // the panel (full width). It prevents over-monitors-broken task manager
    // TODO: it canm be configured in the theme of course. But no high priority.
    QDesktopWidget * dw = QApplication::desktop();
    if (dw->screenCount() == 1)
        setFixedWidth(dw->width());
{'fraction_non_alphanumeric': 0.140119462419114, 'fraction_numerical': 0.003484320557491289, 'mean_word_length': 3.8363417569193743, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 23, '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': '4845911', 'n_tokens_mistral': 1295, 'n_tokens_neox': 1277, 'n_words': 329}