#include "PvStyle.h"
#include <sstream>

std::string BUTTON()
{
    return "";
}

namespace QSS
{
    std::string label(int fontSize, std::string color, std::string bkgcolor, std::string border)
    {
        if (color.empty()) { color = "white"; };
        if (bkgcolor.empty()) { bkgcolor = "transparent"; };
        if (border.empty()) { border = "none"; };

        std::stringstream ss;
        ss << "QLabel { "
            << "font: bold " << fontSize << "px \"微软雅黑\"; "
            << "color: " << color << "; "
            << "background-color: " << bkgcolor << "; "
            << "border: " << border << "; "
            <<"} QLabel:disabled {color:rgb(150, 150, 150);}";
        return ss.str();
    }


    std::string button(int fontSize, std::string color, std::string bkgcolor, std::string border)
    {
        if (color.empty()) { color = "white"; };
        if (bkgcolor.empty()) { bkgcolor = "rgb(39, 161, 136)"; };
        if (border.empty()) { border = "none"; };

        std::stringstream ss;
        ss << "QPushButton {"
            << "border-radius: 5px;"
            << "font: bold " << fontSize << "px \"微软雅黑\";"
            << "color: " << color << ";"
            << "background-color:" << bkgcolor << ";" 
            << "border:" << border << ";  }" 
            << "QPushButton:hover {background-color:rgb(10, 125, 215); border:2px solid rgb(1, 239, 255); color:rgb(1, 239, 255)}"
            << "QPushButton:pressed { border-width:2px 0 0 2px;background-color:rgb(150,150,150);border-style:inset;}"
            << "QPushButton:disabled { color:rgb(150,150,150);}";
        return ss.str();
    }

    const std::string LABEL_BKG_1 = QSS::label(14, "", "rgb(5, 47, 77)", "none; border-radius:5px");

    const std::string LABEL_BKG_2 = QSS::label(14, "", "rgb(8, 54, 91)", "none; border-radius:5px");

    const std::string LABEL_BOX = QSS::label(16, "", "rgba(200,200,200,20)", "none; border-radius:2px")
        + "QLabel:hover {border: 1px solid rgb(1, 183, 209);}";

    const std::string QSS_BOX_ACTIVE =
        "QLabel { background-color:rgb(7, 72, 111); border:2px solid;border-color:rgb(1, 183, 209); border-radius:2px;font:bold 16px;color:white; }"
        "QLabel:hover {border: 1px solid rgb(1, 183, 209);}"
        "QLabel:disabled { color:rgb(150,150,150);}";

    const std::string LABEL_TITLE = QSS::label(16, "rgb(99, 196, 216)", "", "none; padding-top: 0px;");

    const std::string LABEL_KEY = QSS::label(13, "rgb(180,180,180)", "", "");
    const std::string LABEL_VAL = QSS::label(14, "", "", "");

    const std::string BTN =
        "QPushButton { background-color:rgb(4, 96, 142);border-radius:10px;border:0px solid rgb(10,120,215);color:white;font:bold 18px;}"
        "QPushButton:hover { background-color:rgb(10,125,215);border:2px solid rgb(1,239,255);color:rgb(1,239,255)}"
        "QPushButton:pressed { border-width:2px 0 0 2px;background-color:rgb(150,150,150);border-style:inset;}"
        "QPushButton:disabled { color:rgb(150,150,150);}";

    const std::string BTN_ACTIVE =
        "QPushButton { background-color:rgb(4, 96, 142);border-radius:10px;border:2px solid rgb(1,239,255);color:rgb(1,239,255);font:bold 18px;}"
        "QPushButton:hover { background-color:rgb(10,125,215);border:2px solid rgb(1,239,255);color:rgb(1,239,255)}"
        "QPushButton:pressed { border-width:3px 0 0 3px;background-color:rgb(150,150,150);border-style:inset;}"
        "QPushButton:disabled { color:rgb(150,150,150);}";

    const std::string BTN_CONFIRM =
        "QPushButton { background-color:rgb(28, 145, 138); border-radius:10px; border: none; color:white; font:bold 18px;}"
        "QPushButton:hover { background-color:rgb(10,125,215);border:2px solid rgb(1,239,255);color:rgb(1,239,255)}"
        "QPushButton:pressed { border-width:3px 0 0 3px;background-color:rgb(150,150,150);border-style:inset;}"
        "QPushButton:disabled { color:rgb(150,150,150);}";

    const std::string BTN_CANCEL =
        "QPushButton { background-color:rgb(200, 200, 200);border-radius:10px;border:0px solid rgb(10,120,215);color:white;font:bold 18px;}"
        "QPushButton:hover { background-color:rgb(10,125,215);border:2px solid rgb(1,239,255);color:rgb(1,239,255)}"
        "QPushButton:pressed { border-width:3px 0 0 3px;background-color:rgb(150,150,150);border-style:inset;}"
        "QPushButton:disabled { color:rgb(150,150,150);}";

    const std::string QSS_BTN_MGR =
        "QPushButton { background-color:rgb(10, 34, 63); border-radius:5px; border:1px solid rgb(33, 105, 195); color:white; font:bold 16px;}"
        "QPushButton:hover { background-color:rgb(10,125,215); border:2px solid rgb(1,239,255); color:rgb(1,239,255)}"
        "QPushButton:pressed { border-width:3px 0 0 3px;border-style:inset; }"
        "QPushButton:disabled{color:rgb(150,150,150);}";

    const std::string QSS_BTN_MGR_ACTIVE =
        "QPushButton { background-color:rgb(39, 161, 136);border-radius:5px; border:1px solid rgb(68, 167, 252);color:white;font:bold 16px; }"
        "QPushButton:hover { background-color:rgb(10,125,215); border:2px solid rgb(1,239,255); color:rgb(1,239,255)}"
        "QPushButton:pressed { border-width:3px 0 0 3px;border-style:inset; }"
        "QPushButton:disabled { color:rgb(150,150,150); }";

    const  std::string COMBOX =
        "QComboBox {border: 1px solid rgb(18, 251, 255); background-color: rgb(5, 47, 77); border-radius: 5px; color:white; font: bold 16px;}"
        "QComboBox QAbstractItemView { border: 1px solid gray; background-color: rgba(8, 54, 91); border-radius: 5px; color:white;}"
        "QComboBox::drop-down { border-radius: 5px; width: 30px; }"
        "QComboBox:disabled { color:rgb(150,150,150);}";

    const std::string COMBOX_14 =
        "QComboBox {border: 1px solid rgb(18, 251, 255); background-color: rgb(5, 47, 77); border-radius: 5px; color:white; font: bold 14px;}"
        "QComboBox QAbstractItemView { border: 1px solid gray; background-color: rgba(8, 54, 91); border-radius: 5px; color:white;}"
        "QComboBox::drop-down { border-radius: 5px; width: 30px; }"
        "QComboBox:disabled { color:rgb(150,150,150);}";

    const std::string LINEEDIT =
        "QLineEdit { background-color: rgb(12, 39, 58); border: 1px solid rgb(18, 251, 255); border-radius: 5px; color:white; font: bold 14px;}"
        "QLineEdit:disabled { border: 1px solid gray; color:rgb(150,150,150);}";



    const std::string STYLE_TITLE_ICON =
        "padding-top: 0px;"
        "background-color: qlineargradient(x1:0, y1:1, x2:0, y2:0, stop:0 rgba(0, 71, 105, 255),stop:1 rgba(0, 71, 105, 0));"
        "border-radius: 0px; color:white; font: bold 16px; border-left: 8px solid rgba(33,255,210);";

    const std::string QSS_UNDERLINE =
        "background-color: qlineargradient(x1:0, y1:0, x2:1, y2:0,stop:0 rgba(9,194,207,200),stop:1 rgba(9,194,207,0));";



    //"background-color: qlineargradient(x1:0, y1:0, x2:1, y2:0, stop:0 transparent, stop:%1 red, stop:1 blue);"

    ///////////////////////////////////////////////////////////////////////////////////////////////////
    /// === 表格

    ///////////////////////////////////////////////////////////////////////////////////////////////////
    /// === 表格
    const std::string QSS_TABLE =
        QSS::label(15, "", "rgb(7, 46, 74)", "1px solid rgb(28, 121, 122)");

    // 表头标签
    const std::string QSS_TABLE_HEAD =
        QSS::label(14, "", "rgb(18, 93, 113)", "1px solid rgb(120, 120, 120); border-style:inset solid");
        //"background-color: rgb(18, 93, 113); color:rgb(255, 255, 255); font:bold 16px;"
        //"border-width:1 1 1 1px; border-style:inset solid; border-color:rgb(120, 120, 120);";

    // 单元格
    const std::string QSS_TABLE_CELL = QSS::label(14, "", "", "none; padding-left: 10px");

    const std::string QSS_TABLE_BTN_VIEW =
        "QPushButton { background-color: rgb(7, 46, 74); color:white; border-radius:2px; border:none; font:bold 14px;}"
        "QPushButton:hover { border: 1px solid white;}"
        "QPushButton:pressed { border-width:3px 0 0 3px;border-style:inset;}"
        "QPushButton:disabled { color:rgb(150,150,150);}";



    // 表格行的斑马色0
    const std::string QSS_TABLE_ROW_0 =
        "background-color:rgb(7, 46, 74); border-width:0 0 1 0px; border-style:inset solid; border-color:rgba(120,120,120, 100);";
    // 表格行的斑马色1
    const std::string QSS_TABLE_ROW_1 =
        "background-color:rgb(7, 46, 74); border-width:0 0 1 0px; border-style:inset solid; border-color:rgba(120,120,120, 100);";
    // 表格行的高亮显示
    const std::string QSS_TABLE_ROW_HIGHLIGHT =
        "background-color:rgba(14,45,60,200);border:1px solid rgba(255,0,0,100);";


    const std::string QSS_CARD_DEVICE =
        "QLabel { background-color:rgb(8, 54, 91); border:0px solid rgb(120, 120, 120); border-radius:5px; font:bold 14px; color:white; }"
        "QLabel:hover {border: 2px solid rgb(79, 129, 255); border-radius:2px;}"
        "QLabel:disabled { color:rgb(150,150,150);}";



}