Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/supermerill/SuperSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorremi durand <remi-j.durand@thalesgroup.com>2021-06-05 15:43:23 +0300
committerremi durand <remi-j.durand@thalesgroup.com>2021-06-05 15:43:23 +0300
commit2d8d247832c71bccc56b6feb546fb1ba1b3f7e85 (patch)
treebc4b67e51f9beadbab4c0cd97bbaebd6f608fb13
parentd2dc7c311c8fb4b332dfaa477bbc1dfa87eb5ebc (diff)
parentbe9d6f53e8b9db10ad04bd3def807873a47adec5 (diff)
Merge branch 'merill-merge'
-rwxr-xr-x[-rw-r--r--]BuildLinux.sh11
-rwxr-xr-xBuildMacOS.sh15
-rw-r--r--resources/ui_layout/printer_fff.ui5
-rw-r--r--src/libslic3r/GCode/GCodeProcessor.cpp16
-rw-r--r--src/libslic3r/GCode/GCodeProcessor.hpp2
-rw-r--r--src/platform/osx/BuildMacOSImage.sh.in4
-rw-r--r--src/platform/unix/BuildLinuxImage.sh.in10
-rw-r--r--src/slic3r/GUI/MainFrame.cpp89
-rw-r--r--src/slic3r/GUI/MainFrame.hpp1
-rw-r--r--src/slic3r/GUI/NotificationManager.cpp29
10 files changed, 123 insertions, 59 deletions
diff --git a/BuildLinux.sh b/BuildLinux.sh
index b272e03db..41d7b0114 100644..100755
--- a/BuildLinux.sh
+++ b/BuildLinux.sh
@@ -1,7 +1,7 @@
#!/bin/bash
export ROOT=`pwd`
-export NCORES=`sysctl -n hw.ncpu`
+export NCORES=`nproc --all`
while getopts ":ih" opt; do
case ${opt} in
@@ -43,7 +43,6 @@ echo -n "[1/9] Updating submodules..."
popd
} > $ROOT/build/Build.log # Capture all command output
-
echo -n "[2/9] Changing date in version..."
{
# change date in version
@@ -108,12 +107,16 @@ echo -n "[8/9] Building Slic3r..."
} &> $ROOT/build/Build.log # Capture all command output
echo "done"
+# Give proper permissions to script
+chmod 755 $ROOT/build/src/BuildLinuxImage.sh
+
echo -n "[9/9] Generating Linux app..."
{
if [[ -n "$BUILD_IMAGE" ]]
then
- $ROOT/build/BuildLinuxImage.sh -i
+ $ROOT/build/src/BuildLinuxImage.sh -i
else
- $ROOT/build/BuildLinuxImage.sh
+ $ROOT/build/src/BuildLinuxImage.sh
fi
} &> $ROOT/build/Build.log # Capture all command output
+echo "done"
diff --git a/BuildMacOS.sh b/BuildMacOS.sh
index 6105add8e..7c7da1b72 100755
--- a/BuildMacOS.sh
+++ b/BuildMacOS.sh
@@ -2,6 +2,14 @@
export ROOT=`pwd`
export NCORES=`sysctl -n hw.ncpu`
+export CMAKE_INSTALLED=`which cmake`
+
+# Check if CMake is installed
+if [[ -z "$CMAKE_INSTALLED" ]]
+then
+ echo "Can't find CMake. Either is not installed or not in the PATH. Aborting!"
+ exit -1
+fi
while getopts ":ih" opt; do
case ${opt} in
@@ -94,9 +102,12 @@ echo -n "[8/9] Building Slic3r..."
} &> $ROOT/build/Build.log # Capture all command output
echo "done"
+# Give proper permissions to script
+chmod 755 $ROOT/build/src/BuildMacOSImage.sh
+
if [[ -n "$BUILD_IMAGE" ]]
then
- $ROOT/build/BuildMacOSImage.sh -i
+ $ROOT/build/src/BuildMacOSImage.sh -i
else
- $ROOT/build/BuildMacOSImage.sh
+ $ROOT/build/src/BuildMacOSImage.sh
fi
diff --git a/resources/ui_layout/printer_fff.ui b/resources/ui_layout/printer_fff.ui
index 34ce66ad4..c5d4cd6d2 100644
--- a/resources/ui_layout/printer_fff.ui
+++ b/resources/ui_layout/printer_fff.ui
@@ -15,7 +15,10 @@ group:silent_mode_event:Firmware
setting:gcode_flavor
setting:silent_mode
setting:remaining_times
- setting:gcode_precision_xyz
+ line:Gcode precision
+ setting:gcode_precision_xyz
+ setting:gcode_precision_e
+ end_line
group:Cooling fan
line:Speedup
setting:label$Speedup time:fan_speedup_time
diff --git a/src/libslic3r/GCode/GCodeProcessor.cpp b/src/libslic3r/GCode/GCodeProcessor.cpp
index ffefa9139..af566af46 100644
--- a/src/libslic3r/GCode/GCodeProcessor.cpp
+++ b/src/libslic3r/GCode/GCodeProcessor.cpp
@@ -1797,7 +1797,7 @@ void GCodeProcessor::process_G1(const GCodeReader::GCodeLine& line)
#if ENABLE_VOLUMETRIC_EXTRUSION_PROCESSING
float filament_diameter = (static_cast<size_t>(m_extruder_id) < m_filament_diameters.size()) ? m_filament_diameters[m_extruder_id] : m_filament_diameters.back();
float filament_radius = 0.5f * filament_diameter;
- float area_filament_cross_section = static_cast<float>(M_PI) * sqr(filament_radius);
+ double area_filament_cross_section = M_PI * sqr(filament_radius);
auto absolute_position = [this, area_filament_cross_section](Axis axis, const GCodeReader::GCodeLine& lineG1) {
#else
auto absolute_position = [this](Axis axis, const GCodeReader::GCodeLine& lineG1) {
@@ -1853,7 +1853,7 @@ void GCodeProcessor::process_G1(const GCodeReader::GCodeLine& line)
m_feedrate = line.f() * MMMIN_TO_MMSEC;
// calculates movement deltas
- float max_abs_delta = 0.0f;
+ double max_abs_delta = 0.0f;
AxisCoords delta_pos;
for (unsigned char a = X; a <= E; ++a) {
delta_pos[a] = m_end_position[a] - m_start_position[a];
@@ -1869,14 +1869,14 @@ void GCodeProcessor::process_G1(const GCodeReader::GCodeLine& line)
type = EMoveType::Travel;
if (type == EMoveType::Extrude) {
- float delta_xyz = std::sqrt(sqr(delta_pos[X]) + sqr(delta_pos[Y]) + sqr(delta_pos[Z]));
+ double delta_xyz = std::sqrt(sqr(delta_pos[X]) + sqr(delta_pos[Y]) + sqr(delta_pos[Z]));
#if !ENABLE_VOLUMETRIC_EXTRUSION_PROCESSING
float filament_diameter = (static_cast<size_t>(m_extruder_id) < m_filament_diameters.size()) ? m_filament_diameters[m_extruder_id] : m_filament_diameters.back();
float filament_radius = 0.5f * filament_diameter;
- float area_filament_cross_section = static_cast<float>(M_PI) * sqr(filament_radius);
+ double area_filament_cross_section = static_cast<float>(M_PI) * sqr(filament_radius);
#endif // !ENABLE_VOLUMETRIC_EXTRUSION_PROCESSING
- float volume_extruded_filament = area_filament_cross_section * delta_pos[E];
- float area_toolpath_cross_section = volume_extruded_filament / delta_xyz;
+ double volume_extruded_filament = area_filament_cross_section * delta_pos[E];
+ double area_toolpath_cross_section = volume_extruded_filament / delta_xyz;
// volume extruded filament / tool displacement = area toolpath cross section
m_mm3_per_mm = area_toolpath_cross_section;
@@ -1977,7 +1977,7 @@ void GCodeProcessor::process_G1(const GCodeReader::GCodeLine& line)
block.layer_id = m_layer_id;
// calculates block cruise feedrate
- float min_feedrate_factor = 1.0f;
+ double min_feedrate_factor = 1.0f;
for (unsigned char a = X; a <= E; ++a) {
curr.axis_feedrate[a] = curr.feedrate * delta_pos[a] * inv_distance;
if (a == E)
@@ -1985,7 +1985,7 @@ void GCodeProcessor::process_G1(const GCodeReader::GCodeLine& line)
curr.abs_axis_feedrate[a] = std::abs(curr.axis_feedrate[a]);
if (curr.abs_axis_feedrate[a] != 0.0f) {
- float axis_max_feedrate = get_axis_max_feedrate(static_cast<PrintEstimatedTimeStatistics::ETimeMode>(i), static_cast<Axis>(a));
+ double axis_max_feedrate = get_axis_max_feedrate(static_cast<PrintEstimatedTimeStatistics::ETimeMode>(i), static_cast<Axis>(a));
if (axis_max_feedrate != 0.0f)
min_feedrate_factor = std::min(min_feedrate_factor, axis_max_feedrate / curr.abs_axis_feedrate[a]);
}
diff --git a/src/libslic3r/GCode/GCodeProcessor.hpp b/src/libslic3r/GCode/GCodeProcessor.hpp
index 48dc1e5f2..377afa8ed 100644
--- a/src/libslic3r/GCode/GCodeProcessor.hpp
+++ b/src/libslic3r/GCode/GCodeProcessor.hpp
@@ -96,7 +96,7 @@ namespace Slic3r {
#endif // ENABLE_GCODE_VIEWER_DATA_CHECKING
private:
- using AxisCoords = std::array<float, 4>;
+ using AxisCoords = std::array<double, 4>;
using ExtruderColors = std::vector<unsigned char>;
enum class EUnits : unsigned char
diff --git a/src/platform/osx/BuildMacOSImage.sh.in b/src/platform/osx/BuildMacOSImage.sh.in
index 15cb5af6e..ad5153544 100644
--- a/src/platform/osx/BuildMacOSImage.sh.in
+++ b/src/platform/osx/BuildMacOSImage.sh.in
@@ -45,7 +45,7 @@ echo -n "[9/9] Generating MacOS app..."
# copy bin and do not let it lower case
cp -f src/@SLIC3R_APP_CMD@ pack/@SLIC3R_APP_KEY@/@SLIC3R_APP_KEY@.app/Contents/MacOS/@SLIC3R_APP_KEY@
chmod u+x pack/@SLIC3R_APP_KEY@/@SLIC3R_APP_KEY@.app/Contents/MacOS/@SLIC3R_APP_KEY@
-} &> $ROOT/build/MacOS_Build.log # Capture all command output
+} &> $ROOT/Build.log # Capture all command output
echo "done"
if [[ -n "$BUILD_IMAGE" ]]
@@ -58,6 +58,6 @@ echo -n "Creating DMG Image for distribution..."
hdiutil create -ov -fs HFS+ -volname "@SLIC3R_APP_KEY@" -srcfolder "pack/@SLIC3R_APP_KEY@" temp.dmg
hdiutil convert temp.dmg -format UDZO -o @SLIC3R_APP_KEY@.dmg
popd
-} &> $ROOT/build/MacOS_Build.log # Capture all command output
+} &> $ROOT/Build.log # Capture all command output
echo "done"
fi
diff --git a/src/platform/unix/BuildLinuxImage.sh.in b/src/platform/unix/BuildLinuxImage.sh.in
index 75ecadc29..24d306612 100644
--- a/src/platform/unix/BuildLinuxImage.sh.in
+++ b/src/platform/unix/BuildLinuxImage.sh.in
@@ -9,13 +9,13 @@ while getopts ":ih" opt; do
export BUILD_IMAGE="1"
;;
h ) echo "Usage: ./BuildLinuxImage.sh [-i]"
- echo " -i: Generate DMG image (optional)"
+ echo " -i: Generate Appimage (optional)"
exit 0
;;
esac
done
-echo -n "[9/9] Generating MacOS app..."
+echo -n "[9/9] Generating Linux app..."
{
# create directory and copy into it
@@ -25,7 +25,7 @@ echo -n "[9/9] Generating MacOS app..."
fi
mkdir package
mkdir package/bin
-
+
# copy Resources
cp -Rf ../resources package/resources
cp -f src/@SLIC3R_APP_CMD@ package/bin/@SLIC3R_APP_CMD@
@@ -34,7 +34,7 @@ echo -n "[9/9] Generating MacOS app..."
echo -e '#!/bin/bash\nDIR=$(readlink -f "$0" | xargs dirname)\nexport LD_LIBRARY_PATH="$DIR/bin"\nexec "$DIR/bin/@SLIC3R_APP_CMD@" "$@"' >@SLIC3R_APP_CMD@
chmod u+x @SLIC3R_APP_CMD@
tar -cvf ../@SLIC3R_APP_KEY@.tar .
-} &> $ROOT/build/MacOS_Build.log # Capture all command output
+} &> $ROOT/Build.log # Capture all command output
echo "done"
if [[ -n "$BUILD_IMAGE" ]]
@@ -43,6 +43,6 @@ echo -n "Creating Appimage for distribution..."
{
chmod +x ../build_appimage.sh
../build_appimage.sh
-} &> $ROOT/build/MacOS_Build.log # Capture all command output
+} &> $ROOT/Build.log # Capture all command output
echo "done"
fi
diff --git a/src/slic3r/GUI/MainFrame.cpp b/src/slic3r/GUI/MainFrame.cpp
index 864fbe8d0..a36936d74 100644
--- a/src/slic3r/GUI/MainFrame.cpp
+++ b/src/slic3r/GUI/MainFrame.cpp
@@ -17,6 +17,7 @@
#include "libslic3r/PresetBundle.hpp"
#include "libslic3r/Print.hpp"
#include "libslic3r/SLAPrint.hpp"
+#include "libslic3r/Time.hpp"
#include "../Utils/Process.hpp"
#include "3DScene.hpp"
@@ -974,8 +975,8 @@ bool MainFrame::can_change_view() const
case ESettingsLayout::Dlg: { return true; }
case ESettingsLayout::Old:
case ESettingsLayout::Tabs: {
- int page_id = m_tabpanel->GetSelection();
- return page_id != wxNOT_FOUND && dynamic_cast<const Slic3r::GUI::Plater*>(m_tabpanel->GetPage((size_t)page_id)) != nullptr;
+ int page_id = m_tabpanel->GetSelection();
+ return page_id != wxNOT_FOUND && selected_tab() <= ETabType::LastPlater;
}
case ESettingsLayout::GCodeViewer: { return true; }
}
@@ -1198,13 +1199,13 @@ void MainFrame::init_menubar_as_editor()
Bind(wxEVT_UPDATE_UI, [this](wxUpdateUIEvent& evt) { evt.Enable(m_recent_projects.GetCount() > 0); }, recent_projects_submenu->GetId());
- append_menu_item(fileMenu, wxID_ANY, _L("&Save Project") + "\tCtrl+S", _L("Save current project file"),
+ append_menu_item(fileMenu, wxID_ANY, _L("&Save Project") + "\t" + GUI::shortkey_ctrl_prefix() + "S", _L("Save current project file"),
[this](wxCommandEvent&) { if (m_plater) m_plater->save_project_as_3mf(into_path(m_plater->get_project_filename(".3mf"))); }, "save", nullptr,
[this](){return m_plater != nullptr && can_save(); }, this);
#ifdef __APPLE__
- append_menu_item(fileMenu, wxID_ANY, _L("Save Project &as") + dots + "\tCtrl+Shift+S", _L("Save current project file as"),
+ append_menu_item(fileMenu, wxID_ANY, _L("Save Project &as") + dots + "\t" + GUI::shortkey_ctrl_prefix() + "Shift+S", _L("Save current project file as"),
#else
- append_menu_item(fileMenu, wxID_ANY, _L("Save Project &as") + dots + "\tCtrl+Alt+S", _L("Save current project file as"),
+ append_menu_item(fileMenu, wxID_ANY, _L("Save Project &as") + dots + "\t" + GUI::shortkey_ctrl_prefix() + "Alt+S", _L("Save current project file as"),
#endif // __APPLE__
[this](wxCommandEvent&) { if (m_plater) m_plater->save_project_as_3mf(); }, "save", nullptr,
[this](){return m_plater != nullptr && can_save(); }, this);
@@ -1212,7 +1213,7 @@ void MainFrame::init_menubar_as_editor()
fileMenu->AppendSeparator();
wxMenu* import_menu = new wxMenu();
- append_menu_item(import_menu, wxID_ANY, _L("Import STL/OBJ/AM&F/3MF") + dots + "\tCtrl+I", _L("Load a model"),
+ append_menu_item(import_menu, wxID_ANY, _L("Import STL/OBJ/AM&F/3MF") + dots + "\t" + GUI::shortkey_ctrl_prefix() + "I", _L("Load a model"),
[this](wxCommandEvent&) { if (m_plater) m_plater->add_model(); }, "import_plater", nullptr,
[this](){return m_plater != nullptr; }, this);
@@ -1225,10 +1226,10 @@ void MainFrame::init_menubar_as_editor()
[this](){return m_plater != nullptr; }, this);
import_menu->AppendSeparator();
- append_menu_item(import_menu, wxID_ANY, _L("Import &Config") + dots + "\tCtrl+L", _L("Load exported configuration file"),
+ append_menu_item(import_menu, wxID_ANY, _L("Import &Config") + dots + "\t" + GUI::shortkey_ctrl_prefix() + "L", _L("Load exported configuration file"),
[this](wxCommandEvent&) { load_config_file(); }, "import_config", nullptr,
[]() {return true; }, this);
- append_menu_item(import_menu, wxID_ANY, _L("Import Config from &project") + dots +"\tCtrl+Alt+L", _L("Load configuration from project file"),
+ append_menu_item(import_menu, wxID_ANY, _L("Import Config from &project") + dots +"\t" + GUI::shortkey_ctrl_prefix() + "Alt+L", _L("Load configuration from project file"),
[this](wxCommandEvent&) { if (m_plater) m_plater->extract_config_from_project(); }, "import_config", nullptr,
[]() {return true; }, this);
import_menu->AppendSeparator();
@@ -1238,15 +1239,15 @@ void MainFrame::init_menubar_as_editor()
append_submenu(fileMenu, import_menu, wxID_ANY, _L("&Import"), "");
wxMenu* export_menu = new wxMenu();
- wxMenuItem* item_export_gcode = append_menu_item(export_menu, wxID_ANY, _L("Export &G-code") + dots +"\tCtrl+G", _L("Export current plate as G-code"),
+ wxMenuItem* item_export_gcode = append_menu_item(export_menu, wxID_ANY, _L("Export &G-code") + dots +"\t" + GUI::shortkey_ctrl_prefix() + "G", _L("Export current plate as G-code"),
[this](wxCommandEvent&) { if (m_plater) m_plater->export_gcode(false); }, "export_gcode", nullptr,
[this](){return can_export_gcode(); }, this);
m_changeable_menu_items.push_back(item_export_gcode);
- wxMenuItem* item_send_gcode = append_menu_item(export_menu, wxID_ANY, _L("S&end G-code") + dots +"\tCtrl+Shift+G", _L("Send to print current plate as G-code"),
+ wxMenuItem* item_send_gcode = append_menu_item(export_menu, wxID_ANY, _L("S&end G-code") + dots +"\t" + GUI::shortkey_ctrl_prefix() + "Shift+G", _L("Send to print current plate as G-code"),
[this](wxCommandEvent&) { if (m_plater) m_plater->send_gcode(); }, "export_gcode", nullptr,
[this](){return can_send_gcode(); }, this);
m_changeable_menu_items.push_back(item_send_gcode);
- append_menu_item(export_menu, wxID_ANY, _L("Export G-code to SD card / Flash drive") + dots + "\tCtrl+U", _L("Export current plate as G-code to SD card / Flash drive"),
+ append_menu_item(export_menu, wxID_ANY, _L("Export G-code to SD card / Flash drive") + dots + "\t" + GUI::shortkey_ctrl_prefix() + "U", _L("Export current plate as G-code to SD card / Flash drive"),
[this](wxCommandEvent&) { if (m_plater) m_plater->export_gcode(true); }, "export_to_sd", nullptr,
[this]() {return can_export_gcode_sd(); }, this);
export_menu->AppendSeparator();
@@ -1264,7 +1265,7 @@ void MainFrame::init_menubar_as_editor()
[this](wxCommandEvent&) { if (m_plater) m_plater->export_toolpaths_to_obj(); }, "export_plater", nullptr,
[this]() {return can_export_toolpaths(); }, this);
export_menu->AppendSeparator();
- append_menu_item(export_menu, wxID_ANY, _L("Export &Config") + dots +"\tCtrl+E", _L("Export current configuration to file"),
+ append_menu_item(export_menu, wxID_ANY, _L("Export &Config") + dots +"\t" + GUI::shortkey_ctrl_prefix() + "E", _L("Export current configuration to file"),
[this](wxCommandEvent&) { export_config(); }, "export_config", nullptr,
[]() {return true; }, this);
append_menu_item(export_menu, wxID_ANY, _L("Export Config &Bundle") + dots, _L("Export all presets to file"),
@@ -1279,7 +1280,7 @@ void MainFrame::init_menubar_as_editor()
[]() {return true; }, this);
append_submenu(fileMenu, export_menu, wxID_ANY, _L("&Export"), "");
- append_menu_item(fileMenu, wxID_ANY, _L("Ejec&t SD card / Flash drive") + dots + "\tCtrl+T", _L("Eject SD card / Flash drive after the G-code was exported to it."),
+ append_menu_item(fileMenu, wxID_ANY, _L("Ejec&t SD card / Flash drive") + dots + "\t" + GUI::shortkey_ctrl_prefix() + "T", _L("Eject SD card / Flash drive after the G-code was exported to it."),
[this](wxCommandEvent&) { if (m_plater) m_plater->eject_drive(); }, "eject_sd", nullptr,
[this]() {return can_eject(); }, this);
@@ -1287,19 +1288,19 @@ void MainFrame::init_menubar_as_editor()
#if 0
m_menu_item_repeat = nullptr;
- append_menu_item(fileMenu, wxID_ANY, _L("Quick Slice") +dots+ "\tCtrl+U", _L("Slice a file into a G-code"),
+ append_menu_item(fileMenu, wxID_ANY, _L("Quick Slice") +dots+ "\t" + GUI::shortkey_ctrl_prefix() + "U", _L("Slice a file into a G-code"),
[this](wxCommandEvent&) {
wxTheApp->CallAfter([this]() {
quick_slice();
m_menu_item_repeat->Enable(is_last_input_file());
}); }, "cog_go.png");
- append_menu_item(fileMenu, wxID_ANY, _L("Quick Slice and Save As") +dots +"\tCtrl+Alt+U", _L("Slice a file into a G-code, save as"),
+ append_menu_item(fileMenu, wxID_ANY, _L("Quick Slice and Save As") +dots +"\t" + GUI::shortkey_ctrl_prefix() + "Alt+U", _L("Slice a file into a G-code, save as"),
[this](wxCommandEvent&) {
wxTheApp->CallAfter([this]() {
quick_slice(qsSaveAs);
m_menu_item_repeat->Enable(is_last_input_file());
}); }, "cog_go.png");
- m_menu_item_repeat = append_menu_item(fileMenu, wxID_ANY, _L("Repeat Last Quick Slice") +"\tCtrl+Shift+U", _L("Repeat last quick slice"),
+ m_menu_item_repeat = append_menu_item(fileMenu, wxID_ANY, _L("Repeat Last Quick Slice") +"\t" + GUI::shortkey_ctrl_prefix() + "Shift+U", _L("Repeat last quick slice"),
[this](wxCommandEvent&) {
wxTheApp->CallAfter([this]() {
quick_slice(qsReslice);
@@ -1307,7 +1308,7 @@ void MainFrame::init_menubar_as_editor()
m_menu_item_repeat->Enable(false);
fileMenu->AppendSeparator();
#endif
- m_menu_item_reslice_now = append_menu_item(fileMenu, wxID_ANY, _L("(Re)Slice No&w") + "\tCtrl+R", _L("Start new slicing process"),
+ m_menu_item_reslice_now = append_menu_item(fileMenu, wxID_ANY, _L("(Re)Slice No&w") + "\t" + GUI::shortkey_ctrl_prefix() + "R", _L("Start new slicing process"),
[this](wxCommandEvent&) { reslice_now(); }, "re_slice", nullptr,
[this]() { return m_plater != nullptr && can_reslice(); }, this);
fileMenu->AppendSeparator();
@@ -1422,11 +1423,18 @@ void MainFrame::init_menubar_as_editor()
viewMenu = new wxMenu();
add_common_view_menu_items(viewMenu, this, std::bind(&MainFrame::can_change_view, this));
viewMenu->AppendSeparator();
- append_menu_check_item(viewMenu, wxID_ANY, _L("Show &labels") + "\t" + "E", _L("Show object/instance labels in 3D scene"),
+ append_menu_check_item(viewMenu, wxID_ANY, _L("Show &labels") + "\t" + GUI::shortkey_ctrl_prefix() + "E", _L("Show object/instance labels in 3D scene"),
[this](wxCommandEvent&) { m_plater->show_view3D_labels(!m_plater->are_view3D_labels_shown()); }, this,
[this]() { return m_plater->is_view3D_shown(); }, [this]() { return m_plater->are_view3D_labels_shown(); }, this);
append_menu_check_item(viewMenu, wxID_ANY, _L("&Collapse sidebar") + "\t" + "Shift+" + sep_space + "Tab", _L("Collapse sidebar"),
- [this](wxCommandEvent&) { m_plater->collapse_sidebar(!m_plater->is_sidebar_collapsed()); }, this,
+ [this](wxCommandEvent&) {
+ //fix for trigger on pressed & release
+ static time_t last_time_called = 0;
+ time_t now = Slic3r::Utils::get_current_time_utc();
+ if(now - last_time_called > 2)
+ m_plater->collapse_sidebar(!m_plater->is_sidebar_collapsed());
+ last_time_called = now;
+ }, this,
[]() { return true; }, [this]() { return m_plater->is_sidebar_collapsed(); }, this);
}
@@ -1567,10 +1575,10 @@ void MainFrame::update_menubar()
const bool is_fff = plater()->printer_technology() == ptFFF;
- m_changeable_menu_items[miExport] ->SetItemLabel((is_fff ? _L("Export &G-code") : _L("E&xport")) + dots + "\tCtrl+G");
- m_changeable_menu_items[miSend] ->SetItemLabel((is_fff ? _L("S&end G-code") : _L("S&end to print")) + dots + "\tCtrl+Shift+G");
+ m_changeable_menu_items[miExport] ->SetItemLabel((is_fff ? _L("Export &G-code") : _L("E&xport")) + dots + "\t" + GUI::shortkey_ctrl_prefix() + "G");
+ m_changeable_menu_items[miSend] ->SetItemLabel((is_fff ? _L("S&end G-code") : _L("S&end to print")) + dots + "\t" + GUI::shortkey_ctrl_prefix() + "Shift+G");
- m_changeable_menu_items[miMaterialTab] ->SetItemLabel((is_fff ? _L("&Filament Settings Tab") : _L("Mate&rial Settings Tab")) + "\tCtrl+5");
+ m_changeable_menu_items[miMaterialTab] ->SetItemLabel((is_fff ? _L("&Filament Settings Tab") : _L("Mate&rial Settings Tab")) + "\t" + GUI::shortkey_ctrl_prefix() + "5");
m_changeable_menu_items[miMaterialTab] ->SetBitmap(create_scaled_bitmap(is_fff ? "spool" : "resin"));
m_changeable_menu_items[miPrinterTab] ->SetBitmap(create_scaled_bitmap(is_fff ? "printer" : "sla_printer"));
@@ -1908,6 +1916,43 @@ void MainFrame::select_tab(Tab* tab)
}
+MainFrame::ETabType MainFrame::selected_tab() const
+{
+ if (m_layout == ESettingsLayout::Old) {
+ if (m_tabpanel->GetSelection() == 0)
+ if (m_plater->is_view3D_shown())
+ return ETabType::Plater3D;
+ else
+ return ETabType::PlaterGcode;
+ else
+ return ETabType((uint8_t)ETabType::PrintSettings + m_tabpanel->GetSelection() - 1);
+ }
+ else if (m_layout == ESettingsLayout::Tabs) {
+ if (m_tabpanel->GetSelection() < 3)
+ return ETabType((uint8_t)ETabType::Plater3D + m_tabpanel->GetSelection());
+ else
+ return ETabType((uint8_t)ETabType::PrintSettings + m_tabpanel->GetSelection() - 3);
+ }
+ else if (m_layout == ESettingsLayout::Hidden) {
+ if (!m_main_sizer->IsShown(m_tabpanel)) {
+ if (m_plater->is_view3D_shown())
+ return ETabType::Plater3D;
+ else
+ return ETabType::PlaterGcode;
+ } else {
+ return ETabType((uint8_t)ETabType::PrintSettings + m_tabpanel->GetSelection() - 1);
+ }
+ }
+ else if (m_layout == ESettingsLayout::Dlg) {
+ if (!m_main_sizer->IsShown(m_tabpanel)) {
+ if (m_plater->is_view3D_shown())
+ return ETabType::Plater3D;
+ else
+ return ETabType::PlaterGcode;
+ }
+ }
+}
+
void MainFrame::select_tab(ETabType tab /* = Any*/, bool keep_tab_type)
{
bool tabpanel_was_hidden = false;
diff --git a/src/slic3r/GUI/MainFrame.hpp b/src/slic3r/GUI/MainFrame.hpp
index 2f9a11e3b..c4e3b5e1f 100644
--- a/src/slic3r/GUI/MainFrame.hpp
+++ b/src/slic3r/GUI/MainFrame.hpp
@@ -201,6 +201,7 @@ public:
// 0 = a plater tab, 1 = print setting, 2 = filament settign, 3 = printer setting
void select_tab(Tab* tab);
void select_tab(ETabType tab = ETabType::Any, bool keep_tab_type = false);
+ ETabType selected_tab() const;
void select_view(const std::string& direction);
// Propagate changed configuration from the Tab to the Plater and save changes to the AppConfig
void on_config_changed(DynamicPrintConfig* cfg) const ;
diff --git a/src/slic3r/GUI/NotificationManager.cpp b/src/slic3r/GUI/NotificationManager.cpp
index 4cef5c87a..20d5e4ea7 100644
--- a/src/slic3r/GUI/NotificationManager.cpp
+++ b/src/slic3r/GUI/NotificationManager.cpp
@@ -420,22 +420,23 @@ void NotificationManager::PopNotification::init()
next_space = next_space_candidate;
next_space_candidate = text.find_first_of(' ', next_space + 1);
}
- // when one word longer than line.
- if (ImGui::CalcTextSize(text.substr(last_end, next_space - last_end).c_str()).x > m_window_width - m_window_width_offset) {
- float width_of_a = ImGui::CalcTextSize("a").x;
- int letter_count = (int)((m_window_width - m_window_width_offset) / width_of_a);
- while (last_end + letter_count < text.size() && ImGui::CalcTextSize(text.substr(last_end, letter_count).c_str()).x < m_window_width - m_window_width_offset) {
- letter_count++;
- }
- m_endlines.push_back(last_end + letter_count);
- last_end += letter_count;
- } else {
- m_endlines.push_back(next_space);
- last_end = next_space + 1;
+ } else {
+ next_space = text.length();
+ }
+ // when one word longer than line.
+ if (ImGui::CalcTextSize(text.substr(last_end, next_space - last_end).c_str()).x > m_window_width - m_window_width_offset) {
+ float width_of_a = ImGui::CalcTextSize("a").x;
+ int letter_count = (int)((m_window_width - m_window_width_offset) / width_of_a);
+ while (last_end + letter_count < text.size() && ImGui::CalcTextSize(text.substr(last_end, letter_count).c_str()).x < m_window_width - m_window_width_offset) {
+ letter_count++;
}
+ m_endlines.push_back(last_end + letter_count);
+ last_end += letter_count;
+ } else {
+ m_endlines.push_back(next_space);
+ last_end = next_space + 1;
}
- }
- else {
+ } else {
m_endlines.push_back(text.length());
last_end = text.length();
}