#594 fix repetier

revert 3ec7dec14010f9bab2192622d84eefd2f86a3ddf
add passtrough on the Workaround for a correct rendering of the control without Bitmap
select first option by default
This commit is contained in:
supermerill 2020-10-23 02:02:32 +02:00
parent f00116c524
commit 9813c50117
4 changed files with 15 additions and 5 deletions

View File

@ -153,6 +153,7 @@ void PrintConfigDef::init_common_params()
def->label = L("Printer");
def->tooltip = L("Name of the printer");
def->mode = comAdvanced;
def->gui_type = "select_open";
def->set_default_value(new ConfigOptionString(""));
def = this->add("printhost_cafile", coString);

View File

@ -805,9 +805,12 @@ void Choice::BUILD() {
*
* Note: Set bitmap height to the Font size because of OSX rendering.
*/
wxBitmap empty_bmp(1, temp->GetFont().GetPixelSize().y + 2);
empty_bmp.SetWidth(0);
temp->SetItemBitmap(0, empty_bmp);
// Welll, it makes wx freak out... (in debug) if select_open
if (m_opt.gui_type != "select_open") {
wxBitmap empty_bmp(1, temp->GetFont().GetPixelSize().y + 2);
empty_bmp.SetWidth(0);
temp->SetItemBitmap(0, empty_bmp);
}
#endif
// temp->Bind(wxEVT_TEXT, ([this](wxCommandEvent e) { on_change_field(); }), temp->GetId());

View File

@ -61,6 +61,8 @@ PrintHostSendDialog::PrintHostSendDialog(const fs::path &path, bool can_start_pr
wxString recent_group = from_u8(app_config->get("recent", CONFIG_KEY_GROUP));
if (recent_group.Length() > 0) {
combo_groups->SetValue(recent_group);
} else {
combo_groups->SetSelection(0);
}
}

View File

@ -2151,10 +2151,14 @@ void TabPrinter::update_printers()
for (int i = 0; i < printers.size(); i++) {
slugs.push_back(printers[i].ToStdString());
}
Choice *choice = dynamic_cast<Choice *>(rs);
choice->set_values(slugs);
boost::any val = choice->get_value();
boost::any any_string_type = std::string("");
if ((val.empty() || (any_string_type.type() == val.type() && boost::any_cast<std::string>(val) == "")) && !slugs.empty()) {
change_opt_value(*m_config, "printhost_slug", slugs[0], 0);
}
rs->enable();
}
}