rows and columns: spacing: add unit selector

Bug #747998 reported by rekado
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Wishlist
John Smith

Bug Description

This is a feature request.
In the "rows and columns" dialog (Object --> Rows and Columns...), the spacing can only be specified in pixels whereas everywhere else in the program one is given the choice between a number of units (pt, pc, px, mm, in etc.).

A unit selector could be added next to the spacing input boxes on the "rows and columns" dialog.

Tags: ui units
su_v (suv-lp)
tags: added: ui units
Changed in inkscape:
importance: Undecided → Wishlist
status: New → Confirmed
Revision history for this message
su_v (suv-lp) wrote :

Initial commit in revision r10172 by Johan Engelen:
<http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/revision/10172>

As stated in the commit log, the alignment of the of the spinboxes isn't optimal yet (see attached screenshot).

@Johan - do you have an idea how to polish the dialog further?

Changed in inkscape:
status: Confirmed → In Progress
Revision history for this message
Xortex (xortex) wrote :

See if this fix works. To see the screen shot go to:
http://imageshack.us/photo/my-images/59/rowncol.png/

Revision history for this message
su_v (suv-lp) wrote :

@Samuel - thanks a lot for the patch and effort spent :)

Patch tested successfully with r10685 on Mac OS X 10.5.8 (i386) (GTK+ 2.24.4, gtkmm 2.4.0, X11 backend of GTK+):
no regressions noticed, needs code review.

Revision history for this message
Jon A. Cruz (jon-joncruz) wrote :

There are a few calls setting things to fixed sizes of 4 pixels (set_border_width(), etc) that would be good to not leave hardcoded.

Names could use camel case instead of underscores (e.g. "unitBox" instead of "unit_box").

In scalar-unit.cpp, commenting out the pack_start() line should have probably just been a removal.

The implementation of ScalarUnit::getUnitMenu() in the .cpp can should probably not be split over two lines. However, adding this accessor seems to be a sort of a work-around. Exposing an internal member is probably not best. I'll have to look over for a more subtle replacement, but shifting to make a new independent menu and at the same time naming it "buildUnitMenu()", or "createUnitMenu()" might be a good route.

Revision history for this message
Xortex (xortex) wrote :

I tried doing this way:

TileDialog::TileDialog()
    : UI::Widget::Panel("", "/dialogs/gridtiler", SP_VERB_SELECTION_GRIDTILE),
      XPadding(_("X:"), _("Horizontal spacing between columns."), UNIT_TYPE_LINEAR, "", "object-columns", paddingUnitMenu),
      YPadding(_("Y:"), _("Vertical spacing between rows."), UNIT_TYPE_LINEAR, "", "object-rows", paddingUnitMenu)
{
.......

}
like in Transformation.cpp but I end up getting "Segmentation Errors" I could not figure out how to initialize the paddingUnitMenu at the moment the TileDialog is created. In transformation.cpp it's done this way:

Transformation::Transformation()
    : UI::Widget::Panel ("", "/dialogs/transformation", SP_VERB_DIALOG_TRANSFORM),
      _page_move (4, 2),
      _page_scale (4, 2),
      _page_rotate (4, 2),
      _page_skew (4, 2),
      _page_transform (3, 3),
      _scalar_move_horizontal (_("_Horizontal:"), _("Horizontal displacement (relative) or position (absolute)"), UNIT_TYPE_LINEAR,
                               "", "transform-move-horizontal", &_units_move),
      _scalar_move_vertical (_("_Vertical:"), _("Vertical displacement (relative) or position (absolute)"), UNIT_TYPE_LINEAR,
                               "", "transform-move-vertical", &_units_move),

its obscure to me how _units_move is initialized here

Revision history for this message
John Smith (john-smithi) wrote :

Commit r11639 - Align the unit selector and remove compile warnings.

@Samuel Buttigieg
> but I end up getting "Segmentation Errors"
You were very close, just needed to put the UnitMenu before the XPadding/YPadding in the .h file !

Changed in inkscape:
assignee: nobody → John Smith (john-smithi)
status: In Progress → Fix Committed
su_v (suv-lp)
Changed in inkscape:
milestone: none → 0.49
Bryce Harrington (bryce)
Changed in inkscape:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.