diff options
| author | Jabier Arraiza Cenoz <jabier.arraiza@marker.es> | 2015-06-25 16:15:05 +0000 |
|---|---|---|
| committer | Jabiertxof <jtx@jtx.marker.es> | 2015-06-25 16:15:05 +0000 |
| commit | 5c2d982cc636ee4e2bc12703c01c86e245dd821f (patch) | |
| tree | 6e6f22800c7d38314e14eccd486b65c3c4286d81 /src/ui/dialog | |
| parent | update to trunk (diff) | |
| parent | Fix for the bug 1468396 (diff) | |
| download | inkscape-5c2d982cc636ee4e2bc12703c01c86e245dd821f.tar.gz inkscape-5c2d982cc636ee4e2bc12703c01c86e245dd821f.zip | |
update to trunk
(bzr r13645.1.94)
Diffstat (limited to 'src/ui/dialog')
| -rw-r--r-- | src/ui/dialog/layers.cpp | 2 | ||||
| -rw-r--r-- | src/ui/dialog/lpe-fillet-chamfer-properties.cpp | 7 | ||||
| -rw-r--r-- | src/ui/dialog/lpe-powerstroke-properties.cpp | 20 | ||||
| -rw-r--r-- | src/ui/dialog/lpe-powerstroke-properties.h | 14 | ||||
| -rw-r--r-- | src/ui/dialog/object-properties.cpp | 6 | ||||
| -rw-r--r-- | src/ui/dialog/objects.cpp | 100 | ||||
| -rw-r--r-- | src/ui/dialog/objects.h | 18 | ||||
| -rw-r--r-- | src/ui/dialog/tags.cpp | 2 | ||||
| -rw-r--r-- | src/ui/dialog/text-edit.cpp | 31 | ||||
| -rw-r--r-- | src/ui/dialog/text-edit.h | 17 |
10 files changed, 146 insertions, 71 deletions
diff --git a/src/ui/dialog/layers.cpp b/src/ui/dialog/layers.cpp index c6888386f..3f5e80f8d 100644 --- a/src/ui/dialog/layers.cpp +++ b/src/ui/dialog/layers.cpp @@ -727,7 +727,7 @@ void LayersPanel::_doTreeMove( ) _selectLayer(_dnd_source); _dnd_source = NULL; DocumentUndo::done( _desktop->doc() , SP_VERB_NONE, - _("Moved layer")); + _("Move layer")); } } diff --git a/src/ui/dialog/lpe-fillet-chamfer-properties.cpp b/src/ui/dialog/lpe-fillet-chamfer-properties.cpp index f89668a4c..c86fc4a20 100644 --- a/src/ui/dialog/lpe-fillet-chamfer-properties.cpp +++ b/src/ui/dialog/lpe-fillet-chamfer-properties.cpp @@ -27,6 +27,7 @@ #include "selection-chemistry.h" #include "ui/icon-names.h" #include "ui/widget/imagetoggler.h" +#include "live_effects/parameter/parameter.h" #include <cmath> //#include "event-context.h" @@ -47,8 +48,7 @@ FilletChamferPropertiesDialog::FilletChamferPropertiesDialog() _fillet_chamfer_position_numeric.set_digits(4); _fillet_chamfer_position_numeric.set_increments(1,1); //todo: get tha max aloable infinity freeze the widget - _fillet_chamfer_position_numeric.set_range(0., 999999999999999999.); - + _fillet_chamfer_position_numeric.set_range(0., SCALARPARAM_G_MAXDOUBLE); _fillet_chamfer_position_label.set_label(_("Radius (pixels):")); _fillet_chamfer_position_label.set_alignment(1.0, 0.5); @@ -59,8 +59,7 @@ FilletChamferPropertiesDialog::FilletChamferPropertiesDialog() _fillet_chamfer_chamfer_subdivisions.set_digits(0); _fillet_chamfer_chamfer_subdivisions.set_increments(1,1); //todo: get tha max aloable infinity freeze the widget - _fillet_chamfer_chamfer_subdivisions.set_range(1, 4294967295); - + _fillet_chamfer_chamfer_subdivisions.set_range(0, SCALARPARAM_G_MAXDOUBLE); _fillet_chamfer_chamfer_subdivisions_label.set_label(_("Chamfer subdivisions:")); _fillet_chamfer_chamfer_subdivisions_label.set_alignment(1.0, 0.5); diff --git a/src/ui/dialog/lpe-powerstroke-properties.cpp b/src/ui/dialog/lpe-powerstroke-properties.cpp index 0cf3e9706..cfc972547 100644 --- a/src/ui/dialog/lpe-powerstroke-properties.cpp +++ b/src/ui/dialog/lpe-powerstroke-properties.cpp @@ -36,6 +36,7 @@ #include "selection-chemistry.h" #include "ui/icon-names.h" #include "ui/widget/imagetoggler.h" +#include "live_effects/parameter/parameter.h" //#include "event-context.h" namespace Inkscape { @@ -52,10 +53,16 @@ PowerstrokePropertiesDialog::PowerstrokePropertiesDialog() // Layer name widgets _powerstroke_position_entry.set_activates_default(true); + _powerstroke_position_entry.set_digits(4); + _powerstroke_position_entry.set_increments(1,1); + _powerstroke_position_entry.set_range(-SCALARPARAM_G_MAXDOUBLE, SCALARPARAM_G_MAXDOUBLE); _powerstroke_position_label.set_label(_("Position:")); _powerstroke_position_label.set_alignment(1.0, 0.5); _powerstroke_width_entry.set_activates_default(true); + _powerstroke_width_entry.set_digits(4); + _powerstroke_width_entry.set_increments(1,1); + _powerstroke_width_entry.set_range(-SCALARPARAM_G_MAXDOUBLE, SCALARPARAM_G_MAXDOUBLE); _powerstroke_width_label.set_label(_("Width:")); _powerstroke_width_label.set_alignment(1.0, 0.5); @@ -126,12 +133,9 @@ void PowerstrokePropertiesDialog::showDialog(SPDesktop *desktop, Geom::Point kno void PowerstrokePropertiesDialog::_apply() { - std::istringstream i_pos(_powerstroke_position_entry.get_text()); - std::istringstream i_width(_powerstroke_width_entry.get_text()); - double d_pos, d_width; - if ((i_pos >> d_pos) && i_width >> d_width) { - _knotpoint->knot_set_offset(Geom::Point(d_pos, d_width)); - } + double d_pos = _powerstroke_position_entry.get_value(); + double d_width = _powerstroke_width_entry.get_value(); + _knotpoint->knot_set_offset(Geom::Point(d_pos, d_width)); _close(); } @@ -171,8 +175,8 @@ void PowerstrokePropertiesDialog::_handleButtonEvent(GdkEventButton* event) void PowerstrokePropertiesDialog::_setKnotPoint(Geom::Point knotpoint) { - _powerstroke_position_entry.set_text(boost::lexical_cast<std::string>(knotpoint.x())); - _powerstroke_width_entry.set_text(boost::lexical_cast<std::string>(knotpoint.y())); + _powerstroke_position_entry.set_value(knotpoint.x()); + _powerstroke_width_entry.set_value(knotpoint.y()); } void PowerstrokePropertiesDialog::_setPt(const Inkscape::LivePathEffect::PowerStrokePointArrayParamKnotHolderEntity *pt) diff --git a/src/ui/dialog/lpe-powerstroke-properties.h b/src/ui/dialog/lpe-powerstroke-properties.h index c53eac0d9..1e4c1df5b 100644 --- a/src/ui/dialog/lpe-powerstroke-properties.h +++ b/src/ui/dialog/lpe-powerstroke-properties.h @@ -13,15 +13,7 @@ #define INKSCAPE_DIALOG_POWERSTROKE_PROPERTIES_H #include <2geom/point.h> -#include <gtkmm/dialog.h> -#include <gtkmm/entry.h> -#include <gtkmm/label.h> -#include <gtkmm/table.h> -#include <gtkmm/combobox.h> -#include <gtkmm/liststore.h> -#include <gtkmm/treeview.h> -#include <gtkmm/treestore.h> -#include <gtkmm/scrolledwindow.h> +#include <gtkmm.h> #include "live_effects/parameter/powerstrokepointarray.h" class SPDesktop; @@ -45,9 +37,9 @@ protected: Inkscape::LivePathEffect::PowerStrokePointArrayParamKnotHolderEntity *_knotpoint; Gtk::Label _powerstroke_position_label; - Gtk::Entry _powerstroke_position_entry; + Gtk::SpinButton _powerstroke_position_entry; Gtk::Label _powerstroke_width_label; - Gtk::Entry _powerstroke_width_entry; + Gtk::SpinButton _powerstroke_width_entry; Gtk::Table _layout_table; bool _position_visible; diff --git a/src/ui/dialog/object-properties.cpp b/src/ui/dialog/object-properties.cpp index fc21a30d4..75430ed44 100644 --- a/src/ui/dialog/object-properties.cpp +++ b/src/ui/dialog/object-properties.cpp @@ -529,10 +529,12 @@ void ObjectProperties::_imageRenderingChanged() SPCSSAttr *css = sp_repr_css_attr_new(); sp_repr_css_set_property(css, "image-rendering", scale.c_str()); Inkscape::XML::Node *image_node = item->getRepr(); - if( image_node ) { + if (image_node) { sp_repr_css_change(image_node, css, "style"); + DocumentUndo::done(SP_ACTIVE_DOCUMENT, SP_VERB_DIALOG_ITEM, + _("Set image rendering option")); } - sp_repr_css_attr_unref( css ); + sp_repr_css_attr_unref(css); _blocked = false; } diff --git a/src/ui/dialog/objects.cpp b/src/ui/dialog/objects.cpp index 781c6ef93..835ecf35b 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); @@ -1614,6 +1614,12 @@ ObjectsPanel::ObjectsPanel() : _pending(0), _toggleEvent(0), _defer_target(), + _visibleHeader(_("V")), + _lockHeader(_("L")), + _typeHeader(_("T")), + _clipmaskHeader(_("CM")), + _highlightHeader(_("HL")), + _nameHeader(_("Label")), _composite_vbox(false, 0), _opacity_vbox(false, 0), _opacity_label(_("Opacity:")), @@ -1641,7 +1647,7 @@ ObjectsPanel::ObjectsPanel() : //Set up the tree _tree.set_model( _store ); - _tree.set_headers_visible(false); + _tree.set_headers_visible(true); _tree.set_reorderable(true); _tree.enable_model_drag_dest (Gdk::ACTION_MOVE); @@ -1654,6 +1660,10 @@ ObjectsPanel::ObjectsPanel() : Gtk::TreeViewColumn* col = _tree.get_column(visibleColNum); if ( col ) { col->add_attribute( eyeRenderer->property_active(), _model->_colVisible ); + // In order to get tooltips on header, we must create our own label. + _visibleHeader.set_tooltip_text(_("Toggle visibility of Layer, Group, or Object.")); + _visibleHeader.show(); + col->set_widget( _visibleHeader ); } //Locked @@ -1664,6 +1674,9 @@ ObjectsPanel::ObjectsPanel() : col = _tree.get_column(lockedColNum); if ( col ) { col->add_attribute( renderer->property_active(), _model->_colLocked ); + _lockHeader.set_tooltip_text(_("Toggle lock of Layer, Group, or Object.")); + _lockHeader.show(); + col->set_widget( _lockHeader ); } //Type @@ -1673,6 +1686,9 @@ ObjectsPanel::ObjectsPanel() : col = _tree.get_column(typeColNum); if ( col ) { col->add_attribute( typeRenderer->property_active(), _model->_colType ); + _typeHeader.set_tooltip_text(_("Type: Layer, Group, or Object. Clicking on Layer or Group icon, toggles between the two types.")); + _typeHeader.show(); + col->set_widget( _typeHeader ); } //Insert order (LiamW: unused) @@ -1689,6 +1705,9 @@ ObjectsPanel::ObjectsPanel() : col = _tree.get_column(clipColNum); if ( col ) { col->add_attribute( clipRenderer->property_active(), _model->_colClipMask ); + _clipmaskHeader.set_tooltip_text(_("Is object clipped and/or masked?")); + _clipmaskHeader.show(); + col->set_widget( _clipmaskHeader ); } //Highlight @@ -1697,13 +1716,21 @@ ObjectsPanel::ObjectsPanel() : col = _tree.get_column(highlightColNum); if ( col ) { col->add_attribute( highlightRenderer->property_active(), _model->_colHighlight ); + _highlightHeader.set_tooltip_text(_("Highlight color of outline in Node tool. Click to set. If alpha is zero, use inherited color.")); + _highlightHeader.show(); + col->set_widget( _highlightHeader ); } //Label _text_renderer = Gtk::manage(new Gtk::CellRendererText()); int nameColNum = _tree.append_column("Name", *_text_renderer) - 1; _name_column = _tree.get_column(nameColNum); - _name_column->add_attribute(_text_renderer->property_text(), _model->_colLabel); + if( _name_column ) { + _name_column->add_attribute(_text_renderer->property_text(), _model->_colLabel); + _nameHeader.set_tooltip_text(_("Layer/Group/Object label (inkscape:label). Double-click to set. Default value is object 'id'.")); + _nameHeader.show(); + _name_column->set_widget( _nameHeader ); + } //Set the expander and search columns _tree.set_expander_column( *_tree.get_column(nameColNum) ); @@ -1858,46 +1885,46 @@ ObjectsPanel::ObjectsPanel() : //Set up the pop-up menu // ------------------------------------------------------- { - _watching.push_back( &_addPopupItem( targetDesktop, SP_VERB_LAYER_RENAME, 0, "Rename", (int)BUTTON_RENAME ) ); - _watching.push_back( &_addPopupItem( targetDesktop, SP_VERB_EDIT_DUPLICATE, 0, "Duplicate", (int)BUTTON_DUPLICATE ) ); - _watching.push_back( &_addPopupItem( targetDesktop, SP_VERB_LAYER_NEW, 0, "New", (int)BUTTON_NEW ) ); + _watching.push_back( &_addPopupItem( targetDesktop, SP_VERB_LAYER_RENAME, 0, _("Rename"), (int)BUTTON_RENAME ) ); + _watching.push_back( &_addPopupItem( targetDesktop, SP_VERB_EDIT_DUPLICATE, 0, _("Duplicate"), (int)BUTTON_DUPLICATE ) ); + _watching.push_back( &_addPopupItem( targetDesktop, SP_VERB_LAYER_NEW, 0, _("New"), (int)BUTTON_NEW ) ); _popupMenu.append(*Gtk::manage(new Gtk::SeparatorMenuItem())); - _watching.push_back( &_addPopupItem( targetDesktop, SP_VERB_LAYER_SOLO, 0, "Solo", (int)BUTTON_SOLO ) ); - _watching.push_back( &_addPopupItem( targetDesktop, SP_VERB_LAYER_SHOW_ALL, 0, "Show All", (int)BUTTON_SHOW_ALL ) ); - _watching.push_back( &_addPopupItem( targetDesktop, SP_VERB_LAYER_HIDE_ALL, 0, "Hide All", (int)BUTTON_HIDE_ALL ) ); + _watching.push_back( &_addPopupItem( targetDesktop, SP_VERB_LAYER_SOLO, 0, _("Solo"), (int)BUTTON_SOLO ) ); + _watching.push_back( &_addPopupItem( targetDesktop, SP_VERB_LAYER_SHOW_ALL, 0, _("Show All"), (int)BUTTON_SHOW_ALL ) ); + _watching.push_back( &_addPopupItem( targetDesktop, SP_VERB_LAYER_HIDE_ALL, 0, _("Hide All"), (int)BUTTON_HIDE_ALL ) ); _popupMenu.append(*Gtk::manage(new Gtk::SeparatorMenuItem())); - _watching.push_back( &_addPopupItem( targetDesktop, SP_VERB_LAYER_LOCK_OTHERS, 0, "Lock Others", (int)BUTTON_LOCK_OTHERS ) ); - _watching.push_back( &_addPopupItem( targetDesktop, SP_VERB_LAYER_LOCK_ALL, 0, "Lock All", (int)BUTTON_LOCK_ALL ) ); - _watching.push_back( &_addPopupItem( targetDesktop, SP_VERB_LAYER_UNLOCK_ALL, 0, "Unlock All", (int)BUTTON_UNLOCK_ALL ) ); + _watching.push_back( &_addPopupItem( targetDesktop, SP_VERB_LAYER_LOCK_OTHERS, 0, _("Lock Others"), (int)BUTTON_LOCK_OTHERS ) ); + _watching.push_back( &_addPopupItem( targetDesktop, SP_VERB_LAYER_LOCK_ALL, 0, _("Lock All"), (int)BUTTON_LOCK_ALL ) ); + _watching.push_back( &_addPopupItem( targetDesktop, SP_VERB_LAYER_UNLOCK_ALL, 0, _("Unlock All"), (int)BUTTON_UNLOCK_ALL ) ); _popupMenu.append(*Gtk::manage(new Gtk::SeparatorMenuItem())); - _watchingNonTop.push_back( &_addPopupItem( targetDesktop, SP_VERB_SELECTION_RAISE, GTK_STOCK_GO_UP, "Up", (int)BUTTON_UP ) ); - _watchingNonBottom.push_back( &_addPopupItem( targetDesktop, SP_VERB_SELECTION_LOWER, GTK_STOCK_GO_DOWN, "Down", (int)BUTTON_DOWN ) ); + _watchingNonTop.push_back( &_addPopupItem( targetDesktop, SP_VERB_SELECTION_RAISE, GTK_STOCK_GO_UP, _("Up"), (int)BUTTON_UP ) ); + _watchingNonBottom.push_back( &_addPopupItem( targetDesktop, SP_VERB_SELECTION_LOWER, GTK_STOCK_GO_DOWN, _("Down"), (int)BUTTON_DOWN ) ); _popupMenu.append(*Gtk::manage(new Gtk::SeparatorMenuItem())); - _watching.push_back( &_addPopupItem( targetDesktop, SP_VERB_SELECTION_GROUP, 0, "Group", (int)BUTTON_GROUP ) ); - _watching.push_back( &_addPopupItem( targetDesktop, SP_VERB_SELECTION_UNGROUP, 0, "Ungroup", (int)BUTTON_UNGROUP ) ); + _watching.push_back( &_addPopupItem( targetDesktop, SP_VERB_SELECTION_GROUP, 0, _("Group"), (int)BUTTON_GROUP ) ); + _watching.push_back( &_addPopupItem( targetDesktop, SP_VERB_SELECTION_UNGROUP, 0, _("Ungroup"), (int)BUTTON_UNGROUP ) ); _popupMenu.append(*Gtk::manage(new Gtk::SeparatorMenuItem())); - _watching.push_back( &_addPopupItem( targetDesktop, SP_VERB_OBJECT_SET_CLIPPATH, 0, "Set Clip", (int)BUTTON_SETCLIP ) ); + _watching.push_back( &_addPopupItem( targetDesktop, SP_VERB_OBJECT_SET_CLIPPATH, 0, _("Set Clip"), (int)BUTTON_SETCLIP ) ); - _watching.push_back( &_addPopupItem( targetDesktop, SP_VERB_OBJECT_CREATE_CLIP_GROUP, 0, "Create Clip Group", (int)BUTTON_CLIPGROUP ) ); + _watching.push_back( &_addPopupItem( targetDesktop, SP_VERB_OBJECT_CREATE_CLIP_GROUP, 0, _("Create Clip Group"), (int)BUTTON_CLIPGROUP ) ); //will never be implemented //_watching.push_back( &_addPopupItem( targetDesktop, SP_VERB_OBJECT_SET_INVERSE_CLIPPATH, 0, "Set Inverse Clip", (int)BUTTON_SETINVCLIP ) ); - _watching.push_back( &_addPopupItem( targetDesktop, SP_VERB_OBJECT_UNSET_CLIPPATH, 0, "Unset Clip", (int)BUTTON_UNSETCLIP ) ); + _watching.push_back( &_addPopupItem( targetDesktop, SP_VERB_OBJECT_UNSET_CLIPPATH, 0, _("Unset Clip"), (int)BUTTON_UNSETCLIP ) ); _popupMenu.append(*Gtk::manage(new Gtk::SeparatorMenuItem())); - _watching.push_back( &_addPopupItem( targetDesktop, SP_VERB_OBJECT_SET_MASK, 0, "Set Mask", (int)BUTTON_SETMASK ) ); - _watching.push_back( &_addPopupItem( targetDesktop, SP_VERB_OBJECT_UNSET_MASK, 0, "Unset Mask", (int)BUTTON_UNSETMASK ) ); + _watching.push_back( &_addPopupItem( targetDesktop, SP_VERB_OBJECT_SET_MASK, 0, _("Set Mask"), (int)BUTTON_SETMASK ) ); + _watching.push_back( &_addPopupItem( targetDesktop, SP_VERB_OBJECT_UNSET_MASK, 0, _("Unset Mask"), (int)BUTTON_UNSETMASK ) ); _popupMenu.show_all_children(); } @@ -1922,18 +1949,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 +1976,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..9b9a6025a 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 { @@ -143,7 +147,14 @@ private: Gtk::Menu _popupMenu; Inkscape::UI::Widget::SpinButton _spinBtn; Gtk::VBox _page; - + + Gtk::Label _visibleHeader; + Gtk::Label _lockHeader; + Gtk::Label _typeHeader; + Gtk::Label _clipmaskHeader; + Gtk::Label _highlightHeader; + Gtk::Label _nameHeader; + /* Composite Settings */ Gtk::VBox _composite_vbox; Gtk::VBox _opacity_vbox; @@ -166,8 +177,7 @@ private: Gtk::Alignment _blur_alignment; Gtk::Dialog _colorSelectorDialog; - SPColorSelector *_colorSelector; - + boost::scoped_ptr<Inkscape::UI::SelectedColor> _selectedColor; //Methods: @@ -233,7 +243,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" diff --git a/src/ui/dialog/text-edit.cpp b/src/ui/dialog/text-edit.cpp index 815aa12ef..7575cc854 100644 --- a/src/ui/dialog/text-edit.cpp +++ b/src/ui/dialog/text-edit.cpp @@ -69,6 +69,7 @@ TextEdit::TextEdit() font_label(_("_Font"), true), layout_frame(), text_label(_("_Text"), true), + vari_label(_("_Variants"), true), setasdefault_button(_("Set as _default")), close_button(Gtk::Stock::CLOSE), apply_button(Gtk::Stock::APPLY), @@ -195,7 +196,8 @@ TextEdit::TextEdit() notebook.append_page(font_vbox, font_label); notebook.append_page(text_vbox, text_label); - + notebook.append_page(vari_vbox, vari_label); + /* Buttons */ setasdefault_button.set_use_underline(true); apply_button.set_can_default(); @@ -216,6 +218,7 @@ TextEdit::TextEdit() setasdefault_button.signal_clicked().connect(sigc::mem_fun(*this, &TextEdit::onSetDefault)); apply_button.signal_clicked().connect(sigc::mem_fun(*this, &TextEdit::onApply)); close_button.signal_clicked().connect(sigc::bind(_signal_response.make_slot(), GTK_RESPONSE_CLOSE)); + fontVariantChangedConn = vari_vbox.connectChanged(sigc::bind(sigc::ptr_fun(&onFontVariantChange), this)); desktopChangeConn = deskTrack.connectDesktopChanged( sigc::mem_fun(*this, &TextEdit::setTargetDesktop) ); deskTrack.connect(GTK_WIDGET(gobj())); @@ -230,6 +233,7 @@ TextEdit::~TextEdit() selectChangedConn.disconnect(); desktopChangeConn.disconnect(); deskTrack.disconnect(); + fontVariantChangedConn.disconnect(); } void TextEdit::styleButton(Gtk::RadioButton *button, gchar const *tooltip, gchar const *icon_name, Gtk::RadioButton *group_button ) @@ -384,6 +388,13 @@ void TextEdit::onReadSelection ( gboolean dostyle, gboolean /*docontent*/ ) gtk_entry_set_text ((GtkEntry *) gtk_bin_get_child ((GtkBin *) spacing_combo), sstr); g_free(sstr); + // Update font variant widget + //int result_variants = + sp_desktop_query_style (SP_ACTIVE_DESKTOP, &query, QUERY_STYLE_PROPERTY_FONTVARIANTS); + int result_features = + sp_desktop_query_style (SP_ACTIVE_DESKTOP, &query, QUERY_STYLE_PROPERTY_FONTFEATURESETTINGS); + vari_vbox.update( &query, result_features == QUERY_STYLE_MULTIPLE_DIFFERENT, fontspec ); + } blocked = false; } @@ -510,12 +521,15 @@ SPCSSAttr *TextEdit::fillTextStyle () sp_repr_css_set_property (css, "writing-mode", "tb"); } - // Note that CSS 1.1 does not support line-height; we set it for consistency, but also set + // Note that SVG 1.1 does not support line-height; we set it for consistency, but also set // sodipodi:linespacing for backwards compatibility; in 1.2 we use line-height for flowtext const gchar *sstr = gtk_combo_box_text_get_active_text ((GtkComboBoxText *) spacing_combo); sp_repr_css_set_property (css, "line-height", sstr); + // Font variants + vari_vbox.fill_css( css ); + return css; } @@ -646,6 +660,19 @@ void TextEdit::onFontChange(SPFontSelector * /*fontsel*/, gchar* fontspec, TextE } +void TextEdit::onFontVariantChange(TextEdit *self) +{ + if( self->blocked ) + return; + + SPItem *text = self->getSelectedTextItem (); + + if (text) { + self->apply_button.set_sensitive ( true ); + } + self->setasdefault_button.set_sensitive ( true ); +} + void TextEdit::onStartOffsetChange(GtkTextBuffer * /*text_buffer*/, TextEdit *self) { SPItem *text = self->getSelectedTextItem(); diff --git a/src/ui/dialog/text-edit.h b/src/ui/dialog/text-edit.h index 117ad2e28..cfe612268 100644 --- a/src/ui/dialog/text-edit.h +++ b/src/ui/dialog/text-edit.h @@ -32,9 +32,11 @@ #include "ui/widget/panel.h" #include "ui/widget/frame.h" #include "ui/dialog/desktop-tracker.h" +#include "ui/widget/font-variants.h" class SPItem; struct SPFontSelector; +//class FontVariants; class font_instance; class SPCSSAttr; @@ -111,6 +113,17 @@ protected: static void onFontChange (SPFontSelector *fontsel, gchar* fontspec, TextEdit *self); /** + * Callback invoked when the user modifies the font variant through the dialog. + * + * onFontChange updates the dialog UI. The subfunction setPreviewText updates the preview label. + * + * @param fontsel pointer to FontVariant (currently not used). + * @param fontspec for the text to be previewed. + * @param self pointer to the current instance of the dialog. + */ + static void onFontVariantChange (TextEdit *self); + + /** * Callback invoked when the user modifies the startOffset of text on a path. * * @param text_buffer pointer to the GtkTextBuffer with the text of the selected text object. @@ -213,6 +226,9 @@ private: GtkWidget *text_view; // TODO - Convert this to a Gtk::TextView, but GtkSpell doesn't seem to work with it GtkTextBuffer *text_buffer; + Inkscape::UI::Widget::FontVariants vari_vbox; + Gtk::Label vari_label; + Gtk::HBox button_row; Gtk::Button setasdefault_button; Gtk::Button close_button; @@ -224,6 +240,7 @@ private: sigc::connection selectChangedConn; sigc::connection subselChangedConn; sigc::connection selectModifiedConn; + sigc::connection fontVariantChangedConn; bool blocked; const Glib::ustring samplephrase; |
