From 0adb508ce5fbc69a4324b7278ac245f28095d38c Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 22 Dec 2023 15:04:01 +0100 Subject: [PATCH] Extract timeline content colours to a header. --- src/wx/colours.h | 25 +++++++++++++++++++++++++ src/wx/content_timeline_atmos_view.cc | 3 ++- src/wx/content_timeline_audio_view.cc | 3 ++- src/wx/content_timeline_text_view.cc | 3 ++- src/wx/content_timeline_video_view.cc | 5 +++-- 5 files changed, 34 insertions(+), 5 deletions(-) create mode 100644 src/wx/colours.h diff --git a/src/wx/colours.h b/src/wx/colours.h new file mode 100644 index 000000000..0d33208e0 --- /dev/null +++ b/src/wx/colours.h @@ -0,0 +1,25 @@ +/* + Copyright (C) 2023 Carl Hetherington + + 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 . + +*/ + + +#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)) diff --git a/src/wx/content_timeline_atmos_view.cc b/src/wx/content_timeline_atmos_view.cc index 4b78a8aee..2352ba5dc 100644 --- a/src/wx/content_timeline_atmos_view.cc +++ b/src/wx/content_timeline_atmos_view.cc @@ -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; } diff --git a/src/wx/content_timeline_audio_view.cc b/src/wx/content_timeline_audio_view.cc index 9604ee7cc..600e39057 100644 --- a/src/wx/content_timeline_audio_view.cc +++ b/src/wx/content_timeline_audio_view.cc @@ -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 diff --git a/src/wx/content_timeline_text_view.cc b/src/wx/content_timeline_text_view.cc index 3b7eeebce..f22f47850 100644 --- a/src/wx/content_timeline_text_view.cc +++ b/src/wx/content_timeline_text_view.cc @@ -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 diff --git a/src/wx/content_timeline_video_view.cc b/src/wx/content_timeline_video_view.cc index 63b26a570..d907627cd 100644 --- a/src/wx/content_timeline_video_view.cc +++ b/src/wx/content_timeline_video_view.cc @@ -19,9 +19,10 @@ */ +#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 -- 2.30.2