Experiment with Toolpits of selected preset on OSX
This commit is contained in:
parent
c1724f45c9
commit
f8ab8b43de
3 changed files with 17 additions and 5 deletions
|
@ -601,6 +601,7 @@ void PresetCollection::update_platter_ui(wxBitmapComboBox *ui)
|
||||||
// Otherwise fill in the list from scratch.
|
// Otherwise fill in the list from scratch.
|
||||||
ui->Freeze();
|
ui->Freeze();
|
||||||
ui->Clear();
|
ui->Clear();
|
||||||
|
size_t selected_preset_item = 0;
|
||||||
|
|
||||||
const Preset &selected_preset = this->get_selected_preset();
|
const Preset &selected_preset = this->get_selected_preset();
|
||||||
// Show wide icons if the currently selected preset is not compatible with the current printer,
|
// Show wide icons if the currently selected preset is not compatible with the current printer,
|
||||||
|
@ -641,7 +642,7 @@ void PresetCollection::update_platter_ui(wxBitmapComboBox *ui)
|
||||||
ui->Append(wxString::FromUTF8((preset.name + (preset.is_dirty ? g_suffix_modified : "")).c_str()),
|
ui->Append(wxString::FromUTF8((preset.name + (preset.is_dirty ? g_suffix_modified : "")).c_str()),
|
||||||
(bmp == 0) ? (m_bitmap_main_frame ? *m_bitmap_main_frame : wxNullBitmap) : *bmp);
|
(bmp == 0) ? (m_bitmap_main_frame ? *m_bitmap_main_frame : wxNullBitmap) : *bmp);
|
||||||
if (i == m_idx_selected)
|
if (i == m_idx_selected)
|
||||||
ui->SetSelection(ui->GetCount() - 1);
|
selected_preset_item = ui->GetCount() - 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -658,9 +659,12 @@ void PresetCollection::update_platter_ui(wxBitmapComboBox *ui)
|
||||||
for (std::map<wxString, wxBitmap*>::iterator it = nonsys_presets.begin(); it != nonsys_presets.end(); ++it) {
|
for (std::map<wxString, wxBitmap*>::iterator it = nonsys_presets.begin(); it != nonsys_presets.end(); ++it) {
|
||||||
ui->Append(it->first, *it->second);
|
ui->Append(it->first, *it->second);
|
||||||
if (it->first == selected)
|
if (it->first == selected)
|
||||||
ui->SetSelection(ui->GetCount() - 1);
|
selected_preset_item = ui->GetCount() - 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ui->SetSelection(selected_preset_item);
|
||||||
|
ui->SetToolTip(ui->GetString(selected_preset_item));
|
||||||
ui->Thaw();
|
ui->Thaw();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -719,6 +723,7 @@ size_t PresetCollection::update_tab_ui(wxBitmapComboBox *ui, bool show_incompati
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ui->SetSelection(selected_preset_item);
|
ui->SetSelection(selected_preset_item);
|
||||||
|
ui->SetToolTip(ui->GetString(selected_preset_item));
|
||||||
ui->Thaw();
|
ui->Thaw();
|
||||||
return selected_preset_item;
|
return selected_preset_item;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1108,6 +1108,7 @@ void PresetBundle::update_platter_filament_ui(unsigned int idx_extruder, wxBitma
|
||||||
// Fill in the list from scratch.
|
// Fill in the list from scratch.
|
||||||
ui->Freeze();
|
ui->Freeze();
|
||||||
ui->Clear();
|
ui->Clear();
|
||||||
|
size_t selected_preset_item = 0;
|
||||||
const Preset *selected_preset = this->filaments.find_preset(this->filament_presets[idx_extruder]);
|
const Preset *selected_preset = this->filaments.find_preset(this->filament_presets[idx_extruder]);
|
||||||
// Show wide icons if the currently selected preset is not compatible with the current printer,
|
// Show wide icons if the currently selected preset is not compatible with the current printer,
|
||||||
// and draw a red flag in front of the selected preset.
|
// and draw a red flag in front of the selected preset.
|
||||||
|
@ -1159,7 +1160,7 @@ void PresetBundle::update_platter_filament_ui(unsigned int idx_extruder, wxBitma
|
||||||
ui->Append(wxString::FromUTF8((preset.name + (preset.is_dirty ? Preset::suffix_modified() : "")).c_str()),
|
ui->Append(wxString::FromUTF8((preset.name + (preset.is_dirty ? Preset::suffix_modified() : "")).c_str()),
|
||||||
(bitmap == 0) ? wxNullBitmap : *bitmap);
|
(bitmap == 0) ? wxNullBitmap : *bitmap);
|
||||||
if (selected)
|
if (selected)
|
||||||
ui->SetSelection(ui->GetCount() - 1);
|
selected_preset_item = ui->GetCount() - 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1178,9 +1179,11 @@ void PresetBundle::update_platter_filament_ui(unsigned int idx_extruder, wxBitma
|
||||||
for (std::map<wxString, wxBitmap*>::iterator it = nonsys_presets.begin(); it != nonsys_presets.end(); ++it) {
|
for (std::map<wxString, wxBitmap*>::iterator it = nonsys_presets.begin(); it != nonsys_presets.end(); ++it) {
|
||||||
ui->Append(it->first, *it->second);
|
ui->Append(it->first, *it->second);
|
||||||
if (it->first == selected_str)
|
if (it->first == selected_str)
|
||||||
ui->SetSelection(ui->GetCount() - 1);
|
selected_preset_item = ui->GetCount() - 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
ui->SetSelection(selected_preset_item);
|
||||||
|
ui->SetToolTip(ui->GetString(selected_preset_item));
|
||||||
ui->Thaw();
|
ui->Thaw();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -194,6 +194,9 @@ void wxDataViewTreeCtrlComboPopup::OnDataViewTreeCtrlSelection(wxCommandEvent& e
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
void PrusaCollapsiblePane::OnStateChange(const wxSize& sz)
|
void PrusaCollapsiblePane::OnStateChange(const wxSize& sz)
|
||||||
{
|
{
|
||||||
|
#ifndef __WXOSX__
|
||||||
|
wxCollapsiblePane::OnStateChange(sz);
|
||||||
|
#else
|
||||||
SetSize(sz);
|
SetSize(sz);
|
||||||
|
|
||||||
if (this->HasFlag(wxCP_NO_TLW_RESIZE))
|
if (this->HasFlag(wxCP_NO_TLW_RESIZE))
|
||||||
|
@ -219,6 +222,7 @@ void PrusaCollapsiblePane::OnStateChange(const wxSize& sz)
|
||||||
// top->SetClientSize(newBestSize);
|
// top->SetClientSize(newBestSize);
|
||||||
top->GetParent()->Layout();
|
top->GetParent()->Layout();
|
||||||
top->Refresh();
|
top->Refresh();
|
||||||
|
#endif //__WXOSX__
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
Loading…
Reference in a new issue