diff --git a/src/slic3r/GUI/GUI_App.cpp b/src/slic3r/GUI/GUI_App.cpp index f15655e2bc..85a82516ff 100644 --- a/src/slic3r/GUI/GUI_App.cpp +++ b/src/slic3r/GUI/GUI_App.cpp @@ -275,26 +275,30 @@ private: bmp = wxBitmap(std::move(image)); } - // Workaround for the font scaling in respect to the current active display, - // not for the primary display, as it's implemented in Font.cpp - // See https://github.com/wxWidgets/wxWidgets/blob/master/src/msw/font.cpp - // void wxNativeFontInfo::SetFractionalPointSize(float pointSizeNew) void scale_font(wxFont& font, float scale) { +#ifdef __WXMSW__ + // Workaround for the font scaling in respect to the current active display, + // not for the primary display, as it's implemented in Font.cpp + // See https://github.com/wxWidgets/wxWidgets/blob/master/src/msw/font.cpp + // void wxNativeFontInfo::SetFractionalPointSize(float pointSizeNew) wxNativeFontInfo nfi= *font.GetNativeFontInfo(); float pointSizeNew = scale * font.GetPointSize(); nfi.lf.lfHeight = nfi.GetLogFontHeightAtPPI(pointSizeNew, get_dpi_for_window(this)); nfi.pointSize = pointSizeNew; font = wxFont(nfi); +#else + font.Scale(scale); +#endif //__WXMSW__ } // wrap a string for the strings no longer then 55 symbols // return extent of the longest string int word_wrap_string(wxString& input) { - int line_len = 55;// count of symbols in one line + size_t line_len = 55;// count of symbols in one line int idx = -1; - int cur_len = 0; + size_t cur_len = 0; wxString longest_sub_string; auto get_longest_sub_string = [longest_sub_string, input](wxString &longest_sub_str, int cur_len, size_t i) { @@ -317,7 +321,7 @@ private: { get_longest_sub_string(longest_sub_string, cur_len, i); input[idx] = '\n'; - cur_len = static_cast(i) - idx; + cur_len = i - static_cast(idx); } } diff --git a/src/slic3r/GUI/MainFrame.cpp b/src/slic3r/GUI/MainFrame.cpp index 3ef5012ee3..13b9de3c6e 100644 --- a/src/slic3r/GUI/MainFrame.cpp +++ b/src/slic3r/GUI/MainFrame.cpp @@ -1767,7 +1767,7 @@ void MainFrame::select_tab(size_t tab/* = size_t(-1)*/) // when tab == -1, it means we should show the last selected tab size_t new_selection = tab == (size_t)(-1) ? m_last_selected_tab : (m_layout == ESettingsLayout::Dlg && tab != 0) ? tab - 1 : tab; - if (m_tabpanel->GetSelection() != new_selection) + if (m_tabpanel->GetSelection() != (int)new_selection) m_tabpanel->SetSelection(new_selection); else if (was_hidden) { Tab* cur_tab = dynamic_cast(m_tabpanel->GetPage(new_selection)); diff --git a/src/slic3r/GUI/OptionsGroup.cpp b/src/slic3r/GUI/OptionsGroup.cpp index 8f593f1f20..ed98288862 100644 --- a/src/slic3r/GUI/OptionsGroup.cpp +++ b/src/slic3r/GUI/OptionsGroup.cpp @@ -592,7 +592,7 @@ bool ConfigOptionsGroup::is_visible(ConfigOptionMode mode) if (m_options_mode.size() == 1) return m_options_mode[0] <= mode; - int hidden_row_cnt = 0; + size_t hidden_row_cnt = 0; for (auto opt_mode : m_options_mode) if (opt_mode > mode) hidden_row_cnt++; diff --git a/src/slic3r/GUI/PresetComboBoxes.cpp b/src/slic3r/GUI/PresetComboBoxes.cpp index 8c0fefc760..7fe4e0ba0c 100644 --- a/src/slic3r/GUI/PresetComboBoxes.cpp +++ b/src/slic3r/GUI/PresetComboBoxes.cpp @@ -686,7 +686,7 @@ void PlaterPresetComboBox::update() { if (m_type == Preset::TYPE_FILAMENT && (m_preset_bundle->printers.get_edited_preset().printer_technology() == ptSLA || - m_preset_bundle->filament_presets.size() <= m_extruder_idx) ) + m_preset_bundle->filament_presets.size() <= (size_t)m_extruder_idx) ) return; // Otherwise fill in the list from scratch. @@ -883,15 +883,12 @@ void TabPresetComboBox::update() wxString selected = ""; if (!presets.front().is_visible) set_label_marker(Append(separator(L("System presets")), wxNullBitmap)); - int idx_selected = m_collection->get_selected_idx(); + size_t idx_selected = m_collection->get_selected_idx(); - PrinterTechnology proper_pt = ptAny; if (m_type == Preset::TYPE_PRINTER && m_preset_bundle->physical_printers.has_selection()) { std::string sel_preset_name = m_preset_bundle->physical_printers.get_selected_printer_preset_name(); Preset* preset = m_collection->find_preset(sel_preset_name); - if (preset) - proper_pt = preset->printer_technology(); - else + if (!preset) m_preset_bundle->physical_printers.unselect_printer(); } diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index 35ba1c698d..51a06eecf3 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -2906,7 +2906,7 @@ void TabPrinter::toggle_options() wxString extruder_number; long val; if (m_active_page->title().StartsWith("Extruder ", &extruder_number) && extruder_number.ToLong(&val) && - val > 0 && val <= m_extruders_count) + val > 0 && (size_t)val <= m_extruders_count) { size_t i = size_t(val - 1); bool have_retract_length = m_config->opt_float("retract_length", i) > 0; @@ -3403,8 +3403,7 @@ void Tab::clear_pages() m_page_sizer->Clear(true); // clear pages from the controlls for (auto p : m_pages) - p->clear(); - int i = m_page_sizer->GetItemCount(); + p->clear(); // nulling pointers m_parent_preset_description_line = nullptr;