Extract timeline content colours to a header.
authorCarl Hetherington <cth@carlh.net>
Fri, 22 Dec 2023 14:04:01 +0000 (15:04 +0100)
committerCarl Hetherington <cth@carlh.net>
Tue, 12 Mar 2024 22:41:00 +0000 (23:41 +0100)
src/wx/colours.h [new file with mode: 0644]
src/wx/content_timeline_atmos_view.cc
src/wx/content_timeline_audio_view.cc
src/wx/content_timeline_text_view.cc
src/wx/content_timeline_video_view.cc

diff --git a/src/wx/colours.h b/src/wx/colours.h
new file mode 100644 (file)
index 0000000..0d33208
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+    Copyright (C) 2023 Carl Hetherington <cth@carlh.net>
+
+    This file is part of DCP-o-matic.
+
+    DCP-o-matic is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    DCP-o-matic 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 General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with DCP-o-matic.  If not, see <http://www.gnu.org/licenses/>.
+
+*/
+
+
+#define VIDEO_CONTENT_COLOUR (wxColour(242, 92, 120, 255))
+#define AUDIO_CONTENT_COLOUR (wxColour(149, 121, 232, 255))
+#define TEXT_CONTENT_COLOUR (wxColour(163, 255, 154, 255))
+#define ATMOS_CONTENT_COLOUR (wxColour(149, 121, 232, 255))
index 4b78a8aeeadacee99ffa9690c01820ae55aebe7d..2352ba5dca702f77542dc621eaae2f2426699a6a 100644 (file)
@@ -19,6 +19,7 @@
 */
 
 
+#include "colours.h"
 #include "content_timeline_atmos_view.h"
 
 
@@ -39,7 +40,7 @@ ContentTimelineAtmosView::ContentTimelineAtmosView(ContentTimeline& tl, shared_p
 wxColour
 ContentTimelineAtmosView::background_colour() const
 {
-       return wxColour (149, 121, 232, 255);
+       return ATMOS_CONTENT_COLOUR;
 }
 
 
index 9604ee7cc4a0cf2c1ffc2a729f5e13ec61f34d5b..600e39057ed369169167579adfe4e3011cba3299 100644 (file)
@@ -19,6 +19,7 @@
 */
 
 
+#include "colours.h"
 #include "content_timeline_audio_view.h"
 #include "wx_util.h"
 #include "lib/audio_content.h"
@@ -44,7 +45,7 @@ ContentTimelineAudioView::ContentTimelineAudioView(ContentTimeline& tl, shared_p
 wxColour
 ContentTimelineAudioView::background_colour () const
 {
-       return wxColour (149, 121, 232, 255);
+       return AUDIO_CONTENT_COLOUR;
 }
 
 wxColour
index 3b7eeebce78a5009aefe3f472602415a4e21145e..f22f47850569f93ee9b7216e5dd7e529a8e859dc 100644 (file)
@@ -19,6 +19,7 @@
 */
 
 
+#include "colours.h"
 #include "content_timeline_text_view.h"
 #include "lib/text_content.h"
 #include "lib/content.h"
@@ -41,7 +42,7 @@ ContentTimelineTextView::background_colour() const
                return wxColour (210, 210, 210, 128);
        }
 
-       return wxColour (163, 255, 154, 255);
+       return TEXT_CONTENT_COLOUR;
 }
 
 wxColour
index 63b26a570f3aed1399e340939d208445c6e21963..d907627cde85a4d3d108d80063c39457b6a99b83 100644 (file)
 */
 
 
+#include "colours.h"
+#include "content_timeline_video_view.h"
 #include "lib/image_content.h"
 #include "lib/video_content.h"
-#include "content_timeline_video_view.h"
 
 
 using std::dynamic_pointer_cast;
@@ -41,7 +42,7 @@ ContentTimelineVideoView::background_colour() const
                return wxColour (210, 210, 210, 128);
        }
 
-       return wxColour (242, 92, 120, 255);
+       return VIDEO_CONTENT_COLOUR;
 }
 
 wxColour