Tech ENABLE_ENHANCED_IMGUI_SLIDER_FLOAT - Changed background color of additional button and its icon

This commit is contained in:
enricoturri1966 2021-11-08 13:43:53 +01:00
parent 9752fb5810
commit 869276aedb
2 changed files with 10 additions and 6 deletions

View File

@ -9,7 +9,7 @@
viewBox="0 0 348.882 348.882"
style="enable-background:new 0 0 348.882 348.882;"
xml:space="preserve"
sodipodi:docname="edit_button_2.svg"
sodipodi:docname="edit_button_mod.svg"
inkscape:version="1.1 (c68e22c387, 2021-05-23)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
@ -28,8 +28,8 @@
inkscape:pagecheckerboard="0"
showgrid="false"
inkscape:zoom="2.3274346"
inkscape:cx="4.9410626"
inkscape:cy="174.65582"
inkscape:cx="89.583614"
inkscape:cy="140.28321"
inkscape:window-width="1920"
inkscape:window-height="1001"
inkscape:window-x="-9"
@ -39,10 +39,10 @@
<path
d="m 333.988,11.758 -0.42,-0.383 C 325.538,4.04 315.129,0 304.258,0 292.071,0 280.37,5.159 272.154,14.153 L 116.803,184.231 c -1.416,1.55 -2.49,3.379 -3.154,5.37 l -18.267,54.762 c -2.112,6.331 -1.052,13.333 2.835,18.729 3.918,5.438 10.23,8.685 16.886,8.685 0,0 0.001,0 0.001,0 2.879,0 5.693,-0.592 8.362,-1.76 l 52.89,-23.138 c 1.923,-0.841 3.648,-2.076 5.063,-3.626 L 336.771,73.176 C 352.937,55.479 351.69,27.929 333.988,11.758 Z m -203.607,222.489 10.719,-32.134 0.904,-0.99 20.316,18.556 -0.904,0.99 z M 314.621,52.943 182.553,197.53 162.237,178.974 294.305,34.386 c 2.583,-2.828 6.118,-4.386 9.954,-4.386 3.365,0 6.588,1.252 9.082,3.53 l 0.419,0.383 c 5.484,5.009 5.87,13.546 0.861,19.03 z"
id="path170"
style="fill:#ffffff;fill-opacity:1" /><path
style="fill:#ed6b21;fill-opacity:1" /><path
d="m 303.85,138.388 c -8.284,0 -15,6.716 -15,15 v 127.347 c 0,21.034 -17.113,38.147 -38.147,38.147 H 68.904 c -21.035,0 -38.147,-17.113 -38.147,-38.147 V 100.413 c 0,-21.034 17.113,-38.147 38.147,-38.147 h 131.587 c 8.284,0 15,-6.716 15,-15 0,-8.284 -6.716,-15 -15,-15 H 68.904 c -37.577,0 -68.147,30.571 -68.147,68.147 v 180.321 c 0,37.576 30.571,68.147 68.147,68.147 h 181.798 c 37.576,0 68.147,-30.571 68.147,-68.147 V 153.388 c 0.001,-8.284 -6.715,-15 -14.999,-15 z"
id="path172"
style="fill:#ffffff;fill-opacity:1" />
style="fill:#808080;fill-opacity:1" />
<g
id="g176">
</g>

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

View File

@ -52,7 +52,7 @@ static const std::map<const wchar_t, std::string> font_icons = {
{ImGui::PreferencesButton , "notification_preferences" },
{ImGui::PreferencesHoverButton , "notification_preferences_hover"},
#if ENABLE_ENHANCED_IMGUI_SLIDER_FLOAT
{ImGui::SliderFloatEditBtnIcon, "edit_button_white" },
{ImGui::SliderFloatEditBtnIcon, "edit_button" },
#endif // ENABLE_ENHANCED_IMGUI_SLIDER_FLOAT
};
static const std::map<const wchar_t, std::string> font_icons_large = {
@ -500,10 +500,14 @@ bool ImGuiWrapper::slider_float(const char* label, float* v, float v_min, float
std::wstring btn_name;
btn_name = ImGui::SliderFloatEditBtnIcon + boost::nowide::widen(std::string(label));
ImGui::PushStyleColor(ImGuiCol_Button, { 0.25f, 0.25f, 0.25f, 1.0f });
ImGui::PushStyleColor(ImGuiCol_ButtonHovered, { 0.5f, 0.5f, 0.5f, 1.0f });
ImGui::PushStyleColor(ImGuiCol_ButtonActive, { 0.5f, 0.5f, 0.5f, 1.0f });
if (ImGui::Button(into_u8(btn_name).c_str())) {
ImGui::SetKeyboardFocusHere(-1);
this->set_requires_extra_frame();
}
ImGui::PopStyleColor(3);
if (ImGui::IsItemHovered())
this->tooltip(into_u8(_L("Edit")).c_str(), max_tooltip_width);