/*
5 * Copyright (C) 2024 Authors
6 * Released under GNU GPL v2+, read the file
'COPYING' for more information.
11#include <gtkmm/adjustment.h>
13#include <gtkmm/grid.h>
14#include <gtkmm/label.h>
35 , _space(
std::move(space))
36 , _selected_colors(
std::move(colors))
37 , _specific_colors(
std::make_shared<Colors::
ColorSet>(_space, true))
38 , _expander(
get_widget<
Gtk::Expander>(_builder,
"wheel-expander"))
40 set_name(
"ColorPage");
63 signal_map().connect([
this]() {
69 signal_unmap().connect([
this]() {
80 std::string
index = std::to_string(component.index + 1);
81 _channels.emplace_back(std::make_unique<ColorPageChannel>(
85 get_derived_widget<InkSpinButton>(
_builder, (
"spin" +
index).c_str())
91 std::string
index = std::to_string(j+1);
102 _expander.property_expanded().signal_changed().connect([
this, wheel_type]() {
103 auto on =
_expander.property_expanded().get_value();
128 std::shared_ptr<Colors::ColorSet> color,
135 , _adj(spin.get_adjustment()), _color(
std::move(color))
138 _label.set_markup_with_mnemonic(component.name);
139 _label.set_tooltip_text(component.tip);
143 _adj->set_lower(0.0);
144 _adj->set_upper(component.scale);
145 _adj->set_page_increment(0.0);
146 _adj->set_page_size(0.0);
154 _adj->set_value(_slider.getScaled());
std::shared_ptr< Colors::ColorSet > _color
Glib::RefPtr< Gtk::Adjustment > _adj
ColorPageChannel(std::shared_ptr< Colors::ColorSet > color, Gtk::Label &label, ColorSlider &slider, InkSpinButton &spin)
sigc::scoped_connection _color_changed
sigc::scoped_connection _adj_changed
sigc::scoped_connection _slider_changed
std::shared_ptr< ColorSet > _specific_colors
std::shared_ptr< ColorSet > _selected_colors
ColorWheel * _color_wheel
Gtk::Expander & _expander
ColorPage(std::shared_ptr< Space::AnySpace > space, std::shared_ptr< ColorSet > colors)
std::vector< std::unique_ptr< ColorPageChannel > > _channels
sigc::scoped_connection _color_wheel_changed
sigc::scoped_connection _specific_changed_connection
Glib::RefPtr< Gtk::Builder > _builder
sigc::scoped_connection _selected_changed_connection
RAII blocker for sigc++ signals.
Build a set of color sliders for a given color space.
A set of colors which can be modified together used for color pickers.
W & get_widget(const Glib::RefPtr< Gtk::Builder > &builder, const char *id)
Glib::RefPtr< Gtk::Builder > create_builder(const char *filename)
bool hide_widget(const Glib::RefPtr< Gtk::Builder > &builder, std::string const &id)
static void append(std::vector< T > &target, std::vector< T > &&source)