implemented color picker in dialog

Fixes #1757
This commit is contained in:
itsmattkc
2021-10-01 15:41:24 -07:00
parent ee81a47f2e
commit 7b65ecace5
13 changed files with 328 additions and 28 deletions
+21 -1
View File
@@ -82,7 +82,8 @@ Core::Core(const CoreParams& params) :
tool_(Tool::kPointer),
addable_object_(Tool::kAddableEmpty),
snapping_(true),
core_params_(params)
core_params_(params),
pixel_sampling_users_(0)
{
// Store reference to this object, making the assumption that Core will only ever be made in
// main(). This will obviously break if not.
@@ -1206,6 +1207,25 @@ void Core::BrowseAutoRecoveries()
ard.exec();
}
void Core::RequestPixelSamplingInViewers(bool e)
{
if (e) {
if (pixel_sampling_users_ == 0) {
// Signal to start pixel sampling
emit ColorPickerEnabled(true);
}
pixel_sampling_users_++;
} else {
pixel_sampling_users_--;
if (pixel_sampling_users_ == 0) {
// Signal to end pixel sampling
emit ColorPickerEnabled(false);
}
}
}
bool Core::SaveProjectAs(Project* p)
{
QFileDialog fd(main_window_, tr("Save Project As"));