generated from ZL-Audio/ZLTemplate
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Loading status checks…
feat(match label): add dark background
Showing
4 changed files
with
72 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// Copyright (C) 2025 - zsliu98 | ||
// This file is part of ZLEqualizer | ||
// | ||
// ZLEqualizer is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License Version 3 as published by the Free Software Foundation. | ||
// | ||
// ZLEqualizer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU Affero General Public License along with ZLEqualizer. If not, see <https://www.gnu.org/licenses/>. | ||
|
||
#include "match_label.hpp" | ||
|
||
namespace zlPanel { | ||
MatchLabel::MatchLabel(zlInterface::UIBase &base) | ||
: uiBase(base), labelLAF(base) { | ||
runningLabel.setText("Running", juce::dontSendNotification); | ||
runningLabel.setJustificationType(juce::Justification::centred); | ||
labelLAF.setFontScale(5.f); | ||
runningLabel.setLookAndFeel(&labelLAF); | ||
addAndMakeVisible(runningLabel); | ||
setBufferedToImage(true); | ||
} | ||
|
||
void MatchLabel::paint(juce::Graphics &g) { | ||
g.fillAll(uiBase.getColourByIdx(zlInterface::backgroundColour).withAlpha(.75f)); | ||
} | ||
|
||
void MatchLabel::resized() { | ||
const auto bound = getLocalBounds().toFloat(); | ||
runningLabel.setBounds(bound.withSizeKeepingCentre( | ||
bound.getWidth() * .5f, uiBase.getFontSize() * 5.f).toNearestInt()); | ||
} | ||
} // zlPanel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// Copyright (C) 2025 - zsliu98 | ||
// This file is part of ZLEqualizer | ||
// | ||
// ZLEqualizer is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License Version 3 as published by the Free Software Foundation. | ||
// | ||
// ZLEqualizer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU Affero General Public License along with ZLEqualizer. If not, see <https://www.gnu.org/licenses/>. | ||
|
||
#ifndef ZLPANEL_MATCH_LABEL_HPP | ||
#define ZLPANEL_MATCH_LABEL_HPP | ||
|
||
#include "../../../gui/gui.hpp" | ||
|
||
namespace zlPanel { | ||
|
||
class MatchLabel : public juce::Component { | ||
public: | ||
explicit MatchLabel(zlInterface::UIBase &base); | ||
|
||
void paint(juce::Graphics &g) override; | ||
|
||
void resized() override; | ||
|
||
private: | ||
zlInterface::UIBase &uiBase; | ||
zlInterface::NameLookAndFeel labelLAF; | ||
juce::Label runningLabel; | ||
}; | ||
|
||
} // zlPanel | ||
|
||
#endif //ZLPANEL_MATCH_LABEL_HPP |