Skip to content

Commit

Permalink
new symbol for indicating new simulations
Browse files Browse the repository at this point in the history
  • Loading branch information
chrxh committed Apr 25, 2024
1 parent c25626d commit c886302
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 13 deletions.
10 changes: 2 additions & 8 deletions source/Gui/AlienImGui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1491,17 +1491,12 @@ void AlienImGui::NeuronSelection(
ImGui::EndChild();
}

ImVec4 AlienImGui::GetBlinkingColor()
void AlienImGui::OnlineSymbol()
{
auto counter = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch()).count();
counter = (((counter % 2000) + 2000) % 2000);
auto color = ImColor::HSV(0.0f, counter < 1000 ? toFloat(counter) / 1000.0f : 2.0f - toFloat(counter) / 1000.0f, 1.0f);
return color.Value;
}

void AlienImGui::OnlineSymbol()
{
ImGui::PushStyleColor(ImGuiCol_Text, GetBlinkingColor());
ImGui::PushStyleColor(ImGuiCol_Text, color.Value);
ImGui::Text(ICON_FA_GENDERLESS);
ImGui::PopStyleColor();
}
Expand Down Expand Up @@ -1591,7 +1586,6 @@ bool AlienImGui::BasicSlider(Parameter const& parameters, T* value, bool* enable
}

//slider

T sliderValue;
T minValue = value[0], maxValue = value[0];
int sliderValueColor = 0;
Expand Down
1 change: 0 additions & 1 deletion source/Gui/AlienImGui.h
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,6 @@ class AlienImGui
std::vector<float>& biases,
std::vector<NeuronActivationFunction>& activationFunctions);

static ImVec4 GetBlinkingColor();
static void OnlineSymbol();
static void LastDayOnlineSymbol();

Expand Down
11 changes: 8 additions & 3 deletions source/Gui/BrowserWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -770,12 +770,17 @@ bool _BrowserWindow::processResourceNameField(NetworkResourceTreeTO const& treeT
ImGui::SameLine();

if (!_simIdsFromLastSession.contains(leaf.rawTO->id)) {
ImGui::PushFont(StyleRepository::getInstance().getSmallBoldFont());
ImGui::PushStyleColor(ImGuiCol_Text, AlienImGui::GetBlinkingColor());
auto font = StyleRepository::getInstance().getSmallBoldFont();
auto origSize = font->Scale;
font->Scale *= 0.65f;
ImGui::PushFont(font);
ImGui::PushStyleColor(ImGuiCol_Text, Const::BrowserResourceNewTextColor.Value);
AlienImGui::Text("NEW");
ImGui::PopStyleColor();
ImGui::SameLine();
font->Scale = origSize;
ImGui::PopFont();

ImGui::SameLine();
}

processShortenedText(leaf.leafName, true);
Expand Down
2 changes: 1 addition & 1 deletion source/Gui/StyleRepository.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ namespace Const
ImColor const BrowserResourceTextColor = ImColor::HSV(0.0f, 0.0f, 1.0f);
ImColor const BrowserResourceLineColor = ImColor::HSV(0.0f, 0.0f, 0.5f);
ImColor const BrowserResourcePropertiesTextColor = ImColor::HSV(0.0f, 0.0f, 0.5f, 1.0f);
ImColor const BrowserResourceNewTextColor = ImColor::HSV(0.0f, 0.0f, 1.0f, 1.0f);
ImColor const BrowserResourceNewTextColor = ImColor::HSV(0.15f, 0.8f, 1.0f);
ImColor const BrowserResourceSymbolColor = ImColor::HSV(0.0f, 0.0f, 1.0f, 1.0f);

ImColor const BrowserVersionOkTextColor = ImColor::HSV(0.58f, 0.2f, 1.0f);
Expand Down

0 comments on commit c886302

Please sign in to comment.