summaryrefslogtreecommitdiffstats
path: root/src/ui/dialog
diff options
context:
space:
mode:
authorTavmjong Bah <tavmjong@free.fr>2015-05-18 10:58:20 +0000
committertavmjong-free <tavmjong@free.fr>2015-05-18 10:58:20 +0000
commit6c2374a5e4f15e5b6a673a0cfdb856c4b0e86f10 (patch)
tree3cc78e5548b5a4fef797803f4a8452d0e3db7587 /src/ui/dialog
parentLatvian translation update (diff)
parentfixed: color icc selector - extra rows on startup (diff)
downloadinkscape-6c2374a5e4f15e5b6a673a0cfdb856c4b0e86f10.tar.gz
inkscape-6c2374a5e4f15e5b6a673a0cfdb856c4b0e86f10.zip
Merge in Tomasz's fill-n-stroke-cppify branch
after fixing inkscape.pot file and conflicts with adding files. (bzr r14160)
Diffstat (limited to 'src/ui/dialog')
-rw-r--r--src/ui/dialog/objects.cpp33
-rw-r--r--src/ui/dialog/objects.h9
-rw-r--r--src/ui/dialog/tags.cpp2
3 files changed, 22 insertions, 22 deletions
diff --git a/src/ui/dialog/objects.cpp b/src/ui/dialog/objects.cpp
index 781c6ef93..be04e7149 100644
--- a/src/ui/dialog/objects.cpp
+++ b/src/ui/dialog/objects.cpp
@@ -45,6 +45,7 @@
#include "style.h"
#include "ui/tools-switch.h"
#include "ui/icon-names.h"
+#include "ui/selected-color.h"
#include "ui/widget/imagetoggler.h"
#include "ui/widget/layertypeicon.h"
#include "ui/widget/insertordericon.h"
@@ -53,7 +54,7 @@
#include "ui/tools/node-tool.h"
#include "ui/tools/tool-base.h"
#include "verbs.h"
-#include "widgets/sp-color-notebook.h"
+#include "ui/widget/color-notebook.h"
#include "widgets/icon.h"
#include "xml/node.h"
#include "xml/node-observer.h"
@@ -928,12 +929,12 @@ bool ObjectsPanel::_handleButtonEvent(GdkEventButton* event)
//If the current item is not selected, store only it in the highlight source
_storeHighlightTarget(iter);
}
- if (_colorSelector)
+ if (_selectedColor)
{
//Set up the color selector
SPColor color;
color.set( row[_model->_colHighlight] );
- _colorSelector->base->setColorAlpha(color, SP_RGBA32_A_F(row[_model->_colHighlight]));
+ _selectedColor->setColorAlpha(color, SP_RGBA32_A_F(row[_model->_colHighlight]));
}
//Show the color selector dialog
_colorSelectorDialog.show();
@@ -1440,17 +1441,16 @@ void ObjectsPanel::_setExpanded(const Gtk::TreeModel::iterator& iter, const Gtk:
* @param csel Color selector
* @param cp Objects panel
*/
-void sp_highlight_picker_color_mod(SPColorSelector *csel, GObject * cp)
+void ObjectsPanel::_highlightPickerColorMod()
{
SPColor color;
float alpha = 0;
- csel->base->getColorAlpha(color, alpha);
+ _selectedColor->colorAlpha(color, alpha);
+
guint32 rgba = color.toRGBA32( alpha );
-
- ObjectsPanel *ptr = reinterpret_cast<ObjectsPanel *>(cp);
//Set the highlight color for all items in the _highlight_target (all selected items)
- for (std::vector<SPItem *>::iterator iter = ptr->_highlight_target.begin(); iter != ptr->_highlight_target.end(); ++iter)
+ for (std::vector<SPItem *>::iterator iter = _highlight_target.begin(); iter != _highlight_target.end(); ++iter)
{
SPItem * target = *iter;
target->setHighlightColor(rgba);
@@ -1922,18 +1922,16 @@ ObjectsPanel::ObjectsPanel() :
_colorSelectorDialog.set_title (_("Select Highlight Color"));
_colorSelectorDialog.set_border_width (4);
_colorSelectorDialog.property_modal() = true;
- _colorSelector = SP_COLOR_SELECTOR(sp_color_selector_new(SP_TYPE_COLOR_NOTEBOOK));
+ _selectedColor.reset(new Inkscape::UI::SelectedColor);
+ Gtk::Widget *color_selector = Gtk::manage(new Inkscape::UI::Widget::ColorNotebook(*_selectedColor));
_colorSelectorDialog.get_vbox()->pack_start (
- *Glib::wrap(&_colorSelector->vbox), true, true, 0);
+ *color_selector, true, true, 0);
- g_signal_connect(G_OBJECT(_colorSelector), "dragged",
- G_CALLBACK(sp_highlight_picker_color_mod), (void *)this);
- g_signal_connect(G_OBJECT(_colorSelector), "released",
- G_CALLBACK(sp_highlight_picker_color_mod), (void *)this);
- g_signal_connect(G_OBJECT(_colorSelector), "changed",
- G_CALLBACK(sp_highlight_picker_color_mod), (void *)this);
+ _selectedColor->signal_dragged.connect(sigc::mem_fun(*this, &ObjectsPanel::_highlightPickerColorMod));
+ _selectedColor->signal_released.connect(sigc::mem_fun(*this, &ObjectsPanel::_highlightPickerColorMod));
+ _selectedColor->signal_changed.connect(sigc::mem_fun(*this, &ObjectsPanel::_highlightPickerColorMod));
- gtk_widget_show(GTK_WIDGET(_colorSelector));
+ color_selector->show();
setDesktop( targetDesktop );
@@ -1951,7 +1949,6 @@ ObjectsPanel::~ObjectsPanel()
{
//Close the highlight selection dialog
_colorSelectorDialog.hide();
- _colorSelector = NULL;
//Set the desktop to null, which will disconnect all object watchers
setDesktop(NULL);
diff --git a/src/ui/dialog/objects.h b/src/ui/dialog/objects.h
index 1842fea11..7a826d02e 100644
--- a/src/ui/dialog/objects.h
+++ b/src/ui/dialog/objects.h
@@ -16,6 +16,7 @@
# include <config.h>
#endif
+#include <boost/scoped_ptr.hpp>
#include <gtkmm/box.h>
#include <gtkmm/treeview.h>
#include <gtkmm/treestore.h>
@@ -36,6 +37,9 @@ struct SPColorSelector;
namespace Inkscape {
namespace UI {
+
+class SelectedColor;
+
namespace Dialog {
@@ -166,8 +170,7 @@ private:
Gtk::Alignment _blur_alignment;
Gtk::Dialog _colorSelectorDialog;
- SPColorSelector *_colorSelector;
-
+ boost::scoped_ptr<Inkscape::UI::SelectedColor> _selectedColor;
//Methods:
@@ -233,7 +236,7 @@ private:
void setupDialog(const Glib::ustring &title);
- friend void sp_highlight_picker_color_mod(SPColorSelector *csel, GObject *cp);
+ void _highlightPickerColorMod();
};
diff --git a/src/ui/dialog/tags.cpp b/src/ui/dialog/tags.cpp
index ed71c826f..f36e3f18d 100644
--- a/src/ui/dialog/tags.cpp
+++ b/src/ui/dialog/tags.cpp
@@ -51,7 +51,7 @@
#include "ui/tools/tool-base.h" //"event-context.h"
#include "selection.h"
//#include "dialogs/dialog-events.h"
-#include "widgets/sp-color-notebook.h"
+#include "ui/widget/color-notebook.h"
#include "style.h"
#include "filter-chemistry.h"
#include "filters/blend.h"