mirror of
https://github.com/Sani7/remote-ui.git
synced 2026-10-26 21:51:13 +01:00
UI
Remove text field from combobox
This commit is contained in:
@@ -4,9 +4,9 @@ UI_combobox::UI_combobox(QObject *parrent) : UI_x_boxes(UI_COMBOBOX_TYPE, parren
|
||||
{
|
||||
}
|
||||
|
||||
UI_combobox::UI_combobox(std::string text, Color fg_color, Color bg_color,
|
||||
std::vector<std::string> options, size_t selected, QObject *parrent)
|
||||
: UI_x_boxes(UI_COMBOBOX_TYPE, text, fg_color, bg_color, options, parrent), m_selected(selected)
|
||||
UI_combobox::UI_combobox(Color fg_color, Color bg_color,
|
||||
std::vector<std::string> options, size_t selected, QObject *parent)
|
||||
: UI_x_boxes(UI_COMBOBOX_TYPE, "", fg_color, bg_color, options, parent), m_selected(selected)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -10,10 +10,10 @@ class UI_combobox : public UI_x_boxes
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
UI_combobox(QObject *parrent = nullptr);
|
||||
UI_combobox(std::string text, Color fg_color, Color bg_color, std::vector<std::string> options,
|
||||
size_t selected = 0, QObject *parrent = nullptr);
|
||||
UI_combobox(const json &j, QObject *parrent = nullptr);
|
||||
UI_combobox(QObject *parent = nullptr);
|
||||
UI_combobox(Color fg_color, Color bg_color, std::vector<std::string> options,
|
||||
size_t selected = 0, QObject *parent = nullptr);
|
||||
UI_combobox(const json &j, QObject *parent = nullptr);
|
||||
|
||||
void set_selected(size_t selected);
|
||||
void set_selected(std::string selected) override;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
TEST(UI_combobox, to_from_json)
|
||||
{
|
||||
UI_combobox checkbox("checkbox_text", Color(255, 255, 255), Color(0, 0, 0), {"option1", "option2"});
|
||||
UI_combobox checkbox(Color(255, 255, 255), Color(0, 0, 0), {"option1", "option2"});
|
||||
json j = checkbox.to_json(0);
|
||||
UI_combobox checkbox2(j);
|
||||
EXPECT_EQ(checkbox.text(), checkbox2.text());
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
Test_Sim::Test_Sim(QObject* parrent) :
|
||||
Simulator_base("Test_Sim", std::chrono::milliseconds(1000), parrent),
|
||||
m_button("Off", Color(Color::White), Color(Color::Red)),
|
||||
m_combobox("Combobox", Color(Color::White), Color(Color::Black), {"Option 1", "Option 2", "Option 3"}, 0),
|
||||
m_combobox(Color(Color::White), Color(Color::Black), {"Option 1", "Option 2", "Option 3"}, 0),
|
||||
m_label("Label", Color(Color::White), Color(Color::Black)),
|
||||
m_checkbox("Option 1", Color(Color::White), Color(Color::Black)),
|
||||
m_slider("Slider", Color(Color::White), Color(Color::Black), 0, 100, 0),
|
||||
|
||||
Reference in New Issue
Block a user