787
794
_removeOverlapTable(1, 5, false),
788
795
_graphLayoutTable(1, 5, false),
789
796
_nodesTable(1, 4, true),
790
_anchorLabel(_("Relative to: "))
797
_anchorLabel(_("Relative to: ")),
798
_selgrpLabel(_("Treat selection as group: "))
800
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
793
802
//Instanciate the align buttons
794
addAlignButton("al_left_out",
795
_("Align right sides of objects to left side of anchor"),
803
addAlignButton(INKSCAPE_ICON_ALIGN_HORIZONTAL_RIGHT_TO_ANCHOR,
804
_("Align right edges of objects to the left edge of the anchor"),
797
addAlignButton("al_left_in",
798
_("Align left sides"),
806
addAlignButton(INKSCAPE_ICON_ALIGN_HORIZONTAL_LEFT,
807
_("Align left edges"),
800
addAlignButton("al_center_hor",
801
_("Center on vertical axis"),
809
addAlignButton(INKSCAPE_ICON_ALIGN_HORIZONTAL_CENTER,
810
_("Center objects horizontally"),
803
addAlignButton("al_right_in",
812
addAlignButton(INKSCAPE_ICON_ALIGN_HORIZONTAL_RIGHT,
804
813
_("Align right sides"),
806
addAlignButton("al_right_out",
807
_("Align left sides of objects to right side of anchor"),
815
addAlignButton(INKSCAPE_ICON_ALIGN_HORIZONTAL_LEFT_TO_ANCHOR,
816
_("Align left edges of objects to the right edge of the anchor"),
809
addAlignButton("al_top_out",
810
_("Align bottoms of objects to top of anchor"),
818
addAlignButton(INKSCAPE_ICON_ALIGN_VERTICAL_BOTTOM_TO_ANCHOR,
819
_("Align bottom edges of objects to the top edge of the anchor"),
812
addAlignButton("al_top_in",
821
addAlignButton(INKSCAPE_ICON_ALIGN_VERTICAL_TOP,
822
_("Align top edges"),
815
addAlignButton("al_center_ver",
824
addAlignButton(INKSCAPE_ICON_ALIGN_VERTICAL_CENTER,
816
825
_("Center on horizontal axis"),
818
addAlignButton("al_bottom_in",
827
addAlignButton(INKSCAPE_ICON_ALIGN_VERTICAL_BOTTOM,
828
_("Align bottom edges"),
821
addAlignButton("al_bottom_out",
822
_("Align tops of objects to bottom of anchor"),
830
addAlignButton(INKSCAPE_ICON_ALIGN_VERTICAL_TOP_TO_ANCHOR,
831
_("Align top edges of objects to the bottom edge of the anchor"),
825
834
//Baseline aligns
826
addBaselineButton("al_baselines_vert",
827
_("Align baseline anchors of texts vertically"),
828
0, 5, this->align_table(), NR::X, false);
829
addBaselineButton("al_baselines_hor",
835
addBaselineButton(INKSCAPE_ICON_ALIGN_HORIZONTAL_BASELINE,
830
836
_("Align baseline anchors of texts horizontally"),
831
1, 5, this->align_table(), NR::Y, false);
837
0, 5, this->align_table(), Geom::X, false);
838
addBaselineButton(INKSCAPE_ICON_ALIGN_VERTICAL_BASELINE,
839
_("Align baselines of texts"),
840
1, 5, this->align_table(), Geom::Y, false);
833
842
//The distribute buttons
834
addDistributeButton("distribute_hdist",
843
addDistributeButton(INKSCAPE_ICON_DISTRIBUTE_HORIZONTAL_GAPS,
835
844
_("Make horizontal gaps between objects equal"),
836
0, 4, true, NR::X, .5, .5);
845
0, 4, true, Geom::X, .5, .5);
838
addDistributeButton("distribute_left",
839
_("Distribute left sides equidistantly"),
840
0, 1, false, NR::X, 1., 0.);
841
addDistributeButton("distribute_hcentre",
847
addDistributeButton(INKSCAPE_ICON_DISTRIBUTE_HORIZONTAL_LEFT,
848
_("Distribute left edges equidistantly"),
849
0, 1, false, Geom::X, 1., 0.);
850
addDistributeButton(INKSCAPE_ICON_DISTRIBUTE_HORIZONTAL_CENTER,
842
851
_("Distribute centers equidistantly horizontally"),
843
0, 2, false, NR::X, .5, .5);
844
addDistributeButton("distribute_right",
845
_("Distribute right sides equidistantly"),
846
0, 3, false, NR::X, 0., 1.);
852
0, 2, false, Geom::X, .5, .5);
853
addDistributeButton(INKSCAPE_ICON_DISTRIBUTE_HORIZONTAL_RIGHT,
854
_("Distribute right edges equidistantly"),
855
0, 3, false, Geom::X, 0., 1.);
848
addDistributeButton("distribute_vdist",
857
addDistributeButton(INKSCAPE_ICON_DISTRIBUTE_VERTICAL_GAPS,
849
858
_("Make vertical gaps between objects equal"),
850
1, 4, true, NR::Y, .5, .5);
859
1, 4, true, Geom::Y, .5, .5);
852
addDistributeButton("distribute_top",
853
_("Distribute tops equidistantly"),
854
1, 1, false, NR::Y, 0, 1);
855
addDistributeButton("distribute_vcentre",
861
addDistributeButton(INKSCAPE_ICON_DISTRIBUTE_VERTICAL_TOP,
862
_("Distribute top edges equidistantly"),
863
1, 1, false, Geom::Y, 0, 1);
864
addDistributeButton(INKSCAPE_ICON_DISTRIBUTE_VERTICAL_CENTER,
856
865
_("Distribute centers equidistantly vertically"),
857
1, 2, false, NR::Y, .5, .5);
858
addDistributeButton("distribute_bottom",
859
_("Distribute bottoms equidistantly"),
860
1, 3, false, NR::Y, 1., 0.);
866
1, 2, false, Geom::Y, .5, .5);
867
addDistributeButton(INKSCAPE_ICON_DISTRIBUTE_VERTICAL_BOTTOM,
868
_("Distribute bottom edges equidistantly"),
869
1, 3, false, Geom::Y, 1., 0.);
862
871
//Baseline distribs
863
addBaselineButton("distribute_baselines_hor",
872
addBaselineButton(INKSCAPE_ICON_DISTRIBUTE_HORIZONTAL_BASELINE,
864
873
_("Distribute baseline anchors of texts horizontally"),
865
0, 5, this->distribute_table(), NR::X, true);
866
addBaselineButton("distribute_baselines_vert",
867
_("Distribute baseline anchors of texts vertically"),
868
1, 5, this->distribute_table(), NR::Y, true);
874
0, 5, this->distribute_table(), Geom::X, true);
875
addBaselineButton(INKSCAPE_ICON_DISTRIBUTE_VERTICAL_BASELINE,
876
_("Distribute baselines of texts vertically"),
877
1, 5, this->distribute_table(), Geom::Y, true);
870
879
//Randomize & Unclump
871
addRandomizeButton("distribute_randomize",
880
addRandomizeButton(INKSCAPE_ICON_DISTRIBUTE_RANDOMIZE,
872
881
_("Randomize centers in both dimensions"),
874
addUnclumpButton("unclump",
883
addUnclumpButton(INKSCAPE_ICON_DISTRIBUTE_UNCLUMP,
875
884
_("Unclump objects: try to equalize edge-to-edge distances"),
878
887
//Remove overlaps
879
addRemoveOverlapsButton("remove_overlaps",
888
addRemoveOverlapsButton(INKSCAPE_ICON_DISTRIBUTE_REMOVE_OVERLAPS,
880
889
_("Move objects as little as possible so that their bounding boxes do not overlap"),
883
addGraphLayoutButton("graph_layout",
892
addGraphLayoutButton(INKSCAPE_ICON_DISTRIBUTE_GRAPH,
884
893
_("Nicely arrange selected connector network"),
887
896
//Node Mode buttons
888
addNodeButton("node_halign",
889
_("Align selected nodes horizontally"),
891
addNodeButton("node_valign",
892
_("Align selected nodes vertically"),
894
addNodeButton("node_hdistribute",
897
// NOTE: "align nodes vertically" means "move nodes vertically until they align on a common
898
// _horizontal_ line". This is analogous to what the "align-vertical-center" icon means.
899
// There is no doubt some ambiguity. For this reason the descriptions are different.
900
addNodeButton(INKSCAPE_ICON_ALIGN_VERTICAL_NODES,
901
_("Align selected nodes to a common horizontal line"),
903
addNodeButton(INKSCAPE_ICON_ALIGN_HORIZONTAL_NODES,
904
_("Align selected nodes to a common vertical line"),
906
addNodeButton(INKSCAPE_ICON_DISTRIBUTE_HORIZONTAL_NODE,
895
907
_("Distribute selected nodes horizontally"),
897
addNodeButton("node_vdistribute",
909
addNodeButton(INKSCAPE_ICON_DISTRIBUTE_VERTICAL_NODE,
898
910
_("Distribute selected nodes vertically"),
901
913
//Rest of the widgetry
903
915
_combo.append_text(_("Last selected"));
904
916
_combo.append_text(_("First selected"));
905
_combo.append_text(_("Biggest item"));
906
_combo.append_text(_("Smallest item"));
917
_combo.append_text(_("Biggest object"));
918
_combo.append_text(_("Smallest object"));
907
919
_combo.append_text(_("Page"));
908
920
_combo.append_text(_("Drawing"));
909
921
_combo.append_text(_("Selection"));
911
_combo.set_active(prefs_get_int_attribute("dialogs.align", "align-to", 6));
923
_combo.set_active(prefs->getInt("/dialogs/align/align-to", 6));
912
924
_combo.signal_changed().connect(sigc::mem_fun(*this, &AlignAndDistribute::on_ref_change));
914
926
_anchorBox.pack_start(_anchorLabel);
915
927
_anchorBox.pack_start(_combo);
929
_selgrpBox.pack_start(_selgrpLabel);
930
_selgrpBox.pack_start(_selgrp);
931
_selgrp.set_active(prefs->getBool("/dialogs/align/sel-as-groups"));
932
_selgrp.signal_toggled().connect(sigc::mem_fun(*this, &AlignAndDistribute::on_selgrp_toggled));
917
934
_alignBox.pack_start(_anchorBox);
935
_alignBox.pack_start(_selgrpBox);
918
936
_alignBox.pack_start(_alignTable);
920
938
_alignFrame.add(_alignBox);