~valavanisalex/inkscape/fix-792263

« back to all changes in this revision

Viewing changes to src/ui/dialog/guides.cpp

  • Committer: Johan Engelen
  • Date: 2011-05-26 21:17:37 UTC
  • Revision ID: goejendaagh@zonnet.nl-20110526211737-468600j6fft2conc
add entry widget to guideline dialog to change guide's label
(and fix some label xml writing and rendering bugs)

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
  _relative_toggle(_("Rela_tive change"), _("Move and/or rotate the guide relative to current settings")),
43
43
  _spin_button_x(_("X:"), "", UNIT_TYPE_LINEAR, "", "", &_unit_menu),
44
44
  _spin_button_y(_("Y:"), "", UNIT_TYPE_LINEAR, "", "", &_unit_menu),
 
45
  _label_entry(_("Label:"), _("Optionally give this guideline a name")),
45
46
  _spin_angle(_("Angle:"), "", UNIT_TYPE_RADIAL),
46
47
  _mode(true), _oldpos(0.,0.), _oldangle(0.0)
47
48
{
104
105
 
105
106
    sp_guide_moveto(*_guide, newpos, true);
106
107
 
 
108
    const gchar* name = _label_entry.getEntry()->get_text().c_str();
 
109
    sp_guide_set_label(*_guide, name, true);
 
110
 
107
111
    DocumentUndo::done(_guide->document, SP_VERB_NONE, 
108
112
                       _("Set guide properties"));
109
113
}
167
171
    _label_descr.set_alignment(0, 0.5);
168
172
 
169
173
    // indent
170
 
    _layout_table.attach(*manage(new Gtk::Label(" ")),
171
 
                         0, 1, 2, 3, Gtk::FILL, Gtk::FILL, 10);
 
174
//    _layout_table.attach(*manage(new Gtk::Label(" ")),
 
175
//                         0, 1, 2, 3, Gtk::FILL, Gtk::FILL, 10);
 
176
 
 
177
    _layout_table.attach(_label_entry,
 
178
                         1, 3, 2, 3, Gtk::EXPAND | Gtk::FILL, Gtk::FILL);
172
179
 
173
180
    // unitmenus
174
181
    /* fixme: We should allow percents here too, as percents of the canvas size */
245
252
        g_free(label);
246
253
    }
247
254
 
 
255
    // init name entry
 
256
    _label_entry.getEntry()->set_text(_guide->label ? _guide->label : "");
 
257
 
248
258
    _modeChanged(); // sets values of spinboxes.
249
259
 
250
260
    if ( _oldangle == 90. || _oldangle == 270. || _oldangle == -90. || _oldangle == -270.) {