#include "TopMenuBar.h"
#include "../Global.h"
#include "ShowTime.h"
#include "../BackEnd/MainWidget.h"
#include "../BaseWidget.h"
#include "Wifi.h"


Top_Menu_Bar::Top_Menu_Bar(QWidget *parent) : QWidget(parent) {
    int font_size = 20;
    am = create_button("AM", font_size);
    atu = create_button("ATU", font_size);
    vsql = create_button("VSQL", font_size);
    nb = create_button("NB", font_size);
    nr = create_button("NR", font_size);
    dnf = create_button("DNF", font_size);
    pre = create_button("PRE", font_size);
    att = create_button("ATT", font_size);
    spl = create_button("SPL", font_size);
    fil1 = create_button("FIL1", font_size);
    agc_a = create_button("AGC_A", font_size);
    text_button_list = new renderive::Roll_Object<QPushButton>({am, atu, vsql, nb, nr, dnf, pre, att, spl, fil1, agc_a}, [](QPushButton* cur){

    }, [](QPushButton* btn){

    }, this);
    show_time = new Show_Time;
    wifi = new Wifi;
    QHBoxLayout* statusBar = text_button_list->hbox_layout(2);
    statusBar->addStretch(3);
    statusBar->addWidget(wifi, 1);
    statusBar->addWidget(show_time, 1);
    setLayout(statusBar);
}

//void Top_Menu_Bar::paintEvent(QPaintEvent *event) {
//    QPainter painter(this);
//    painter.fillRect(rect(), Qt::red);
//    painter.end();
//}

