summaryrefslogtreecommitdiffstats
path: root/src/ui
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/dialog/calligraphic-profile-rename.h2
-rw-r--r--src/ui/dialog/document-properties.cpp23
-rw-r--r--src/ui/dialog/document-properties.h1
-rw-r--r--src/ui/dialog/export.cpp2
-rw-r--r--src/ui/dialog/filter-effects-dialog.cpp2
-rw-r--r--src/ui/dialog/object-properties.cpp554
-rw-r--r--src/ui/dialog/object-properties.h126
-rw-r--r--src/ui/dialog/objects.cpp23
-rw-r--r--src/ui/dialog/objects.h8
-rw-r--r--src/ui/dialog/undo-history.cpp2
-rw-r--r--src/ui/dialog/xml-tree.cpp3
-rw-r--r--src/ui/widget/addtoicon.cpp8
-rw-r--r--src/ui/widget/clipmaskicon.cpp7
-rw-r--r--src/ui/widget/layertypeicon.cpp7
-rw-r--r--src/ui/widget/registered-widget.cpp6
-rw-r--r--src/ui/widget/registered-widget.h8
16 files changed, 406 insertions, 376 deletions
diff --git a/src/ui/dialog/calligraphic-profile-rename.h b/src/ui/dialog/calligraphic-profile-rename.h
index 3256338eb..fa13db196 100644
--- a/src/ui/dialog/calligraphic-profile-rename.h
+++ b/src/ui/dialog/calligraphic-profile-rename.h
@@ -16,7 +16,7 @@
#endif
#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H
-#include <glibmm/threads.h>
+# include <glibmm/threads.h>
#endif
#include <gtkmm/dialog.h>
diff --git a/src/ui/dialog/document-properties.cpp b/src/ui/dialog/document-properties.cpp
index 0411c789c..a31ab1a09 100644
--- a/src/ui/dialog/document-properties.cpp
+++ b/src/ui/dialog/document-properties.cpp
@@ -35,6 +35,7 @@
#include "sp-namedview.h"
#include "sp-root.h"
#include "sp-script.h"
+#include "style.h"
#include "svg/stringstream.h"
#include "tools-switch.h"
#include "ui/widget/color-picker.h"
@@ -106,6 +107,7 @@ DocumentProperties::DocumentProperties()
_page_metadata1(Gtk::manage(new UI::Widget::NotebookPage(1, 1))),
_page_metadata2(Gtk::manage(new UI::Widget::NotebookPage(1, 1))),
//---------------------------------------------------------------
+ _rcb_antialias(_("Use antialiasing"), _("If unset, no antialiasing will be done on the drawing"), "shape-rendering", _wr, false, NULL, NULL, NULL, "crispEdges"),
_rcb_canb(_("Show page _border"), _("If set, rectangular page border is shown"), "showborder", _wr, false),
_rcb_bord(_("Border on _top of drawing"), _("If set, border is always on top of the drawing"), "borderlayer", _wr, false),
_rcb_shad(_("_Show border shadow"), _("If set, page border shows a shadow on its right and lower side"), "inkscape:showpageshadow", _wr, false),
@@ -239,7 +241,8 @@ inline void attach_all(Gtk::Table &table, Gtk::Widget *const arr[], unsigned con
yoptions = Gtk::FILL|Gtk::EXPAND;
}
if (docum_prop_flag) {
- if( i==(n-4) || i==(n-6) ) {
+ // this sets the padding for subordinate widgets on the "Page" page
+ if( i==(n-8) || i==(n-10) ) {
#if WITH_GTKMM_3_0
arr[i+1]->set_hexpand();
arr[i+1]->set_margin_left(20);
@@ -316,28 +319,28 @@ void DocumentProperties::build_page()
Gtk::Label* label_gen = manage (new Gtk::Label);
label_gen->set_markup (_("<b>General</b>"));
- Gtk::Label* label_col = manage (new Gtk::Label);
- label_col->set_markup (_("<b>Color</b>"));
- Gtk::Label* label_bor = manage (new Gtk::Label);
- label_bor->set_markup (_("<b>Border</b>"));
Gtk::Label *label_for = manage (new Gtk::Label);
label_for->set_markup (_("<b>Page Size</b>"));
+ Gtk::Label* label_dsp = manage (new Gtk::Label);
+ label_dsp->set_markup (_("<b>Display</b>"));
_page_sizer.init();
Gtk::Widget *const widget_array[] =
{
label_gen, 0,
0, &_rum_deflt,
- label_col, 0,
- _rcp_bg._label, &_rcp_bg,
+ //label_col, 0,
+ //_rcp_bg._label, &_rcp_bg,
0, 0,
label_for, 0,
0, &_page_sizer,
0, 0,
- label_bor, 0,
+ label_dsp, 0,
0, &_rcb_canb,
0, &_rcb_bord,
0, &_rcb_shad,
+ 0, &_rcb_antialias,
+ _rcp_bg._label, &_rcp_bg,
_rcp_bord._label, &_rcp_bord,
};
@@ -1473,6 +1476,10 @@ void DocumentProperties::update()
_rcp_bord.setRgba32 (nv->bordercolor);
_rcb_shad.setActive (nv->showpageshadow);
+ SPRoot *root = dt->getDocument()->getRoot();
+ _rcb_antialias.set_xml_target(root->getRepr(), dt->getDocument());
+ _rcb_antialias.setActive(root->style->shape_rendering.computed != SP_CSS_SHAPE_RENDERING_CRISPEDGES);
+
if (nv->doc_units) {
_rum_deflt.setUnit (nv->doc_units->abbr);
}
diff --git a/src/ui/dialog/document-properties.h b/src/ui/dialog/document-properties.h
index e3ca91731..495f3177d 100644
--- a/src/ui/dialog/document-properties.h
+++ b/src/ui/dialog/document-properties.h
@@ -117,6 +117,7 @@ protected:
UI::Widget::Registry _wr;
//---------------------------------------------------------------
+ UI::Widget::RegisteredCheckButton _rcb_antialias;
UI::Widget::RegisteredCheckButton _rcb_canb;
UI::Widget::RegisteredCheckButton _rcb_bord;
UI::Widget::RegisteredCheckButton _rcb_shad;
diff --git a/src/ui/dialog/export.cpp b/src/ui/dialog/export.cpp
index f0a5f1bf5..913713e5c 100644
--- a/src/ui/dialog/export.cpp
+++ b/src/ui/dialog/export.cpp
@@ -1049,7 +1049,7 @@ void Export::onExport ()
dpi = atof(dpi_hint);
}
if (dpi == 0.0) {
- dpi = DPI_BASE;
+ dpi = getValue(xdpi_adj);
}
Geom::OptRect area = item->desktopVisualBounds();
diff --git a/src/ui/dialog/filter-effects-dialog.cpp b/src/ui/dialog/filter-effects-dialog.cpp
index 65bebbd14..c2367c2a2 100644
--- a/src/ui/dialog/filter-effects-dialog.cpp
+++ b/src/ui/dialog/filter-effects-dialog.cpp
@@ -1515,7 +1515,7 @@ void FilterEffectsDialog::FilterModifier::on_name_edited(const Glib::ustring& pa
}
}
-bool FilterEffectsDialog::FilterModifier::on_filter_move(const Glib::RefPtr<Gdk::DragContext>& /*context*/, int x, int y, guint /*time*/) {
+bool FilterEffectsDialog::FilterModifier::on_filter_move(const Glib::RefPtr<Gdk::DragContext>& /*context*/, int /*x*/, int /*y*/, guint /*time*/) {
//const Gtk::TreeModel::Path& /*path*/) {
/* The code below is bugged. Use of "object->getRepr()->setPosition(0)" is dangerous!
diff --git a/src/ui/dialog/object-properties.cpp b/src/ui/dialog/object-properties.cpp
index 8f36cba43..28e9b360b 100644
--- a/src/ui/dialog/object-properties.cpp
+++ b/src/ui/dialog/object-properties.cpp
@@ -28,9 +28,9 @@
#include "object-properties.h"
#include "widgets/sp-attribute-widget.h"
-#include "../../desktop-handles.h"
-#include "../../document.h"
-#include "../../document-undo.h"
+#include "desktop-handles.h"
+#include "document.h"
+#include "document-undo.h"
#include "verbs.h"
#include "inkscape.h"
#include "selection.h"
@@ -51,482 +51,479 @@ namespace Inkscape {
namespace UI {
namespace Dialog {
-ObjectProperties::ObjectProperties (void) :
- UI::Widget::Panel ("", "/dialogs/object/", SP_VERB_DIALOG_ITEM),
- blocked (false),
- CurrentItem(NULL),
-#if WITH_GTKMM_3_0
- TopTable(Gtk::manage(new Gtk::Grid())),
-#else
- TopTable(Gtk::manage(new Gtk::Table(4, 4))),
-#endif
- LabelID(_("_ID:"), 1),
- LabelLabel(_("_Label:"), 1),
- LabelTitle(_("_Title:"),1),
- LabelImageRendering(_("_Image Rendering:"),1),
- LabelDescription(_("_Description:"),1),
- FrameDescription("", FALSE),
- HBoxCheck(FALSE, 0),
-#if WITH_GTKMM_3_0
- CheckTable(Gtk::manage(new Gtk::Grid())),
-#else
- CheckTable(Gtk::manage(new Gtk::Table(1, 2, true))),
-#endif
- CBHide(_("_Hide"), 1),
- CBLock(_("L_ock"), 1),
- BSet (_("_Set"), 1),
- LabelInteractivity(_("_Interactivity"), 1),
- attrTable(Gtk::manage(new SPAttributeTable())),
- desktop(NULL),
- deskTrack(),
- selectChangedConn(),
- subselChangedConn()
+ObjectProperties::ObjectProperties()
+ : UI::Widget::Panel ("", "/dialogs/object/", SP_VERB_DIALOG_ITEM)
+ , _blocked (false)
+ , _current_item(NULL)
+ , _label_id(_("_ID:"), 1)
+ , _label_label(_("_Label:"), 1)
+ , _label_title(_("_Title:"), 1)
+ , _label_image_rendering(_("_Image Rendering:"), 1)
+ , _cb_hide(_("_Hide"), 1)
+ , _cb_lock(_("L_ock"), 1)
+ , _attr_table(Gtk::manage(new SPAttributeTable()))
+ , _desktop(NULL)
{
//initialize labels for the table at the bottom of the dialog
- int_attrs.push_back("onclick");
- int_attrs.push_back("onmouseover");
- int_attrs.push_back("onmouseout");
- int_attrs.push_back("onmousedown");
- int_attrs.push_back("onmouseup");
- int_attrs.push_back("onmousemove");
- int_attrs.push_back("onfocusin");
- int_attrs.push_back("onfocusout");
- int_attrs.push_back("onload");
-
- int_labels.push_back("onclick:");
- int_labels.push_back("onmouseover:");
- int_labels.push_back("onmouseout:");
- int_labels.push_back("onmousedown:");
- int_labels.push_back("onmouseup:");
- int_labels.push_back("onmousemove:");
- int_labels.push_back("onfocusin:");
- int_labels.push_back("onfocusout:");
- int_labels.push_back("onload:");
-
- desktopChangeConn = deskTrack.connectDesktopChanged( sigc::mem_fun(*this, &ObjectProperties::setTargetDesktop) );
- deskTrack.connect(GTK_WIDGET(gobj()));
-
-#if WITH_GTKMM_3_0
- CheckTable->set_row_homogeneous();
- CheckTable->set_column_homogeneous(true);
-#endif
-
- MakeWidget();
+ _int_attrs.push_back("onclick");
+ _int_attrs.push_back("onmouseover");
+ _int_attrs.push_back("onmouseout");
+ _int_attrs.push_back("onmousedown");
+ _int_attrs.push_back("onmouseup");
+ _int_attrs.push_back("onmousemove");
+ _int_attrs.push_back("onfocusin");
+ _int_attrs.push_back("onfocusout");
+ _int_attrs.push_back("onload");
+
+ _int_labels.push_back("onclick:");
+ _int_labels.push_back("onmouseover:");
+ _int_labels.push_back("onmouseout:");
+ _int_labels.push_back("onmousedown:");
+ _int_labels.push_back("onmouseup:");
+ _int_labels.push_back("onmousemove:");
+ _int_labels.push_back("onfocusin:");
+ _int_labels.push_back("onfocusout:");
+ _int_labels.push_back("onload:");
+
+ _desktop_changed_connection = _desktop_tracker.connectDesktopChanged(
+ sigc::mem_fun(*this, &ObjectProperties::_setTargetDesktop)
+ );
+ _desktop_tracker.connect(GTK_WIDGET(gobj()));
+
+ _init();
}
-ObjectProperties::~ObjectProperties (void)
+ObjectProperties::~ObjectProperties()
{
- subselChangedConn.disconnect();
- selectChangedConn.disconnect();
- desktopChangeConn.disconnect();
- deskTrack.disconnect();
+ _subselection_changed_connection.disconnect();
+ _selection_changed_connection.disconnect();
+ _desktop_changed_connection.disconnect();
+ _desktop_tracker.disconnect();
}
-void ObjectProperties::MakeWidget(void)
+void ObjectProperties::_init()
{
Gtk::Box *contents = _getContents();
contents->set_spacing(0);
-
- TopTable->set_border_width(4);
#if WITH_GTKMM_3_0
- TopTable->set_row_spacing(4);
- TopTable->set_column_spacing(0);
+ Gtk::Grid *grid_top = Gtk::manage(new Gtk::Grid());
+ grid_top->set_row_spacing(4);
+ grid_top->set_column_spacing(0);
#else
- TopTable->set_row_spacings(4);
- TopTable->set_col_spacings(0);
+ Gtk::Table *grid_top = Gtk::manage(new Gtk::Table(4, 4));
+ grid_top->set_row_spacings(4);
+ grid_top->set_col_spacings(0);
#endif
- contents->pack_start (*TopTable, false, false, 0);
+ grid_top->set_border_width(4);
+
+ contents->pack_start(*grid_top, false, false, 0);
+
/* Create the label for the object id */
- LabelID.set_label (LabelID.get_label() + " ");
- LabelID.set_alignment (1, 0.5);
+ _label_id.set_label(_label_id.get_label() + " ");
+ _label_id.set_alignment(1, 0.5);
#if WITH_GTKMM_3_0
- LabelID.set_valign(Gtk::ALIGN_CENTER);
- TopTable->attach(LabelID, 0, 0, 1, 1);
+ _label_id.set_valign(Gtk::ALIGN_CENTER);
+ grid_top->attach(_label_id, 0, 0, 1, 1);
#else
- TopTable->attach(LabelID, 0, 1, 0, 1,
- Gtk::SHRINK | Gtk::FILL,
- Gtk::AttachOptions(), 0, 0 );
+ grid_top->attach(_label_id, 0, 1, 0, 1,
+ Gtk::SHRINK | Gtk::FILL,
+ Gtk::AttachOptions(), 0, 0 );
#endif
+
/* Create the entry box for the object id */
- EntryID.set_tooltip_text (_("The id= attribute (only letters, digits, and the characters .-_: allowed)"));
- EntryID.set_max_length (64);
+ _entry_id.set_tooltip_text(_("The id= attribute (only letters, digits, and the characters .-_: allowed)"));
+ _entry_id.set_max_length(64);
#if WITH_GTKMM_3_0
- EntryID.set_valign(Gtk::ALIGN_CENTER);
- TopTable->attach(EntryID, 1, 0, 1, 1);
+ _entry_id.set_valign(Gtk::ALIGN_CENTER);
+ grid_top->attach(_entry_id, 1, 0, 1, 1);
#else
- TopTable->attach(EntryID, 1, 2, 0, 1,
+ grid_top->attach(_entry_id, 1, 2, 0, 1,
Gtk::EXPAND | Gtk::FILL,
Gtk::AttachOptions(), 0, 0 );
#endif
- LabelID.set_mnemonic_widget (EntryID);
+ _label_id.set_mnemonic_widget(_entry_id);
// pressing enter in the id field is the same as clicking Set:
- EntryID.signal_activate().connect(sigc::mem_fun(this, &ObjectProperties::label_changed));
+ _entry_id.signal_activate().connect(sigc::mem_fun(this, &ObjectProperties::_labelChanged));
// focus is in the id field initially:
- EntryID.grab_focus();
+ _entry_id.grab_focus();
+
/* Create the label for the object label */
- LabelLabel.set_label (LabelLabel.get_label() + " ");
- LabelLabel.set_alignment (1, 0.5);
+ _label_label.set_label(_label_label.get_label() + " ");
+ _label_label.set_alignment(1, 0.5);
#if WITH_GTKMM_3_0
- LabelLabel.set_valign(Gtk::ALIGN_CENTER);
- TopTable->attach(LabelLabel, 0, 1, 1, 1);
+ _label_label.set_valign(Gtk::ALIGN_CENTER);
+ grid_top->attach(_label_label, 0, 1, 1, 1);
#else
- TopTable->attach(LabelLabel, 0, 1, 1, 2,
+ grid_top->attach(_label_label, 0, 1, 1, 2,
Gtk::SHRINK | Gtk::FILL,
Gtk::AttachOptions(), 0, 0 );
#endif
+
/* Create the entry box for the object label */
- EntryLabel.set_tooltip_text (_("A freeform label for the object"));
- EntryLabel.set_max_length (256);
+ _entry_label.set_tooltip_text(_("A freeform label for the object"));
+ _entry_label.set_max_length(256);
#if WITH_GTKMM_3_0
- EntryLabel.set_hexpand();
- EntryLabel.set_valign(Gtk::ALIGN_CENTER);
- TopTable->attach(EntryLabel, 1, 1, 1, 1);
+ _entry_label.set_hexpand();
+ _entry_label.set_valign(Gtk::ALIGN_CENTER);
+ grid_top->attach(_entry_label, 1, 1, 1, 1);
#else
- TopTable->attach(EntryLabel, 1, 2, 1, 2,
+ grid_top->attach(_entry_label, 1, 2, 1, 2,
Gtk::EXPAND | Gtk::FILL,
Gtk::AttachOptions(), 0, 0 );
#endif
- LabelLabel.set_mnemonic_widget (EntryLabel);
+ _label_label.set_mnemonic_widget(_entry_label);
// pressing enter in the label field is the same as clicking Set:
- EntryLabel.signal_activate().connect(sigc::mem_fun(this, &ObjectProperties::label_changed));
+ _entry_label.signal_activate().connect(sigc::mem_fun(this, &ObjectProperties::_labelChanged));
+
/* Create the label for the object title */
- LabelTitle.set_label (LabelTitle.get_label() + " ");
- LabelTitle.set_alignment (1, 0.5);
+ _label_title.set_label(_label_title.get_label() + " ");
+ _label_title.set_alignment (1, 0.5);
#if WITH_GTKMM_3_0
- LabelTitle.set_valign(Gtk::ALIGN_CENTER);
- TopTable->attach(LabelTitle, 0, 2, 1, 1);
+ _label_title.set_valign(Gtk::ALIGN_CENTER);
+ grid_top->attach(_label_title, 0, 2, 1, 1);
#else
- TopTable->attach(LabelTitle, 0, 1, 2, 3,
+ grid_top->attach(_label_title, 0, 1, 2, 3,
Gtk::SHRINK | Gtk::FILL,
Gtk::AttachOptions(), 0, 0 );
#endif
/* Create the entry box for the object title */
- EntryTitle.set_sensitive (FALSE);
- EntryTitle.set_max_length (256);
+ _entry_title.set_sensitive (FALSE);
+ _entry_title.set_max_length (256);
#if WITH_GTKMM_3_0
- EntryTitle.set_hexpand();
- EntryTitle.set_valign(Gtk::ALIGN_CENTER);
- TopTable->attach(EntryTitle, 1, 2, 1, 1);
+ _entry_title.set_hexpand();
+ _entry_title.set_valign(Gtk::ALIGN_CENTER);
+ grid_top->attach(_entry_title, 1, 2, 1, 1);
#else
- TopTable->attach(EntryTitle, 1, 2, 2, 3,
+ grid_top->attach(_entry_title, 1, 2, 2, 3,
Gtk::EXPAND | Gtk::FILL,
Gtk::AttachOptions(), 0, 0 );
#endif
- LabelTitle.set_mnemonic_widget (EntryTitle);
+ _label_title.set_mnemonic_widget(_entry_title);
// pressing enter in the label field is the same as clicking Set:
- EntryTitle.signal_activate().connect(sigc::mem_fun(this, &ObjectProperties::label_changed));
+ _entry_title.signal_activate().connect(sigc::mem_fun(this, &ObjectProperties::_labelChanged));
/* Create the frame for the object description */
- FrameDescription.set_label_widget (LabelDescription);
- FrameDescription.set_padding (0,0,0,0);
- contents->pack_start (FrameDescription, true, true, 0);
+ Gtk::Label *label_desc = Gtk::manage(new Gtk::Label(_("_Description:"), 1));
+ UI::Widget::Frame *frame_desc = Gtk::manage(new UI::Widget::Frame("", FALSE));
+ frame_desc->set_label_widget(*label_desc);
+ frame_desc->set_padding (0,0,0,0);
+ contents->pack_start(*frame_desc, true, true, 0);
/* Create the text view box for the object description */
- FrameTextDescription.set_border_width(4);
- FrameTextDescription.set_sensitive (FALSE);
- FrameDescription.add (FrameTextDescription);
- FrameTextDescription.set_shadow_type (Gtk::SHADOW_IN);
+ _ft_description.set_border_width(4);
+ _ft_description.set_sensitive(FALSE);
+ frame_desc->add(_ft_description);
+ _ft_description.set_shadow_type(Gtk::SHADOW_IN);
- TextViewDescription.set_wrap_mode(Gtk::WRAP_WORD);
- TextViewDescription.get_buffer()->set_text("");
- FrameTextDescription.add (TextViewDescription);
- TextViewDescription.add_mnemonic_label(LabelDescription);
+ _tv_description.set_wrap_mode(Gtk::WRAP_WORD);
+ _tv_description.get_buffer()->set_text("");
+ _ft_description.add(_tv_description);
+ _tv_description.add_mnemonic_label(*label_desc);
/* Image rendering */
/* Create the label for the object ImageRendering */
- LabelImageRendering.set_label (LabelImageRendering.get_label() + " ");
- LabelImageRendering.set_alignment (1, 0.5);
+ _label_image_rendering.set_label(_label_image_rendering.get_label() + " ");
+ _label_image_rendering.set_alignment(1, 0.5);
#if WITH_GTKMM_3_0
- LabelImageRendering.set_valign(Gtk::ALIGN_CENTER);
- TopTable->attach(LabelImageRendering, 0, 3, 1, 1);
+ _label_image_rendering.set_valign(Gtk::ALIGN_CENTER);
+ grid_top->attach(_label_image_rendering, 0, 3, 1, 1);
#else
- TopTable->attach(LabelImageRendering, 0, 1, 3, 4,
- Gtk::SHRINK | Gtk::FILL,
- Gtk::AttachOptions(), 0, 0 );
+ grid_top->attach(_label_image_rendering, 0, 1, 3, 4,
+ Gtk::SHRINK | Gtk::FILL,
+ Gtk::AttachOptions(), 0, 0 );
#endif
/* Create the combo box text for the 'image-rendering' property */
- ComboBoxTextImageRendering.append( "auto" );
- ComboBoxTextImageRendering.append( "optimizeQuality" );
- ComboBoxTextImageRendering.append( "optimizeSpeed" );
- ComboBoxTextImageRendering.set_tooltip_text (_("The 'image-rendering' property can influence how a bitmap is up-scaled:\n\t'auto' no preference;\n\t'optimizeQuality' smooth;\n\t'optimizeSpeed' blocky.\nNote that this behaviour is not defined in the SVG 1.1 specification and not all browsers follow this interpretation."));
+ _combo_image_rendering.append( "auto" );
+ _combo_image_rendering.append( "optimizeQuality" );
+ _combo_image_rendering.append( "optimizeSpeed" );
+ _combo_image_rendering.set_tooltip_text(_("The 'image-rendering' property can influence how a bitmap is up-scaled:\n\t'auto' no preference;\n\t'optimizeQuality' smooth;\n\t'optimizeSpeed' blocky.\nNote that this behaviour is not defined in the SVG 1.1 specification and not all browsers follow this interpretation."));
#if WITH_GTKMM_3_0
- ComboBoxTextImageRendering.set_valign(Gtk::ALIGN_CENTER);
- TopTable->attach(ComboBoxTextImageRendering, 1, 3, 1, 1);
+ _combo_image_rendering.set_valign(Gtk::ALIGN_CENTER);
+ grid_top->attach(_combo_image_rendering, 1, 3, 1, 1);
#else
- TopTable->attach(ComboBoxTextImageRendering, 1, 2, 3, 4,
+ grid_top->attach(_combo_image_rendering, 1, 2, 3, 4,
Gtk::EXPAND | Gtk::FILL,
Gtk::AttachOptions(), 0, 0 );
#endif
- LabelImageRendering.set_mnemonic_widget (ComboBoxTextImageRendering);
+ _label_image_rendering.set_mnemonic_widget(_combo_image_rendering);
- ComboBoxTextImageRendering.signal_changed().connect(sigc::mem_fun(this, &ObjectProperties::image_rendering_changed));
+ _combo_image_rendering.signal_changed().connect(
+ sigc::mem_fun(this, &ObjectProperties::_imageRenderingChanged)
+ );
/* Check boxes */
- contents->pack_start (HBoxCheck, FALSE, FALSE, 0);
- CheckTable->set_border_width(4);
- HBoxCheck.pack_start(*CheckTable, true, true, 0);
+ Gtk::HBox *hb_checkboxes = Gtk::manage(new Gtk::HBox());
+ contents->pack_start(*hb_checkboxes, FALSE, FALSE, 0);
+
+#if WITH_GTKMM_3_0
+ Gtk::Grid *grid_cb = Gtk::manage(new Gtk::Grid());
+ grid_cb->set_row_homogeneous();
+ grid_cb->set_column_homogeneous(true);
+#else
+ Gtk::Table *grid_cb = Gtk::manage(new Gtk::Table(1, 2, true));
+#endif
+
+ grid_cb->set_border_width(4);
+ hb_checkboxes->pack_start(*grid_cb, true, true, 0);
/* Hide */
- CBHide.set_tooltip_text (_("Check to make the object invisible"));
+ _cb_hide.set_tooltip_text (_("Check to make the object invisible"));
#if WITH_GTKMM_3_0
- CBHide.set_hexpand();
- CBHide.set_valign(Gtk::ALIGN_CENTER);
- CheckTable->attach(CBHide, 0, 0, 1, 1);
+ _cb_hide.set_hexpand();
+ _cb_hide.set_valign(Gtk::ALIGN_CENTER);
+ grid_cb->attach(_cb_hide, 0, 0, 1, 1);
#else
- CheckTable->attach(CBHide, 0, 1, 0, 1,
+ grid_cb->attach(_cb_hide, 0, 1, 0, 1,
Gtk::EXPAND | Gtk::FILL,
Gtk::AttachOptions(), 0, 0 );
#endif
- CBHide.signal_toggled().connect(sigc::mem_fun(this, &ObjectProperties::hidden_toggled));
+ _cb_hide.signal_toggled().connect(sigc::mem_fun(this, &ObjectProperties::_hiddenToggled));
/* Lock */
// TRANSLATORS: "Lock" is a verb here
- CBLock.set_tooltip_text (_("Check to make the object insensitive (not selectable by mouse)"));
+ _cb_lock.set_tooltip_text(_("Check to make the object insensitive (not selectable by mouse)"));
#if WITH_GTKMM_3_0
- CBLock.set_hexpand();
- CBLock.set_valign(Gtk::ALIGN_CENTER);
- CheckTable->attach(CBLock, 1, 0, 1, 1);
+ _cb_lock.set_hexpand();
+ _cb_lock.set_valign(Gtk::ALIGN_CENTER);
+ grid_cb->attach(_cb_lock, 1, 0, 1, 1);
#else
- CheckTable->attach(CBLock, 1, 2, 0, 1,
- Gtk::EXPAND | Gtk::FILL,
- Gtk::AttachOptions(), 0, 0 );
+ grid_cb->attach(_cb_lock, 1, 2, 0, 1,
+ Gtk::EXPAND | Gtk::FILL,
+ Gtk::AttachOptions(), 0, 0 );
#endif
- CBLock.signal_toggled().connect(sigc::mem_fun(this, &ObjectProperties::sensitivity_toggled));
+ _cb_lock.signal_toggled().connect(sigc::mem_fun(this, &ObjectProperties::_sensitivityToggled));
/* Button for setting the object's id, label, title and description. */
+ Gtk::Button *btn_set = Gtk::manage(new Gtk::Button(_("_Set"), 1));
#if WITH_GTKMM_3_0
- BSet.set_hexpand();
- BSet.set_valign(Gtk::ALIGN_CENTER);
- CheckTable->attach(BSet, 2, 0, 1, 1);
+ btn_set->set_hexpand();
+ btn_set->set_valign(Gtk::ALIGN_CENTER);
+ grid_cb->attach(*btn_set, 2, 0, 1, 1);
#else
- CheckTable->attach(BSet, 2, 3, 0, 1,
- Gtk::EXPAND | Gtk::FILL,
- Gtk::AttachOptions(), 0, 0 );
+ grid_cb->attach(*btn_set, 2, 3, 0, 1,
+ Gtk::EXPAND | Gtk::FILL,
+ Gtk::AttachOptions(), 0, 0 );
#endif
- BSet.signal_clicked().connect(sigc::mem_fun(this, &ObjectProperties::label_changed));
+ btn_set->signal_clicked().connect(sigc::mem_fun(this, &ObjectProperties::_labelChanged));
/* Create the frame for interactivity options */
- EInteractivity.set_label_widget (LabelInteractivity);
- contents->pack_start (EInteractivity, FALSE, FALSE, 0);
- show_all ();
- widget_setup();
+ Gtk::Label *label_interactivity = Gtk::manage(new Gtk::Label(_("_Interactivity"), 1));
+ _exp_interactivity.set_label_widget(*label_interactivity);
+ contents->pack_start(_exp_interactivity, FALSE, FALSE, 0);
+
+ show_all();
+ update();
}
-void ObjectProperties::widget_setup(void)
+void ObjectProperties::update()
{
- if (blocked || !desktop)
- {
+ if (_blocked || !_desktop) {
return;
}
- if (SP_ACTIVE_DESKTOP != desktop)
- {
+ if (SP_ACTIVE_DESKTOP != _desktop) {
return;
}
- Inkscape::Selection *selection = sp_desktop_selection (SP_ACTIVE_DESKTOP);
+ Inkscape::Selection *selection = sp_desktop_selection(SP_ACTIVE_DESKTOP);
Gtk::Box *contents = _getContents();
if (!selection->singleItem()) {
contents->set_sensitive (false);
- CurrentItem = NULL;
+ _current_item = NULL;
//no selection anymore or multiple objects selected, means that we need
//to close the connections to the previously selected object
- attrTable->clear();
+ _attr_table->clear();
return;
} else {
contents->set_sensitive (true);
}
SPItem *item = selection->singleItem();
- if (CurrentItem == item)
+ if (_current_item == item)
{
//otherwise we would end up wasting resources through the modify selection
- //callback when moving an object (endlessly setting the labels and recreating attrTable)
+ //callback when moving an object (endlessly setting the labels and recreating _attr_table)
return;
}
- blocked = true;
+ _blocked = true;
- CBLock.set_active (item->isLocked()); /* Sensitive */
- CBHide.set_active (item->isExplicitlyHidden()); /* Hidden */
+ _cb_lock.set_active(item->isLocked()); /* Sensitive */
+ _cb_hide.set_active(item->isExplicitlyHidden()); /* Hidden */
if (item->cloned) {
/* ID */
- EntryID.set_text ("");
- EntryID.set_sensitive (FALSE);
- LabelID.set_text (_("Ref"));
+ _entry_id.set_text("");
+ _entry_id.set_sensitive(FALSE);
+ _label_id.set_text(_("Ref"));
/* Label */
- EntryLabel.set_text ("");
- EntryLabel.set_sensitive (FALSE);
- LabelLabel.set_text (_("Ref"));
+ _entry_label.set_text("");
+ _entry_label.set_sensitive(FALSE);
+ _label_label.set_text(_("Ref"));
} else {
SPObject *obj = static_cast<SPObject*>(item);
/* ID */
- EntryID.set_text (obj->getId());
- EntryID.set_sensitive (TRUE);
- LabelID.set_markup_with_mnemonic (_("_ID:"));
+ _entry_id.set_text(obj->getId());
+ _entry_id.set_sensitive(TRUE);
+ _label_id.set_markup_with_mnemonic(_("_ID:") + Glib::ustring(" "));
/* Label */
- EntryLabel.set_text(obj->defaultLabel());
- EntryLabel.set_sensitive (TRUE);
+ _entry_label.set_text(obj->defaultLabel());
+ _entry_label.set_sensitive(TRUE);
/* Title */
gchar *title = obj->title();
if (title) {
- EntryTitle.set_text(title);
+ _entry_title.set_text(title);
g_free(title);
}
else {
- EntryTitle.set_text("");
+ _entry_title.set_text("");
}
- EntryTitle.set_sensitive(TRUE);
+ _entry_title.set_sensitive(TRUE);
/* Image Rendering */
- if( SP_IS_IMAGE( item ) ) {
- ComboBoxTextImageRendering.show();
- LabelImageRendering.show();
+ if (SP_IS_IMAGE(item)) {
+ _combo_image_rendering.show();
+ _label_image_rendering.show();
char const *str = obj->getStyleProperty( "image-rendering", "auto" );
- if( strcmp( str, "auto" ) == 0 ) {
- ComboBoxTextImageRendering.set_active(0);
- } else if( strcmp( str, "optimizeQuality" ) == 0 ) {
- ComboBoxTextImageRendering.set_active(1);
- } else {
- ComboBoxTextImageRendering.set_active(2);
+ if (strcmp( str, "auto" ) == 0) {
+ _combo_image_rendering.set_active(0);
+ } else if (strcmp(str, "optimizeQuality") == 0) {
+ _combo_image_rendering.set_active(1);
+ } else {
+ _combo_image_rendering.set_active(2);
}
} else {
- ComboBoxTextImageRendering.hide();
- ComboBoxTextImageRendering.unset_active();
- LabelImageRendering.hide();
+ _combo_image_rendering.hide();
+ _combo_image_rendering.unset_active();
+ _label_image_rendering.hide();
}
/* Description */
gchar *desc = obj->desc();
if (desc) {
- TextViewDescription.get_buffer()->set_text(desc);
+ _tv_description.get_buffer()->set_text(desc);
g_free(desc);
} else {
- TextViewDescription.get_buffer()->set_text("");
+ _tv_description.get_buffer()->set_text("");
}
- FrameTextDescription.set_sensitive(TRUE);
+ _ft_description.set_sensitive(TRUE);
- if (CurrentItem == NULL)
- {
- attrTable->set_object(obj, int_labels, int_attrs, (GtkWidget*)EInteractivity.gobj());
- }
- else
- {
- attrTable->change_object(obj);
+ if (_current_item == NULL) {
+ _attr_table->set_object(obj, _int_labels, _int_attrs, (GtkWidget*) _exp_interactivity.gobj());
+ } else {
+ _attr_table->change_object(obj);
}
- attrTable->show_all();
+ _attr_table->show_all();
}
- CurrentItem = item;
- blocked = false;
+ _current_item = item;
+ _blocked = false;
}
-void ObjectProperties::label_changed(void)
+void ObjectProperties::_labelChanged()
{
- if (blocked)
- {
+ if (_blocked) {
return;
}
SPItem *item = sp_desktop_selection(SP_ACTIVE_DESKTOP)->singleItem();
g_return_if_fail (item != NULL);
- blocked = true;
+ _blocked = true;
/* Retrieve the label widget for the object's id */
- //bug 1290573: getId() crashes after undo (cannot create string from NULL ptr)
- gchar *id = g_strdup(EntryID.get_text().c_str());
- g_strcanon (id, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_.:", '_');
- if (!strcmp (id, item->getId())) {
- LabelID.set_markup_with_mnemonic(_("_ID:"));
+ gchar *id = g_strdup(_entry_id.get_text().c_str());
+ g_strcanon(id, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_.:", '_');
+ if (strcmp(id, item->getId()) == 0) {
+ _label_id.set_markup_with_mnemonic(_("_ID:"));
} else if (!*id || !isalnum (*id)) {
- LabelID.set_text (_("Id invalid! "));
+ _label_id.set_text(_("Id invalid! "));
} else if (SP_ACTIVE_DOCUMENT->getObjectById(id) != NULL) {
- LabelID.set_text (_("Id exists! "));
+ _label_id.set_text(_("Id exists! "));
} else {
SPException ex;
- LabelID.set_markup_with_mnemonic(_("_ID:"));
- SP_EXCEPTION_INIT (&ex);
+ _label_id.set_markup_with_mnemonic(_("_ID:"));
+ SP_EXCEPTION_INIT(&ex);
item->setAttribute("id", id, &ex);
DocumentUndo::done(SP_ACTIVE_DOCUMENT, SP_VERB_DIALOG_ITEM, _("Set object ID"));
}
- g_free (id);
+ g_free(id);
/* Retrieve the label widget for the object's label */
- Glib::ustring label = EntryLabel.get_text();
+ Glib::ustring label = _entry_label.get_text();
/* Give feedback on success of setting the drawing object's label
* using the widget's label text
*/
SPObject *obj = static_cast<SPObject*>(item);
- if (label.compare (obj->defaultLabel())) {
+ if (label.compare(obj->defaultLabel())) {
obj->setLabel(label.c_str());
DocumentUndo::done(SP_ACTIVE_DOCUMENT, SP_VERB_DIALOG_ITEM,
_("Set object label"));
}
/* Retrieve the title */
- if (obj->setTitle(EntryTitle.get_text().c_str()))
+ if (obj->setTitle(_entry_title.get_text().c_str())) {
DocumentUndo::done(SP_ACTIVE_DOCUMENT, SP_VERB_DIALOG_ITEM,
_("Set object title"));
+ }
/* Retrieve the description */
Gtk::TextBuffer::iterator start, end;
- TextViewDescription.get_buffer()->get_bounds(start, end);
- Glib::ustring desc = TextViewDescription.get_buffer()->get_text(start, end, TRUE);
- if (obj->setDesc(desc.c_str()))
+ _tv_description.get_buffer()->get_bounds(start, end);
+ Glib::ustring desc = _tv_description.get_buffer()->get_text(start, end, TRUE);
+ if (obj->setDesc(desc.c_str())) {
DocumentUndo::done(SP_ACTIVE_DOCUMENT, SP_VERB_DIALOG_ITEM,
_("Set object description"));
+ }
- blocked = false;
+ _blocked = false;
}
-void ObjectProperties::image_rendering_changed(void)
+void ObjectProperties::_imageRenderingChanged()
{
- if (blocked)
- {
+ if (_blocked) {
return;
}
SPItem *item = sp_desktop_selection(SP_ACTIVE_DESKTOP)->singleItem();
g_return_if_fail (item != NULL);
- blocked = true;
+ _blocked = true;
- Glib::ustring scale = ComboBoxTextImageRendering.get_active_text();
+ Glib::ustring scale = _combo_image_rendering.get_active_text();
// We should unset if the parent computed value is auto and the desired value is auto.
SPCSSAttr *css = sp_repr_css_attr_new();
@@ -537,64 +534,67 @@ void ObjectProperties::image_rendering_changed(void)
}
sp_repr_css_attr_unref( css );
- blocked = false;
+ _blocked = false;
}
-void ObjectProperties::sensitivity_toggled (void)
+void ObjectProperties::_sensitivityToggled()
{
- if (blocked)
- {
+ if (_blocked) {
return;
}
SPItem *item = sp_desktop_selection(SP_ACTIVE_DESKTOP)->singleItem();
- g_return_if_fail (item != NULL);
+ g_return_if_fail(item != NULL);
- blocked = true;
- item->setLocked(CBLock.get_active());
+ _blocked = true;
+ item->setLocked(_cb_lock.get_active());
DocumentUndo::done(SP_ACTIVE_DOCUMENT, SP_VERB_DIALOG_ITEM,
- CBLock.get_active()? _("Lock object") : _("Unlock object"));
- blocked = false;
+ _cb_lock.get_active() ? _("Lock object") : _("Unlock object"));
+ _blocked = false;
}
-void ObjectProperties::hidden_toggled(void)
+void ObjectProperties::_hiddenToggled()
{
- if (blocked)
- {
+ if (_blocked) {
return;
}
SPItem *item = sp_desktop_selection(SP_ACTIVE_DESKTOP)->singleItem();
- g_return_if_fail (item != NULL);
+ g_return_if_fail(item != NULL);
- blocked = true;
- item->setExplicitlyHidden(CBHide.get_active());
+ _blocked = true;
+ item->setExplicitlyHidden(_cb_hide.get_active());
DocumentUndo::done(SP_ACTIVE_DOCUMENT, SP_VERB_DIALOG_ITEM,
- CBHide.get_active()? _("Hide object") : _("Unhide object"));
- blocked = false;
+ _cb_hide.get_active() ? _("Hide object") : _("Unhide object"));
+ _blocked = false;
}
-void ObjectProperties::setDesktop(SPDesktop *desktop)
+void ObjectProperties::_setDesktop(SPDesktop *desktop)
{
Panel::setDesktop(desktop);
- deskTrack.setBase(desktop);
+ _desktop_tracker.setBase(desktop);
}
-void ObjectProperties::setTargetDesktop(SPDesktop *desktop)
+void ObjectProperties::_setTargetDesktop(SPDesktop *desktop)
{
- if (this->desktop != desktop) {
- if (this->desktop) {
- subselChangedConn.disconnect();
- selectChangedConn.disconnect();
+ if (this->_desktop != desktop) {
+ if (this->_desktop) {
+ _subselection_changed_connection.disconnect();
+ _selection_changed_connection.disconnect();
}
- this->desktop = desktop;
+ this->_desktop = desktop;
if (desktop && desktop->selection) {
- selectChangedConn = desktop->selection->connectChanged(sigc::hide(sigc::mem_fun(*this, &ObjectProperties::widget_setup)));
- subselChangedConn = desktop->connectToolSubselectionChanged(sigc::hide(sigc::mem_fun(*this, &ObjectProperties::widget_setup)));
+ _selection_changed_connection = desktop->selection->connectChanged(
+ sigc::hide(sigc::mem_fun(*this, &ObjectProperties::update))
+ );
+ _subselection_changed_connection = desktop->connectToolSubselectionChanged(
+ sigc::hide(sigc::mem_fun(*this, &ObjectProperties::update))
+ );
}
- widget_setup();
+ update();
}
}
+
}
}
}
diff --git a/src/ui/dialog/object-properties.h b/src/ui/dialog/object-properties.h
index 721c12c56..093f273f6 100644
--- a/src/ui/dialog/object-properties.h
+++ b/src/ui/dialog/object-properties.h
@@ -69,98 +69,64 @@ namespace Dialog {
*/
class ObjectProperties : public Widget::Panel {
public:
- ObjectProperties ();
- ~ObjectProperties ();
+ ObjectProperties();
+ ~ObjectProperties();
static ObjectProperties &getInstance() { return *new ObjectProperties(); }
- /**
- * Updates entries and other child widgets on selection change, object modification, etc.
- */
- void widget_setup(void);
+ /// Updates entries and other child widgets on selection change, object modification, etc.
+ void update();
private:
- bool blocked;
- SPItem *CurrentItem; //to store the current item, for not wasting resources
- std::vector<Glib::ustring> int_attrs;
- std::vector<Glib::ustring> int_labels;
+ bool _blocked;
+ SPItem *_current_item; //to store the current item, for not wasting resources
+ std::vector<Glib::ustring> _int_attrs;
+ std::vector<Glib::ustring> _int_labels;
+
+ Gtk::Label _label_id; //the label for the object ID
+ Gtk::Entry _entry_id; //the entry for the object ID
+ Gtk::Label _label_label; //the label for the object label
+ Gtk::Entry _entry_label; //the entry for the object label
+ Gtk::Label _label_title; //the label for the object title
+ Gtk::Entry _entry_title; //the entry for the object title
+ Gtk::Label _label_image_rendering; // the label for 'image-rendering'
+ Gtk::ComboBoxText _combo_image_rendering; // the combo box text for 'image-rendering'
-#if WITH_GTKMM_3_0
- Gtk::Grid *TopTable; //the table with the object properties
-#else
- Gtk::Table *TopTable; //the table with the object properties
-#endif
+ Gtk::Frame _ft_description; //the frame for the text of the object description
+ Gtk::TextView _tv_description; //the text view object showing the object description
- Gtk::Label LabelID; //the label for the object ID
- Gtk::Entry EntryID; //the entry for the object ID
- Gtk::Label LabelLabel; //the label for the object label
- Gtk::Entry EntryLabel; //the entry for the object label
- Gtk::Label LabelTitle; //the label for the object title
- Gtk::Entry EntryTitle; //the entry for the object title
- Gtk::Label LabelImageRendering; // the label for 'image-rendering'
- Gtk::ComboBoxText ComboBoxTextImageRendering; // the combo box text for 'image-rendering'
+ Gtk::CheckButton _cb_hide; //the check button hide
+ Gtk::CheckButton _cb_lock; //the check button lock
+
+ Gtk::Expander _exp_interactivity; //the expander for interactivity
+ SPAttributeTable *_attr_table; //the widget for showing the on... names at the bottom
- Gtk::Label LabelDescription; //the label for the object description
- UI::Widget::Frame FrameDescription; //the frame for the object description
- Gtk::Frame FrameTextDescription; //the frame for the text of the object description
- Gtk::TextView TextViewDescription; //the text view object showing the object description
+ SPDesktop *_desktop;
+ DesktopTracker _desktop_tracker;
+ sigc::connection _desktop_changed_connection;
+ sigc::connection _selection_changed_connection;
+ sigc::connection _subselection_changed_connection;
- Gtk::HBox HBoxCheck; // the HBox for the check boxes
+ /// Constructor auxiliary function creating the child widgets.
+ void _init();
-#if WITH_GTKMM_3_0
- Gtk::Grid *CheckTable; //the table for the check boxes
-#else
- Gtk::Table *CheckTable; //the table for the check boxes
-#endif
+ /// Sets object properties (ID, label, title, description) on user input.
+ void _labelChanged();
- Gtk::CheckButton CBHide; //the check button hide
- Gtk::CheckButton CBLock; //the check button lock
- Gtk::Button BSet; //the button set
-
- Gtk::Label LabelInteractivity; //the label for interactivity
- Gtk::Expander EInteractivity; //the label for interactivity
- SPAttributeTable *attrTable; //the widget for showing the on... names at the bottom
-
- SPDesktop *desktop;
- DesktopTracker deskTrack;
- sigc::connection desktopChangeConn;
- sigc::connection selectChangedConn;
- sigc::connection subselChangedConn;
-
- /**
- * Constructor auxiliary function creating the child widgets.
- */
- void MakeWidget(void);
-
- /**
- * Sets object properties (ID, label, title, description) on user input.
- */
- void label_changed(void);
-
- /**
- * Callback for 'image-rendering'.
- */
- void image_rendering_changed(void);
-
- /**
- * Callback for checkbox Lock.
- */
- void sensitivity_toggled (void);
-
- /**
- * Callback for checkbox Hide.
- */
- void hidden_toggled(void);
-
- /**
- * Can be invoked for setting the desktop. Currently not used.
- */
- void setDesktop(SPDesktop *desktop);
+ /// Callback for 'image-rendering'.
+ void _imageRenderingChanged();
+
+ /// Callback for checkbox Lock.
+ void _sensitivityToggled();
+
+ /// Callback for checkbox Hide.
+ void _hiddenToggled();
+
+ /// Can be invoked for setting the desktop. Currently not used.
+ void _setDesktop(SPDesktop *desktop);
- /**
- * Is invoked by the desktop tracker when the desktop changes.
- */
- void setTargetDesktop(SPDesktop *desktop);
+ /// Is invoked by the desktop tracker when the desktop changes.
+ void _setTargetDesktop(SPDesktop *desktop);
};
}
diff --git a/src/ui/dialog/objects.cpp b/src/ui/dialog/objects.cpp
index 2095546fb..338233042 100644
--- a/src/ui/dialog/objects.cpp
+++ b/src/ui/dialog/objects.cpp
@@ -21,6 +21,7 @@
#include <gtkmm/stock.h>
#include <glibmm/i18n.h>
+#include <glibmm/main.h>
#include "desktop.h"
#include "desktop-style.h"
@@ -511,7 +512,11 @@ void ObjectsPanel::_setCompositingValues(SPItem *item)
_blurConnection.block();
//Set the opacity
+#if WITH_GTKMM_3_0
+ _opacity_adjustment->set_value((item->style->opacity.set ? SP_SCALE24_TO_FLOAT(item->style->opacity.value) : 1) * _opacity_adjustment->get_upper());
+#else
_opacity_adjustment.set_value((item->style->opacity.set ? SP_SCALE24_TO_FLOAT(item->style->opacity.value) : 1) * _opacity_adjustment.get_upper());
+#endif
SPFeBlend *spblend = NULL;
SPGaussianBlur *spblur = NULL;
if (item->style->getFilter())
@@ -711,11 +716,11 @@ bool ObjectsPanel::_handleKeyEvent(GdkEventKey *event)
}
}
break;
- case GDK_Home:
+ case GDK_KEY_Home:
//Move item(s) to top of containing group/layer
_fireAction( empty ? SP_VERB_LAYER_TO_TOP : SP_VERB_SELECTION_TO_FRONT );
break;
- case GDK_End:
+ case GDK_KEY_End:
//Move item(s) to bottom of containing group/layer
_fireAction( empty ? SP_VERB_LAYER_TO_BOTTOM : SP_VERB_SELECTION_TO_BACK );
break;
@@ -1474,7 +1479,11 @@ void ObjectsPanel::_opacityChangedIter(const Gtk::TreeIter& iter)
if (item)
{
item->style->opacity.set = TRUE;
+#if WITH_GTKMM_3_0
+ item->style->opacity.value = SP_SCALE24_FROM_FLOAT(_opacity_adjustment->get_value() / _opacity_adjustment->get_upper());
+#else
item->style->opacity.value = SP_SCALE24_FROM_FLOAT(_opacity_adjustment.get_value() / _opacity_adjustment.get_upper());
+#endif
item->updateRepr(SP_OBJECT_WRITE_NO_CHILDREN | SP_OBJECT_WRITE_EXT);
}
}
@@ -1759,7 +1768,7 @@ ObjectsPanel::ObjectsPanel() :
_opacity_hbox.pack_start(_opacity_label_unit, false, false, 3);
_opacity_hscale.set_draw_value(false);
#if WITH_GTKMM_3_0
- _opacityConnection = _opacity_adjustment->signal_value_changed().connect(sigc::mem_fun(*this, &ObjectCompositeSettings::_opacityValueChanged));
+ _opacityConnection = _opacity_adjustment->signal_value_changed().connect(sigc::mem_fun(*this, &ObjectsPanel::_opacityValueChanged));
_opacity_label.set_mnemonic_widget(_opacity_hscale);
#else
_opacityConnection = _opacity_adjustment.signal_value_changed().connect(sigc::mem_fun(*this, &ObjectsPanel::_opacityValueChanged));
@@ -1875,8 +1884,14 @@ ObjectsPanel::ObjectsPanel() :
_buttonsPrimary.pack_end(*btn, Gtk::PACK_SHRINK);
//Collapse all
- btn = Gtk::manage( new Gtk::Button(Gtk::Stock::UNINDENT) );
+ btn = Gtk::manage( new Gtk::Button() );
btn->set_tooltip_text(_("Collapse All"));
+#if GTK_CHECK_VERSION(3,10,0)
+ btn->set_from_icon_name(INKSCAPE_ICON("gtk-unindent-ltr"), Gtk::ICON_SIZE_SMALL_TOOLBAR);
+#else
+ image_remove->set_from_icon_name(INKSCAPE_ICON("gtk-unindent-ltr"), Gtk::ICON_SIZE_SMALL_TOOLBAR);
+ btn->set_image(*image_remove);
+#endif
btn->set_relief(Gtk::RELIEF_NONE);
btn->signal_clicked().connect( sigc::bind( sigc::mem_fun(*this, &ObjectsPanel::_takeAction), (int)BUTTON_COLLAPSE_ALL) );
_watchingNonBottom.push_back( btn );
diff --git a/src/ui/dialog/objects.h b/src/ui/dialog/objects.h
index 7b07afd63..74c2382ac 100644
--- a/src/ui/dialog/objects.h
+++ b/src/ui/dialog/objects.h
@@ -12,6 +12,14 @@
#ifndef SEEN_OBJECTS_PANEL_H
#define SEEN_OBJECTS_PANEL_H
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H
+# include <glibmm/threads.h>
+#endif
+
#include <gtkmm/box.h>
#include <gtkmm/treeview.h>
#include <gtkmm/treestore.h>
diff --git a/src/ui/dialog/undo-history.cpp b/src/ui/dialog/undo-history.cpp
index 2412c3ec9..53691cd37 100644
--- a/src/ui/dialog/undo-history.cpp
+++ b/src/ui/dialog/undo-history.cpp
@@ -235,7 +235,7 @@ void UndoHistory::setDesktop(SPDesktop* desktop)
}
}
-void UndoHistory::_connectDocument(SPDesktop* desktop, SPDocument *document)
+void UndoHistory::_connectDocument(SPDesktop* desktop, SPDocument * /*document*/)
{
// disconnect from prior
if (_event_log) {
diff --git a/src/ui/dialog/xml-tree.cpp b/src/ui/dialog/xml-tree.cpp
index 0e1e9f7a6..55d0aff09 100644
--- a/src/ui/dialog/xml-tree.cpp
+++ b/src/ui/dialog/xml-tree.cpp
@@ -100,6 +100,9 @@ XmlTree::XmlTree (void) :
status.set_alignment( 0.0, 0.5);
status.set_size_request(1, -1);
status.set_markup("");
+#if WITH_GTKMM_3_0
+ status.set_line_wrap(true);
+#endif
status_box.pack_start( status, TRUE, TRUE, 0);
contents->pack_end(status_box, false, false, 2);
diff --git a/src/ui/widget/addtoicon.cpp b/src/ui/widget/addtoicon.cpp
index 3d6091f70..ce665295b 100644
--- a/src/ui/widget/addtoicon.cpp
+++ b/src/ui/widget/addtoicon.cpp
@@ -8,6 +8,14 @@
*/
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H
+# include <glibmm/threads.h>
+#endif
+
#include "ui/widget/addtoicon.h"
#include <gtkmm/icontheme.h>
diff --git a/src/ui/widget/clipmaskicon.cpp b/src/ui/widget/clipmaskicon.cpp
index de7638bfe..6331d70d8 100644
--- a/src/ui/widget/clipmaskicon.cpp
+++ b/src/ui/widget/clipmaskicon.cpp
@@ -7,6 +7,13 @@
* Released under GNU GPL, read the file 'COPYING' for more information
*/
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H
+# include <glibmm/threads.h>
+#endif
#include "ui/widget/clipmaskicon.h"
diff --git a/src/ui/widget/layertypeicon.cpp b/src/ui/widget/layertypeicon.cpp
index bfe855b28..3d6182bf8 100644
--- a/src/ui/widget/layertypeicon.cpp
+++ b/src/ui/widget/layertypeicon.cpp
@@ -7,6 +7,13 @@
* Released under GNU GPL, read the file 'COPYING' for more information
*/
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#if GLIBMM_DISABLE_DEPRECATED && HAVE_GLIBMM_THREADS_H
+# include <glibmm/threads.h>
+#endif
#include "ui/widget/layertypeicon.h"
diff --git a/src/ui/widget/registered-widget.cpp b/src/ui/widget/registered-widget.cpp
index ae6a7d1e0..175f6471c 100644
--- a/src/ui/widget/registered-widget.cpp
+++ b/src/ui/widget/registered-widget.cpp
@@ -49,8 +49,10 @@ RegisteredCheckButton::~RegisteredCheckButton()
_toggled_connection.disconnect();
}
-RegisteredCheckButton::RegisteredCheckButton (const Glib::ustring& label, const Glib::ustring& tip, const Glib::ustring& key, Registry& wr, bool right, Inkscape::XML::Node* repr_in, SPDocument *doc_in)
+RegisteredCheckButton::RegisteredCheckButton (const Glib::ustring& label, const Glib::ustring& tip, const Glib::ustring& key, Registry& wr, bool right, Inkscape::XML::Node* repr_in, SPDocument *doc_in, char const *active_str, char const *inactive_str)
: RegisteredWidget<Gtk::CheckButton>()
+ , _active_str(active_str)
+ , _inactive_str(inactive_str)
{
init_parent(key, wr, repr_in, doc_in);
@@ -88,7 +90,7 @@ RegisteredCheckButton::on_toggled()
return;
_wr->setUpdating (true);
- write_to_xml(get_active() ? "true" : "false");
+ write_to_xml(get_active() ? _active_str : _inactive_str);
//The slave button is greyed out if the master button is unchecked
for (std::list<Gtk::Widget*>::const_iterator i = _slavewidgets.begin(); i != _slavewidgets.end(); ++i) {
(*i)->set_sensitive(get_active());
diff --git a/src/ui/widget/registered-widget.h b/src/ui/widget/registered-widget.h
index 883a9e1a2..d64c09c16 100644
--- a/src/ui/widget/registered-widget.h
+++ b/src/ui/widget/registered-widget.h
@@ -55,6 +55,11 @@ public:
event_description = _event_description;
write_undo = true;
}
+ void set_xml_target(Inkscape::XML::Node *xml_node, SPDocument *document)
+ {
+ repr = xml_node;
+ doc = document;
+ }
bool is_updating() {if (_wr) return _wr->isUpdating(); else return false;}
@@ -136,7 +141,7 @@ private:
class RegisteredCheckButton : public RegisteredWidget<Gtk::CheckButton> {
public:
virtual ~RegisteredCheckButton();
- RegisteredCheckButton (const Glib::ustring& label, const Glib::ustring& tip, const Glib::ustring& key, Registry& wr, bool right=true, Inkscape::XML::Node* repr_in=NULL, SPDocument *doc_in=NULL);
+ RegisteredCheckButton (const Glib::ustring& label, const Glib::ustring& tip, const Glib::ustring& key, Registry& wr, bool right=true, Inkscape::XML::Node* repr_in=NULL, SPDocument *doc_in=NULL, char const *active_str = "true", char const *inactive_str = "false");
void setActive (bool);
@@ -153,6 +158,7 @@ public:
// if a callback checks it, it must reset it back to false
protected:
+ char const *_active_str, *_inactive_str;
sigc::connection _toggled_connection;
void on_toggled();
};