File tree Expand file tree Collapse file tree 1 file changed +58
-0
lines changed
Expand file tree Collapse file tree 1 file changed +58
-0
lines changed Original file line number Diff line number Diff line change 1+ /*
2+
3+ Simple label component for displaying timestamps in a user interface.
4+ Used for checking build times when developing.
5+
6+ */
7+
8+
9+ #pragma once
10+
11+ #include < juce_gui_basics/juce_gui_basics.h>
12+
13+ using namespace juce ;
14+
15+ class ExtLabel : public Label
16+ {
17+ public:
18+ ExtLabel () : Label(" " , " " )
19+ {
20+ setMouseCursor (MouseCursor::PointingHandCursor);
21+ setTooltip (" Visit DirektDSP.com for more information" );
22+ setLookAndFeel (&mainLabelLookAndFeel);
23+
24+ // create a string with the current build time
25+ auto buildTime = String (__DATE__) + " " + String (__TIME__);
26+
27+ setText (" DirektDSP - " + buildTime, NotificationType::dontSendNotification);
28+ }
29+
30+ // click = open link
31+ void mouseDown (const MouseEvent& event) override
32+ {
33+ if (event.mods .isLeftButtonDown ())
34+ {
35+ URL (" https://direktdsp.com" ).launchInDefaultBrowser ();
36+ }
37+ }
38+
39+ ~ExtLabel ()
40+ {
41+ setLookAndFeel (nullptr );
42+ }
43+
44+ private:
45+ struct MainLabelLookAndFeel : public LookAndFeel_V4
46+ {
47+ MainLabelLookAndFeel ()
48+ {
49+ }
50+
51+ private:
52+ juce::Colour bgColour;
53+
54+ JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MainLabelLookAndFeel)
55+ } mainLabelLookAndFeel;
56+
57+ JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ExtLabel)
58+ };
You can’t perform that action at this time.
0 commit comments