mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-11 08:47:52 -06:00
Implemented a possibility to set a custom toolbars icon size (related to #2247 and same others)
This commit is contained in:
parent
fb6ae5296e
commit
d845966cbb
7 changed files with 112 additions and 16 deletions
|
@ -390,6 +390,27 @@ void GUI_App::set_label_clr_sys(const wxColour& clr) {
|
|||
app_config->save();
|
||||
}
|
||||
|
||||
float GUI_App::toolbar_icon_scale(const bool is_limited/* = false*/) const
|
||||
{
|
||||
#ifdef __APPLE__
|
||||
const float icon_sc = 1.0f; // for Retina display will be used its own scale
|
||||
#else
|
||||
const float icon_sc = m_em_unit*0.1f;
|
||||
#endif // __APPLE__
|
||||
|
||||
const std::string& use_val = app_config->get("use_custom_toolbar_size");
|
||||
const std::string& val = app_config->get("custom_toolbar_size");
|
||||
|
||||
if (val.empty() || use_val.empty() || use_val == "0")
|
||||
return icon_sc;
|
||||
|
||||
int int_val = atoi(val.c_str());
|
||||
if (is_limited && int_val < 50)
|
||||
int_val = 50;
|
||||
|
||||
return 0.01f * int_val * icon_sc;
|
||||
}
|
||||
|
||||
void GUI_App::recreate_GUI()
|
||||
{
|
||||
// Weird things happen as the Paint messages are floating around the windows being destructed.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue