mirror of
				https://github.com/Drezil/imgui.git
				synced 2025-10-31 13:11:05 +01:00 
			
		
		
		
	ColorEdit4: Fix not forwarding ImGuiColorEditFlags_AlphaBar flag to ColorPicker4 (#346)
This commit is contained in:
		| @@ -9258,7 +9258,7 @@ bool ImGui::ColorEdit4(const char* label, float col[4], ImGuiColorEditFlags flag | |||||||
|                 Separator(); |                 Separator(); | ||||||
|             } |             } | ||||||
|             float square_sz = ColorSquareSize(); |             float square_sz = ColorSquareSize(); | ||||||
|             ImGuiColorEditFlags picker_flags = (flags & (ImGuiColorEditFlags_NoAlpha|ImGuiColorEditFlags_Float)) | (ImGuiColorEditFlags_RGB | ImGuiColorEditFlags_HSV | ImGuiColorEditFlags_HEX) | ImGuiColorEditFlags_NoLabel; |             ImGuiColorEditFlags picker_flags = (flags & (ImGuiColorEditFlags_NoAlpha|ImGuiColorEditFlags_AlphaBar|ImGuiColorEditFlags_Float)) | (ImGuiColorEditFlags_RGB | ImGuiColorEditFlags_HSV | ImGuiColorEditFlags_HEX) | ImGuiColorEditFlags_NoLabel; | ||||||
|             PushItemWidth(square_sz * 12.0f); |             PushItemWidth(square_sz * 12.0f); | ||||||
|             value_changed |= ColorPicker4("##picker", col, picker_flags); |             value_changed |= ColorPicker4("##picker", col, picker_flags); | ||||||
|             PopItemWidth(); |             PopItemWidth(); | ||||||
|   | |||||||
| @@ -1768,7 +1768,7 @@ void ImGui::ShowStyleEditor(ImGuiStyle* ref) | |||||||
|             if (!filter.PassFilter(name)) |             if (!filter.PassFilter(name)) | ||||||
|                 continue; |                 continue; | ||||||
|             ImGui::PushID(i); |             ImGui::PushID(i); | ||||||
|             ImGui::ColorEdit4(name, (float*)&style.Colors[i], color_edit_flags | ImGuiColorEditFlags_NoOptions); |             ImGui::ColorEdit4(name, (float*)&style.Colors[i], color_edit_flags | ImGuiColorEditFlags_NoOptions | ImGuiColorEditFlags_AlphaBar); | ||||||
|             if (memcmp(&style.Colors[i], (ref ? &ref->Colors[i] : &default_style.Colors[i]), sizeof(ImVec4)) != 0) |             if (memcmp(&style.Colors[i], (ref ? &ref->Colors[i] : &default_style.Colors[i]), sizeof(ImVec4)) != 0) | ||||||
|             { |             { | ||||||
|                 ImGui::SameLine(); if (ImGui::Button("Revert")) style.Colors[i] = ref ? ref->Colors[i] : default_style.Colors[i]; |                 ImGui::SameLine(); if (ImGui::Button("Revert")) style.Colors[i] = ref ? ref->Colors[i] : default_style.Colors[i]; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user