Merge remote-tracking branch 'remotes/origin/ys_tooltips_osx'

This commit is contained in:
bubnikv 2018-07-17 09:40:19 +02:00
commit 3339623db6
3 changed files with 14 additions and 6 deletions

View File

@ -321,7 +321,7 @@ void add_config_menu(wxMenuBar *menu, int event_preferences_changed, int event_l
auto local_menu = new wxMenu();
wxWindowID config_id_base = wxWindow::NewControlId((int)ConfigMenuCnt);
auto config_wizard_name = _(ConfigWizard::name().wx_str());
const auto config_wizard_name = _(ConfigWizard::name().wx_str());
const auto config_wizard_tooltip = wxString::Format(_(L("Run %s")), config_wizard_name);
// Cmd+, is standard on OS X - what about other operating systems?
local_menu->Append(config_id_base + ConfigMenuWizard, config_wizard_name + dots, config_wizard_tooltip);

View File

@ -681,6 +681,7 @@ void PresetCollection::update_platter_ui(wxBitmapComboBox *ui)
// Otherwise fill in the list from scratch.
ui->Freeze();
ui->Clear();
size_t selected_preset_item = 0;
const Preset &selected_preset = this->get_selected_preset();
// Show wide icons if the currently selected preset is not compatible with the current printer,
@ -721,7 +722,7 @@ void PresetCollection::update_platter_ui(wxBitmapComboBox *ui)
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);
if (i == m_idx_selected)
ui->SetSelection(ui->GetCount() - 1);
selected_preset_item = ui->GetCount() - 1;
}
else
{
@ -738,10 +739,13 @@ void PresetCollection::update_platter_ui(wxBitmapComboBox *ui)
for (std::map<wxString, wxBitmap*>::iterator it = nonsys_presets.begin(); it != nonsys_presets.end(); ++it) {
ui->Append(it->first, *it->second);
if (it->first == selected)
ui->SetSelection(ui->GetCount() - 1);
selected_preset_item = ui->GetCount() - 1;
}
}
ui->Thaw();
ui->SetSelection(selected_preset_item);
ui->SetToolTip(ui->GetString(selected_preset_item));
ui->Thaw();
}
size_t PresetCollection::update_tab_ui(wxBitmapComboBox *ui, bool show_incompatible)
@ -799,6 +803,7 @@ size_t PresetCollection::update_tab_ui(wxBitmapComboBox *ui, bool show_incompati
}
}
ui->SetSelection(selected_preset_item);
ui->SetToolTip(ui->GetString(selected_preset_item));
ui->Thaw();
return selected_preset_item;
}

View File

@ -1181,6 +1181,7 @@ void PresetBundle::update_platter_filament_ui(unsigned int idx_extruder, wxBitma
// Fill in the list from scratch.
ui->Freeze();
ui->Clear();
size_t selected_preset_item = 0;
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,
// and draw a red flag in front of the selected preset.
@ -1232,7 +1233,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()),
(bitmap == 0) ? wxNullBitmap : *bitmap);
if (selected)
ui->SetSelection(ui->GetCount() - 1);
selected_preset_item = ui->GetCount() - 1;
}
else
{
@ -1251,9 +1252,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) {
ui->Append(it->first, *it->second);
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();
}