906void InkscapePreferences::initPageTools()
908 Gtk::TreeModel::iterator iter_tools = this->AddPage(_page_tools, _(
"Tools"),
PREFS_PAGE_TOOLS);
913 Gtk::TreeModel::iterator iter_shapes = this->AddPage(_page_shapes, _(
"Shapes"), iter_tools,
PREFS_PAGE_TOOLS_SHAPES);
938 _page_tools.add_group_header( _(
"Bounding box to use"));
939 _t_bbox_visual.init ( _(
"Visual bounding box"),
"/tools/bounding_box", 0,
false,
nullptr);
940 _page_tools.add_line(
true,
"", _t_bbox_visual,
"",
941 _(
"This bounding box includes stroke width, markers, filter margins, etc."));
942 _t_bbox_geometric.init ( _(
"Geometric bounding box"),
"/tools/bounding_box", 1,
true, &_t_bbox_visual);
943 _page_tools.add_line(
true,
"", _t_bbox_geometric,
"",
944 _(
"This bounding box includes only the bare path"));
946 _page_tools.add_group_header( _(
"Conversion to guides"));
947 _t_cvg_keep_objects.init ( _(
"Keep objects after conversion to guides"),
"/tools/cvg_keep_objects",
false);
948 _page_tools.add_line(
true,
"", _t_cvg_keep_objects,
"",
949 _(
"When converting an object to guides, don't delete the object after the conversion"));
950 _t_cvg_convert_whole_groups.init ( _(
"Treat groups as a single object"),
"/tools/cvg_convert_whole_groups",
false);
951 _page_tools.add_line(
true,
"", _t_cvg_convert_whole_groups,
"",
952 _(
"Treat groups as a single object during conversion to guides rather than converting each child separately"));
954 _pencil_average_all_sketches.init ( _(
"Average all sketches"),
"/tools/freehand/pencil/average_all_sketches",
false);
955 _calligrapy_keep_selected.init ( _(
"Select new path"),
"/tools/calligraphic/keep_selected",
true);
956 _connector_ignore_text.init( _(
"Don't attach connectors to text objects"),
"/tools/connector/ignoretext",
true);
961 AddSelcueCheckbox(_page_selector,
"/tools/select",
false);
962 AddGradientCheckbox(_page_selector,
"/tools/select",
false);
963 AddLayerChangeCheckbox(_page_selector,
"/tools/select",
true);
964 AddPageChangeCheckbox(_page_selector,
"/tools/select",
true);
966 _page_selector.add_group_header( _(
"When transforming, show"));
967 _t_sel_trans_obj.init ( _(
"Objects"),
"/tools/select/show",
"content",
true,
nullptr);
968 _page_selector.add_line(
true,
"", _t_sel_trans_obj,
"",
969 _(
"Show the actual objects when moving or transforming"));
970 _t_sel_trans_outl.init ( _(
"Box outline"),
"/tools/select/show",
"outline",
false, &_t_sel_trans_obj);
971 _page_selector.add_line(
true,
"", _t_sel_trans_outl,
"",
972 _(
"Show only a box outline of the objects when moving or transforming"));
973 _page_selector.add_group_header( _(
"Per-object selection cue"));
974 _t_sel_cue_none.init ( C_(
"Selection cue",
"None"),
"/options/selcue/value",
Inkscape::SelCue::NONE,
false,
nullptr);
975 _page_selector.add_line(
true,
"", _t_sel_cue_none,
"",
976 _(
"No per-object selection indication"));
977 _t_sel_cue_mark.init ( _(
"Mark"),
"/options/selcue/value",
Inkscape::SelCue::MARK,
true, &_t_sel_cue_none);
978 _page_selector.add_line(
true,
"", _t_sel_cue_mark,
"",
979 _(
"Each selected object has a diamond mark in the top left corner"));
980 _t_sel_cue_box.init ( _(
"Box"),
"/options/selcue/value",
Inkscape::SelCue::BBOX,
false, &_t_sel_cue_none);
981 _page_selector.add_line(
true,
"", _t_sel_cue_box,
"",
982 _(
"Each selected object displays its bounding box"));
985 AddSelcueCheckbox(_page_node,
"/tools/nodes",
true);
986 AddGradientCheckbox(_page_node,
"/tools/nodes",
true);
987 AddLayerChangeCheckbox(_page_node,
"/tools/nodes",
false);
989 _page_node.add_group_header( _(
"Path outline"));
990 _t_node_pathoutline_color.init(_(
"Path outline color"),
"/tools/nodes/highlight_color",
"#ff0000ff");
991 _page_node.add_line(
false,
"", _t_node_pathoutline_color,
"", _(
"Selects the color used for showing the path outline"),
false);
992 _t_node_show_outline.init(_(
"Always show outline"),
"/tools/nodes/show_outline",
false);
993 _page_node.add_line(
true,
"", _t_node_show_outline,
"", _(
"Show outlines for all paths, not only invisible paths"));
994 _t_node_live_outline.init(_(
"Update outline when dragging nodes"),
"/tools/nodes/live_outline",
false);
995 _page_node.add_line(
true,
"", _t_node_live_outline,
"", _(
"Update the outline when dragging or transforming nodes; if this is off, the outline will only update when completing a drag"));
996 _t_node_live_objects.init(_(
"Update paths when dragging nodes"),
"/tools/nodes/live_objects",
false);
997 _page_node.add_line(
true,
"", _t_node_live_objects,
"", _(
"Update paths when dragging or transforming nodes; if this is off, paths will only be updated when completing a drag"));
998 _t_node_show_path_direction.init(_(
"Show path direction on outlines"),
"/tools/nodes/show_path_direction",
false);
999 _page_node.add_line(
true,
"", _t_node_show_path_direction,
"", _(
"Visualize the direction of selected paths by drawing small arrows in the middle of each outline segment"));
1000 _t_node_pathflash_enabled.init ( _(
"Show temporary path outline"),
"/tools/nodes/pathflash_enabled",
false);
1001 _page_node.add_line(
true,
"", _t_node_pathflash_enabled,
"", _(
"When hovering over a path, briefly flash its outline"));
1002 _t_node_pathflash_selected.init ( _(
"Show temporary outline for selected paths"),
"/tools/nodes/pathflash_selected",
false);
1003 _page_node.add_line(
true,
"", _t_node_pathflash_selected,
"", _(
"Show temporary outline even when a path is selected for editing"));
1004 _t_node_pathflash_timeout.init(
"/tools/nodes/pathflash_timeout", 0, 10000.0, 100.0, 100.0, 1000.0,
true,
false);
1005 _page_node.add_line(
false, _(
"_Flash time:"), _t_node_pathflash_timeout,
"ms", _(
"Specifies how long the path outline will be visible after a mouse-over (in milliseconds); specify 0 to have the outline shown until mouse leaves the path"),
false);
1006 _page_node.add_group_header(_(
"Editing preferences"));
1007 _t_node_single_node_transform_handles.init(_(
"Show transform handles for single nodes"),
"/tools/nodes/single_node_transform_handles",
false);
1008 _page_node.add_line(
true,
"", _t_node_single_node_transform_handles,
"", _(
"Show transform handles even when only a single node is selected"));
1009 _t_node_delete_flat_corner.init(
"/tools/node/flat-cusp-angle", 0, 180, 1, 5, 135,
false,
false);
1010 _page_node.add_line(
true, _(
"Cusp considered flat for deletion:"), _t_node_delete_flat_corner,
"degrees or more", _(
"Preserve shape when deleting flat nodes.\nInsert segments for sharp ones."),
false);
1012 _page_node.add_group_header(_(
"Delete Modes"));
1015 Glib::ustring
const labels[] = {
1016 _(
"Preserve curves only"),
1017 _(
"Preserve cusps only"),
1019 _(
"Straight lines"),
1020 _(
"Remove nodes and leave a gap"),
1021 _(
"Remove lines and leave a gap")
1023 int const values[] = {
1032 widget.init(
"/tools/node/delete-mode-" +
name, labels, values, (
int)initial);
1041 _page_node.add_line(
false, _(
"_Delete Modes:"), _t_node_delete_mode,
"", _(
"What happens when nodes are deleted."),
false);
1042 _page_node.add_line(
false,
"+ Ctrl", _t_node_delete_mode1,
"", _(
"What happens when nodes are deleted while ctrl is held."),
false);
1043 _page_node.add_line(
false,
"+ Alt", _t_node_delete_mode2,
"", _(
"What happens when nodes are deleted while alt is held."),
false);
1044 _page_node.add_line(
false,
"+ Shift", _t_node_delete_mode3,
"", _(
"What happens when nodes are deleted while shift is held."),
false);
1045 _page_node.add_line(
false, _(
"Cut Mode:"), _t_node_cut_mode,
"", _(
"What happens when nodes are cut."),
false);
1048 this->AddNewObjectsStyle(_page_tweak,
"/tools/tweak", _(
"Object paint style"));
1049 AddSelcueCheckbox(_page_tweak,
"/tools/tweak",
true);
1050 AddGradientCheckbox(_page_tweak,
"/tools/tweak",
false);
1053 AddSelcueCheckbox(_page_zoom,
"/tools/zoom",
true);
1054 AddGradientCheckbox(_page_zoom,
"/tools/zoom",
false);
1057 auto const cb = Gtk::make_managed<PrefCheckButton>();
1058 cb->init ( _(
"Ignore first and last points"),
"/tools/measure/ignore_1st_and_last",
true);
1059 _page_measure.add_line(
false,
"", *cb,
"", _(
"The start and end of the measurement tool's control line will not be considered for calculating lengths. Only lengths between actual curve intersections will be displayed."));
1062 this->AddSelcueCheckbox(_page_shapes,
"/tools/shapes",
true);
1063 this->AddGradientCheckbox(_page_shapes,
"/tools/shapes",
true);
1066 this->AddNewObjectsStyle(_page_rectangle,
"/tools/shapes/rect");
1067 this->AddConvertGuidesCheckbox(_page_rectangle,
"/tools/shapes/rect",
true);
1070 this->AddNewObjectsStyle(_page_3dbox,
"/tools/shapes/3dbox");
1071 this->AddConvertGuidesCheckbox(_page_3dbox,
"/tools/shapes/3dbox",
true);
1074 this->AddNewObjectsStyle(_page_ellipse,
"/tools/shapes/arc");
1077 this->AddNewObjectsStyle(_page_star,
"/tools/shapes/star");
1080 this->AddNewObjectsStyle(_page_spiral,
"/tools/shapes/spiral");
1083 this->AddSelcueCheckbox(_page_pencil,
"/tools/freehand/pencil",
true);
1084 this->AddNewObjectsStyle(_page_pencil,
"/tools/freehand/pencil");
1085 this->AddDotSizeSpinbutton(_page_pencil,
"/tools/freehand/pencil", 3.0);
1086 this->AddBaseSimplifySpinbutton(_page_pencil,
"/tools/freehand/pencil", 25.0);
1087 _page_pencil.add_group_header( _(
"Sketch mode"));
1088 _page_pencil.add_line(
true,
"", _pencil_average_all_sketches,
"",
1089 _(
"If on, the sketch result will be the normal average of all sketches made, instead of averaging the old result with the new sketch"));
1092 this->AddSelcueCheckbox(_page_pen,
"/tools/freehand/pen",
true);
1093 this->AddNewObjectsStyle(_page_pen,
"/tools/freehand/pen");
1094 this->AddDotSizeSpinbutton(_page_pen,
"/tools/freehand/pen", 3.0);
1097 this->AddSelcueCheckbox(_page_calligraphy,
"/tools/calligraphic",
false);
1098 this->AddNewObjectsStyle(_page_calligraphy,
"/tools/calligraphic");
1099 _page_calligraphy.add_line(
false,
"", _calligrapy_keep_selected,
"",
1100 _(
"If on, each newly created object will be selected (deselecting previous selection)"));
1103 this->AddSelcueCheckbox(_page_text,
"/tools/text",
true);
1104 this->AddGradientCheckbox(_page_text,
"/tools/text",
true);
1106 auto cb = Gtk::make_managed<PrefCheckButton>();
1107 cb->init ( _(
"Show font samples in the drop-down list"),
"/tools/text/show_sample_in_list",
true);
1108 _page_text.add_line(
false,
"", *cb,
"", _(
"Show font samples alongside font names in the drop-down list in Text bar"));
1110 _font_dialog.init(_(
"Show font substitution warning dialog"),
"/options/font/substitutedlg",
false);
1111 _page_text.add_line(
false,
"", _font_dialog,
"", _(
"Show font substitution warning dialog when requested fonts are not available on the system"));
1112 _font_sample.init(
"/tools/text/font_sample",
true);
1113 _page_text.add_line(
false, _(
"Font sample"), _font_sample,
"", _(
"Change font preview sample text"),
true);
1115 cb = Gtk::make_managed<PrefCheckButton>();
1116 cb->init ( _(
"Use SVG2 auto-flowed text"),
"/tools/text/use_svg2",
true);
1117 _page_text.add_line(
false,
"", *cb,
"", _(
"Use SVG2 auto-flowed text instead of SVG1.2 auto-flowed text. (Recommended)"));
1119 _recently_used_fonts_size.init(
"/tools/text/recently_used_fonts_size", 0, 100, 1, 10, 10,
true,
false);
1120 _page_text.add_line(
false, _(
"Fonts in 'Recently used' collection:"), _recently_used_fonts_size,
"",
1121 _(
"Maximum number of fonts in the 'Recently used' font collection"),
false);
1122 _recently_used_fonts_size.changed_signal.connect([](
double new_size) {
1131 _page_text.add_group_header( _(
"Font directories"));
1132 _font_fontsdir_system.init( _(
"Use Inkscape's fonts directory"),
"/options/font/use_fontsdir_system",
true);
1133 _page_text.add_line(
true,
"", _font_fontsdir_system,
"", _(
"Load additional fonts from \"fonts\" directory located in Inkscape's global \"share\" directory"));
1134 _font_fontsdir_user.init( _(
"Use user's fonts directory"),
"/options/font/use_fontsdir_user",
true);
1135 _page_text.add_line(
true,
"", _font_fontsdir_user,
"", _(
"Load additional fonts from \"fonts\" directory located in Inkscape's user configuration directory"));
1136 _font_fontdirs_custom.init(
"/options/font/custom_fontdirs", 50);
1137 _page_text.add_line(
true, _(
"Additional font directories"), _font_fontdirs_custom,
"", _(
"Load additional fonts from custom locations (one path per line)"),
true);
1140 this->AddNewObjectsStyle(_page_text,
"/tools/text");
1143 AddSelcueCheckbox(_page_spray,
"/tools/spray",
true);
1144 AddGradientCheckbox(_page_spray,
"/tools/spray",
false);
1147 this->AddNewObjectsStyle(_page_eraser,
"/tools/eraser");
1150 this->AddSelcueCheckbox(_page_paintbucket,
"/tools/paintbucket",
false);
1151 this->AddNewObjectsStyle(_page_paintbucket,
"/tools/paintbucket");
1154 this->AddSelcueCheckbox(_page_gradient,
"/tools/gradient",
true);
1155 _misc_forkvectors.init( _(
"Prevent sharing of gradient definitions"),
"/options/forkgradientvectors/value",
true);
1156 _page_gradient.add_line(
false,
"", _misc_forkvectors,
"",
1157 _(
"When on, shared gradient definitions are automatically forked on change; uncheck to allow sharing of gradient definitions so that editing one object may affect other objects using the same gradient"),
true);
1159 _misc_gradientangle.init(
"/dialogs/gradienteditor/angle", -359, 359, 1, 90, 0,
false,
false);
1160 _page_gradient.add_line(
false, _(
"Linear gradient _angle:"), _misc_gradientangle,
"",
1161 _(
"Default angle of new linear gradients in degrees (clockwise from horizontal)"),
false);
1163 _misc_gradient_collect.init(_(
"Auto-delete unused gradients"),
"/option/gradient/auto_collect",
true);
1164 _page_gradient.add_line(
1165 false,
"", _misc_gradient_collect,
"",
1166 _(
"When enabled, gradients that are not used will be deleted (auto-collected) automatically "
1167 "from the SVG file. When disabled, unused gradients will be preserved in "
1168 "the file for later use. (Note: This setting only affects new gradients.)"),
1172 this->AddSelcueCheckbox(_page_dropper,
"/tools/dropper",
true);
1173 this->AddGradientCheckbox(_page_dropper,
"/tools/dropper",
true);
1176 this->AddSelcueCheckbox(_page_connector,
"/tools/connector",
true);
1177 _page_connector.add_line(
false,
"", _connector_ignore_text,
"",
1178 _(
"If on, connector attachment points will not be shown for text objects"));
1183 this->AddNewObjectsStyle(_page_lpetool,
"/tools/lpetool");
1564void InkscapePreferences::initPageUI()
1566 Gtk::TreeModel::iterator iter_ui = this->AddPage(_page_ui, _(
"Interface"),
PREFS_PAGE_UI);
1568 Glib::ustring languages[] = {_(
"System default"),
1569 _(
"Albanian (sq)"), _(
"Arabic (ar)"), _(
"Armenian (hy)"), _(
"Assamese (as)"), _(
"Azerbaijani (az)"),
1570 _(
"Basque (eu)"), _(
"Belarusian (be)"), _(
"Bulgarian (bg)"), _(
"Bengali (bn)"), _(
"Bengali/Bangladesh (bn_BD)"), _(
"Bodo (brx)"), _(
"Breton (br)"),
1571 _(
"Catalan (ca)"), _(
"Valencian Catalan (ca@valencia)"), _(
"Chinese/China (zh_CN)"), _(
"Chinese/Taiwan (zh_TW)"), _(
"Croatian (hr)"), _(
"Czech (cs)"),
1572 _(
"Danish (da)"), _(
"Dogri (doi)"), _(
"Dutch (nl)"), _(
"Dzongkha (dz)"),
1573 _(
"German (de)"), _(
"Greek (el)"),
1574 _(
"English (en)"), _(
"English/Australia (en_AU)"), _(
"English/Canada (en_CA)"), _(
"English/Great Britain (en_GB)"), _(
"Esperanto (eo)"), _(
"Estonian (et)"),
1575 _(
"Farsi (fa)"), _(
"Finnish (fi)"), _(
"French (fr)"),
1576 _(
"Galician (gl)"), _(
"Gujarati (gu)"),
1577 _(
"Hebrew (he)"), _(
"Hindi (hi)"), _(
"Hungarian (hu)"),
1578 _(
"Icelandic (is)"), _(
"Indonesian (id)"), _(
"Irish (ga)"), _(
"Italian (it)"),
1580 _(
"Kannada (kn)"), _(
"Kashmiri in Perso-Arabic script (ks@aran)"), _(
"Kashmiri in Devanagari script (ks@deva)"), _(
"Khmer (km)"), _(
"Kinyarwanda (rw)"), _(
"Konkani (kok)"), _(
"Konkani in Latin script (kok@latin)"), _(
"Korean (ko)"),
1581 _(
"Latvian (lv)"), _(
"Lithuanian (lt)"),
1582 _(
"Macedonian (mk)"), _(
"Maithili (mai)"), _(
"Malayalam (ml)"), _(
"Manipuri (mni)"), _(
"Manipuri in Bengali script (mni@beng)"), _(
"Marathi (mr)"), _(
"Mongolian (mn)"),
1583 _(
"Nepali (ne)"), _(
"Norwegian Bokmål (nb)"), _(
"Norwegian Nynorsk (nn)"),
1585 _(
"Panjabi (pa)"), _(
"Polish (pl)"), _(
"Portuguese (pt)"), _(
"Portuguese/Brazil (pt_BR)"),
1586 _(
"Romanian (ro)"), _(
"Russian (ru)"),
1587 _(
"Sanskrit (sa)"), _(
"Santali (sat)"), _(
"Santali in Devanagari script (sat@deva)"), _(
"Serbian (sr)"), _(
"Serbian in Latin script (sr@latin)"),
1588 _(
"Sindhi (sd)"), _(
"Sindhi in Devanagari script (sd@deva)"), _(
"Slovak (sk)"), _(
"Slovenian (sl)"), _(
"Spanish (es)"), _(
"Spanish/Mexico (es_MX)"), _(
"Swedish (sv)"),
1589 _(
"Tamil (ta)"), _(
"Telugu (te)"), _(
"Thai (th)"), _(
"Turkish (tr)"),
1590 _(
"Ukrainian (uk)"), _(
"Urdu (ur)"),
1591 _(
"Vietnamese (vi)")};
1592 Glib::ustring langValues[] = {
"",
1593 "sq",
"ar",
"hy",
"as",
"az",
1594 "eu",
"be",
"bg",
"bn",
"bn_BD",
"brx",
"br",
1595 "ca",
"ca@valencia",
"zh_CN",
"zh_TW",
"hr",
"cs",
1596 "da",
"doi",
"nl",
"dz",
1598 "en",
"en_AU",
"en_CA",
"en_GB",
"eo",
"et",
1602 "is",
"id",
"ga",
"it",
1604 "kn",
"ks@aran",
"ks@deva",
"km",
"rw",
"kok",
"kok@latin",
"ko",
1606 "mk",
"mai",
"ml",
"mni",
"mni@beng",
"mr",
"mn",
1609 "pa",
"pl",
"pt",
"pt_BR",
1611 "sa",
"sat",
"sat@deva",
"sr",
"sr@latin",
1612 "sd",
"sd@deva",
"sk",
"sl",
"es",
"es_MX",
"sv",
1613 "ta",
"te",
"th",
"tr",
1621 int n =
sizeof( languages ) /
sizeof( Glib::ustring );
1622 Glib::ustring key_language;
1623 Glib::ustring key_langValue;
1624 for ( j = 1 ; j < n ; j++ ) {
1625 key_language = languages[j];
1626 key_langValue = langValues[j];
1629 && ( ( languages[i] > key_language
1630 && langValues[i] !=
"" )
1631 || key_langValue ==
"" ) )
1633 languages[i+1] = languages[i];
1634 langValues[i+1] = langValues[i];
1637 languages[i+1] = key_language;
1638 langValues[i+1] = key_langValue;
1642 _ui_languages.init(
"/ui/language", languages, langValues, languages[0]);
1643 _ui_languages.enable_search();
1644 _page_ui.add_line(
false, _(
"Language:"), _ui_languages,
"",
1645 _(
"Set the language for menus and number formats"),
false,
reset_icon());
1649 _misc_recent.init(
"/options/maxrecentdocuments/value", 0.0, 1000.0, 1.0, 1.0, 1.0,
true,
false);
1651 auto const reset_recent = Gtk::make_managed<Gtk::Button>(_(
"Clear list"));
1652 reset_recent->signal_clicked().connect(sigc::mem_fun(*
this, &InkscapePreferences::on_reset_open_recent_clicked));
1654 _page_ui.add_line(
false, _(
"Maximum documents\n in Open _Recent:"), _misc_recent,
"",
1655 _(
"Set the maximum length of the Open Recent list in the File menu, or clear the list"),
false, reset_recent);
1657 _page_ui.add_group_header(_(
"_Zoom correction factor (in %)"), 2);
1658 _page_ui.add_group_note(_(
"Adjust the slider until the length of the ruler on your screen matches its real length. This information is used when zooming to 1:1, 1:2, etc., to display objects in their true sizes"));
1659 _ui_zoom_correction.init(300, 30, 0.01, 500.0, 1.0, 10.0, 1.0);
1660 _page_ui.add_line(
true,
"", _ui_zoom_correction,
"",
"",
true);
1662 _ui_realworldzoom.init( _(
"Show zoom percentage corrected by factor"),
"/options/zoomcorrection/shown",
true);
1663 _page_ui.add_line(
false,
"", _ui_realworldzoom,
"", _(
"Zoom percentage can be either by the physical units or by pixels."));
1665 _ui_rotationlock.init(_(
"Lock canvas rotation by default"),
"/options/rotationlock",
false);
1666 _page_ui.add_line(
false,
"", _ui_rotationlock,
"",
1667 _(
"Prevent accidental canvas rotation by disabling on-canvas keyboard and mouse actions for rotation"),
true);
1669 _ui_rulersel.init( _(
"Show selection in ruler"),
"/options/ruler/show_bbox",
true);
1670 _page_ui.add_line(
false,
"", _ui_rulersel,
"", _(
"Shows a blue line in the ruler where the selection is."));
1672 _page_ui.add_group_header(_(
"User Interface"), 2);
1674 _mouse_grabsize.init(
"/options/grabsize/value", 1, 15, 1, 2, 3, 0);
1675 _page_ui.add_line(
true, _(
"Handle size"), _mouse_grabsize,
"", _(
"Set the relative size of node handles"),
true);
1677 auto box = Gtk::make_managed<Gtk::Box>(Gtk::Orientation::HORIZONTAL);
1678 auto img = Gtk::make_managed<Gtk::Picture>();
1679 auto scale = get_scale_factor();
1681 img->set_layout_manager(Gtk::BinLayout::create());
1685 img->set_halign(Gtk::Align::CENTER);
1687 auto cb = Gtk::make_managed<Inkscape::UI::Widget::IconComboBox>(
false);
1688 cb->set_valign(Gtk::Align::CENTER);
1691 for (
auto theme : mgr.get_handle_themes()) {
1692 unsigned int frame = theme.positive ? 0x000000 : 0xffffff;
1693 cb->add_row(
draw_color_preview(theme.rgb_accent_color, frame, get_scale_factor()), theme.title, i++);
1696 cb->set_active_by_id(mgr.get_selected_theme());
1699 mgr.connectCssUpdated(sigc::track_object(
1701 cb->signal_changed().connect([=,
this](
int id) {
1709 _page_ui.add_line(
true, _(
"Handle colors"), *box,
"",
"Select handle color scheme.");
1711 _narrow_spinbutton.init(_(
"Use narrow number entry boxes"),
"/theme/narrowSpinButton",
false);
1712 _page_ui.add_line(
false,
"", _narrow_spinbutton,
"", _(
"Make number editing boxes smaller by limiting padding"),
false);
1714 _page_ui.add_group_header(_(
"Status bar"), 2);
1715 auto const sb_style = Gtk::make_managed<UI::Widget::PrefCheckButton>();
1716 sb_style->init(_(
"Show current style"),
"/statusbar/visibility/style",
true);
1717 _page_ui.add_line(
false,
"", *sb_style,
"", _(
"Control visibility of current fill, stroke and opacity in status bar."),
true);
1718 auto const sb_layer = Gtk::make_managed<UI::Widget::PrefCheckButton>();
1719 sb_layer->init(_(
"Show layer selector"),
"/statusbar/visibility/layer",
true);
1720 _page_ui.add_line(
false,
"", *sb_layer,
"", _(
"Control visibility of layer selection menu in status bar."),
true);
1721 auto const sb_coords = Gtk::make_managed<UI::Widget::PrefCheckButton>();
1722 sb_coords->init(_(
"Show mouse coordinates"),
"/statusbar/visibility/coordinates",
true);
1723 _page_ui.add_line(
false,
"", *sb_coords,
"", _(
"Control visibility of mouse coordinates X & Y in status bar."),
true);
1724 auto const sb_rotate = Gtk::make_managed<UI::Widget::PrefCheckButton>();
1725 sb_rotate->init(_(
"Show canvas rotation"),
"/statusbar/visibility/rotation",
true);
1726 _page_ui.add_line(
false,
"", *sb_rotate,
"", _(
"Control visibility of canvas rotation in status bar."),
true);
1728 _page_ui.add_group_header(_(
"Mouse cursors"), 2);
1729 _ui_cursorscaling.init(_(
"Enable scaling"),
"/options/cursorscaling",
true);
1730 _page_ui.add_line(
false,
"", _ui_cursorscaling,
"", _(
"When off, cursor scaling is disabled. Cursor scaling may be broken when fractional scaling is enabled."),
true);
1731 _ui_cursor_shadow.init(_(
"Show drop shadow"),
"/options/cursor-drop-shadow",
true);
1732 _page_ui.add_line(
false,
"", _ui_cursor_shadow,
"", _(
"Control visibility of drop shadow for Inkscape cursors."),
true);
1735 _page_theme.add_group_header(_(
"Theme"));
1736 _dark_theme.init(_(
"Use dark theme"),
"/theme/preferDarkTheme",
false);
1737 Glib::ustring current_theme = prefs->
getString(
"/theme/gtkTheme", prefs->
getString(
"/theme/defaultGtkTheme",
""));
1738 Glib::ustring default_theme = prefs->
getString(
"/theme/defaultGtkTheme");
1739 Glib::ustring theme =
"";
1741 dark_themes = INKSCAPE.themecontext->get_available_themes();
1742 std::vector<Glib::ustring> labels;
1743 std::vector<Glib::ustring> values;
1744 for (
auto const &[theme, dark] : dark_themes) {
1745 if (theme == default_theme) {
1748 values.emplace_back(theme);
1749 labels.emplace_back(theme);
1751 std::sort(labels.begin(), labels.end());
1752 std::sort(values.begin(), values.end());
1753 labels.erase(unique(labels.begin(), labels.end()), labels.end());
1754 values.erase(unique(values.begin(), values.end()), values.end());
1755 values.emplace_back(
"");
1756 Glib::ustring default_theme_label = _(
"Use system theme");
1757 default_theme_label +=
" (" + default_theme +
")";
1758 labels.emplace_back(default_theme_label);
1760 _gtk_theme.init(
"/theme/gtkTheme", labels, values,
"");
1761 _page_theme.add_line(
false, _(
"Change GTK theme:"), _gtk_theme,
"",
"",
false);
1762 _gtk_theme.signal_changed().connect(sigc::mem_fun(*
this, &InkscapePreferences::comboThemeChange));
1765 _sys_user_themes_dir_copy.init(g_build_filename(g_get_user_data_dir(),
"themes",
nullptr), _(
"Open themes folder"));
1766 _page_theme.add_line(
true, _(
"User themes:"), _sys_user_themes_dir_copy,
"", _(
"Location of the user’s themes"),
true, Gtk::make_managed<Gtk::Box>());
1767 _contrast_theme.init(
"/theme/contrast", 1, 10, 1, 2, 10, 1);
1769 _page_theme.add_line(
true,
"", _dark_theme,
"", _(
"Use dark theme"),
true);
1771 auto const font_scale = Gtk::make_managed<UI::Widget::PrefSlider>();
1773 font_scale->getSlider()->set_format_value_func([=](
double const val) {
1780 auto const space = Gtk::make_managed<Gtk::Box>(Gtk::Orientation::HORIZONTAL);
1781 space->set_valign(Gtk::Align::CENTER);
1782 auto const reset = Gtk::make_managed<Gtk::Button>();
1783 reset->set_tooltip_text(_(
"Reset font size to 100%"));
1784 reset->set_image_from_icon_name(
"reset-settings-symbolic");
1785 reset->set_size_request(30, -1);
1786 auto const apply = Gtk::make_managed<Gtk::Button>(_(
"Apply"));
1787 apply->set_tooltip_text(_(
"Apply font size changes to the UI"));
1788 apply->set_valign(Gtk::Align::FILL);
1789 apply->set_margin_end(5);
1790 reset->set_valign(Gtk::Align::FILL);
1791 space->append(*apply);
1792 space->append(*reset);
1793 reset->signal_clicked().connect([=](){
1794 font_scale->getSlider()->set_value(100);
1795 INKSCAPE.themecontext->adjustGlobalFontScale(1.0);
1797 apply->signal_clicked().connect([=](){
1798 INKSCAPE.themecontext->adjustGlobalFontScale(font_scale->getSlider()->get_value() / 100.0);
1800 _page_theme.add_line(
false, _(
"_Font scale:"), *font_scale,
"", _(
"Adjust size of UI fonts"),
true, space);
1802 auto const space = Gtk::make_managed<Gtk::Box>(Gtk::Orientation::HORIZONTAL);
1803 space->set_size_request(_sb_width / 3, -1);
1804 _page_theme.add_line(
false, _(
"_Contrast:"), _contrast_theme,
"",
1805 _(
"Make background brighter or darker to adjust contrast"),
true, space);
1806 _contrast_theme.getSlider()->signal_value_changed().connect(sigc::mem_fun(*
this, &InkscapePreferences::contrastThemeChange));
1808 _dark_theme.get_parent()->set_visible(dark_themes[current_theme]);
1810 _dark_theme.signal_toggled().connect(sigc::mem_fun(*
this, &InkscapePreferences::preferDarkThemeChange));
1813 _page_theme.add_group_header(_(
"Icons"));
1816 std::vector<Glib::ustring> labels;
1817 std::vector<Glib::ustring> values;
1818 Glib::ustring default_icon_theme = prefs->
getString(
"/theme/defaultIconTheme");
1819 for (
auto &&folder : get_foldernames(ICONS, {
"application" })) {
1824 const size_t last_slash_idx = folder.find_last_of(
"\\/");
1825 if (std::string::npos != last_slash_idx) {
1826 folder.erase(0, last_slash_idx + 1);
1830 auto const folder_utf8 = Glib::filename_to_utf8(folder);
1831 if (folder_utf8 == default_icon_theme) {
1835 labels.emplace_back( folder) ;
1836 values.emplace_back(std::move(folder));
1838 std::sort(labels.begin(), labels.end());
1839 std::sort(values.begin(), values.end());
1840 labels.erase(unique(labels.begin(), labels.end()), labels.end());
1841 values.erase(unique(values.begin(), values.end()), values.end());
1842 values.emplace_back(
"");
1843 Glib::ustring default_icon_label = _(
"Use system icons");
1844 default_icon_label +=
" (" + default_icon_theme +
")";
1845 labels.emplace_back(default_icon_label);
1847 _icon_theme.init(
"/theme/iconTheme", labels, values,
"");
1848 _page_theme.add_line(
false, _(
"Change icon theme:"), _icon_theme,
"",
"",
false);
1849 _icon_theme.signal_changed().connect(sigc::mem_fun(*
this, &InkscapePreferences::symbolicThemeCheck));
1851 _(
"Open icons folder"));
1852 _page_theme.add_line(
true, _(
"User icons: "), _sys_user_icons_dir_copy,
"", _(
"Location of the user’s icons"),
true, Gtk::make_managed<Gtk::Box>());
1854 Glib::ustring themeiconname = prefs->
getString(
"/theme/iconTheme", prefs->
getString(
"/theme/defaultIconTheme",
""));
1855 _symbolic_icons.init(_(
"Use symbolic icons"),
"/theme/symbolicIcons",
false);
1856 _symbolic_icons.signal_toggled().connect(sigc::mem_fun(*
this, &InkscapePreferences::toggleSymbolic));
1857 _page_theme.add_line(
true,
"", _symbolic_icons,
"",
"",
true);
1858 _symbolic_base_colors.init(_(
"Use default base color for icons"),
"/theme/symbolicDefaultBaseColors",
true);
1859 _symbolic_base_colors.signal_toggled().connect(sigc::mem_fun(*
this, &InkscapePreferences::resetIconsColorsWrapper));
1860 _page_theme.add_line(
true,
"", _symbolic_base_colors,
"",
"",
true);
1861 _symbolic_highlight_colors.init(_(
"Use default highlight colors for icons"),
"/theme/symbolicDefaultHighColors",
true);
1862 _symbolic_highlight_colors.signal_toggled().connect(sigc::mem_fun(*
this, &InkscapePreferences::resetIconsColorsWrapper));
1863 _page_theme.add_line(
true,
"", _symbolic_highlight_colors,
"",
"",
true);
1864 _symbolic_base_color.init(_(
"Color for symbolic icons:"),
"/theme/" + themeiconname +
"/symbolicBaseColor",
1866 _symbolic_success_color.init(_(
"Color for symbolic success icons:"),
1867 "/theme/" + themeiconname +
"/symbolicSuccessColor",
"#4AD589ff");
1868 _symbolic_warning_color.init(_(
"Color for symbolic warning icons:"),
1869 "/theme/" + themeiconname +
"/symbolicWarningColor",
"#F57900ff");
1870 _symbolic_error_color.init(_(
"Color for symbolic error icons:"),
"/theme/" + themeiconname +
"/symbolicErrorColor",
1872 _symbolic_base_color.add_css_class(
"system_base_color");
1873 _symbolic_success_color.add_css_class(
"system_success_color");
1874 _symbolic_warning_color.add_css_class(
"system_warning_color");
1875 _symbolic_error_color.add_css_class(
"system_error_color");
1876 _symbolic_base_color.add_css_class(
"symboliccolors");
1877 _symbolic_success_color.add_css_class(
"symboliccolors");
1878 _symbolic_warning_color.add_css_class(
"symboliccolors");
1879 _symbolic_error_color.add_css_class(
"symboliccolors");
1880 auto const changeIconsColor = sigc::hide(sigc::mem_fun(*
this, &InkscapePreferences::changeIconsColors));
1881 _symbolic_base_color.connectChanged (changeIconsColor);
1882 _symbolic_warning_color.connectChanged(changeIconsColor);
1883 _symbolic_success_color.connectChanged(changeIconsColor);
1884 _symbolic_error_color.connectChanged (changeIconsColor);
1885 auto const icon_buttons = Gtk::make_managed<Gtk::Box>();
1886 UI::pack_start(*icon_buttons, _symbolic_base_color,
true,
true, 4);
1887 _page_theme.add_line(
false,
"", *icon_buttons, _(
"Icon color base"),
1888 _(
"Base color for icons"),
false);
1889 auto const icon_buttons_hight = Gtk::make_managed<Gtk::Box>();
1890 UI::pack_start(*icon_buttons_hight, _symbolic_success_color,
true,
true, 4);
1891 UI::pack_start(*icon_buttons_hight, _symbolic_warning_color,
true,
true, 4);
1892 UI::pack_start(*icon_buttons_hight, _symbolic_error_color,
true,
true, 4);
1893 _page_theme.add_line(
false,
"", *icon_buttons_hight, _(
"Icon color highlights"),
1894 _(
"Highlight colors supported by some symbolic icon themes"),
1896 auto const icon_buttons_def = Gtk::make_managed<Gtk::Box>();
1898 changeIconsColors();
1899 _page_theme.add_line(
false,
"", *icon_buttons_def,
"",
1900 _(
"Reset theme colors for some symbolic icon themes"),
1902 Glib::ustring menu_icons_labels[] = {_(
"Yes"), _(
"No"), _(
"Theme decides")};
1903 int menu_icons_values[] = {1, -1, 0};
1904 _menu_icons.init(
"/theme/menuIcons", menu_icons_labels, menu_icons_values, 0);
1905 _page_theme.add_line(
false, _(
"Show icons in menus:"), _menu_icons,
"",
1906 _(
"You can either enable or disable all icons in menus. By default, the setting for the 'use-icon' attribute in the 'menus.ui' file determines whether to display icons in menus."),
false,
reset_icon());
1907 _shift_icons.init(_(
"Shift icons in menus"),
"/theme/shiftIcons",
true);
1908 _page_theme.add_line(
true,
"", _shift_icons,
"",
1909 _(
"This preference fixes icon positions in menus."),
false,
reset_icon());
1911 _page_theme.add_group_header(_(
"XML Editor"));
1914 auto manager = gtk_source_style_scheme_manager_get_default();
1915 auto ids = gtk_source_style_scheme_manager_get_scheme_ids(manager);
1917 auto const syntax = Gtk::make_managed<UI::Widget::PrefCombo>();
1918 std::vector<Glib::ustring> labels;
1919 std::vector<Glib::ustring> values;
1920 for (
const char* style = *ids; style; style = *++ids) {
1921 if (
auto scheme = gtk_source_style_scheme_manager_get_scheme(manager, style)) {
1922 auto name = gtk_source_style_scheme_get_name(scheme);
1923 labels.emplace_back(
name);
1926 labels.emplace_back(style);
1928 values.emplace_back(style);
1930 syntax->init(
"/theme/syntax-color-theme", labels, values,
"");
1931 _page_theme.add_line(
false, _(
"Color theme:"), *syntax,
"", _(
"Syntax coloring for XML Editor"),
false);
1935 auto const font_button = Gtk::make_managed<Gtk::Button>(
"...");
1936 font_button->set_halign(Gtk::Align::START);
1937 auto const font_box = Gtk::make_managed<Gtk::Entry>();
1938 font_box->set_editable(
false);
1939 font_box->set_sensitive(
false);
1940 auto theme = INKSCAPE.themecontext;
1941 font_box->set_text(theme->getMonospacedFont().to_string());
1942 font_button->signal_clicked().connect([=,
this]{
1943 auto dlg = std::make_unique<Gtk::FontChooserDialog>();
1945 dlg->set_filter_func([](
const Glib::RefPtr<const Pango::FontFamily>& family,
const Glib::RefPtr<const Pango::FontFace>& face) {
1946 return family && family->is_monospace();
1948 dlg->set_font_desc(theme->getMonospacedFont());
1949 dlg->signal_response().connect([=, d = dlg.get()] (
int response) {
1950 if (response == Gtk::ResponseType::OK) {
1951 auto desc = d->get_font_desc();
1952 theme->saveMonospacedFont(desc);
1953 theme->adjustGlobalFontScale(theme->getFontScale() / 100);
1954 font_box->set_text(desc.to_string());
1959 _page_theme.add_line(
false, _(
"Monospaced font:"), *font_box,
"", _(
"Select fixed-width font"),
true, font_button);
1961 auto const mono_font = Gtk::make_managed<UI::Widget::PrefCheckButton>();
1962 mono_font->init( _(
"Use monospaced font"),
"/dialogs/xml/mono-font",
false);
1963 _page_theme.add_line(
false, _(
"XML tree:"), *mono_font,
"", _(
"Use fixed-width font in XML Editor"),
false);
1969 symbolicThemeCheck();
1972 _page_toolbars.add_group_header(_(
"Toolbars"));
1975 auto &toolbox = get_widget<Gtk::Box>(
builder,
"tool-toolbar-prefs");
1978 if (
auto const button =
dynamic_cast<Gtk::ToggleButton *
>(&widget)) {
1980 button->set_action_name(
"");
1982 button->set_sensitive();
1987 button->signal_clicked().connect([=](){
1988 bool new_state = !button->get_active();
1989 button->set_active(new_state);
1995 iapp->get_action_extra_data().get_tooltip_for_action(get_tool_action(
action_name),
true,
true);
1996 button->set_tooltip_markup(tooltip);
2002 _page_toolbars.add_line(
false,
"", toolbox,
"", _(
"Select visible tool buttons"),
true);
2004 struct tbar_info {
const char*
label;
const char* prefs;} toolbars[] = {
2010 auto const format_value = [](
int const val) -> Glib::ustring
2011 {
return std::to_string(100 * val / min) +=
'%'; };
2012 for (
auto&& tbox : toolbars) {
2013 auto const slider = Gtk::make_managed<UI::Widget::PrefSlider>(
false);
2014 slider->init(tbox.prefs, min, max, 1, 4, min, 0);
2015 slider->getSlider()->set_format_value_func(format_value);
2016 slider->getSlider()->set_draw_value();
2017 slider->getSlider()->add_css_class(
"small-marks");
2018 for (
int i = min; i <=
max; i += 8) {
2019 auto const markup = (i %
min == 0) ? format_value(i) : Glib::ustring{};
2020 slider->getSlider()->add_mark(i, Gtk::PositionType::BOTTOM, markup);
2022 _page_toolbars.add_line(
false, tbox.label, *slider,
"", _(
"Adjust toolbar icon size"));
2025 std::vector<PrefItem> snap = {
2026 { _(
"Simple"), 1, _(
"Present simplified snapping options that manage all advanced settings"),
true },
2027 { _(
"Advanced"), 0, _(
"Expose all snapping options for manual control") },
2028 { _(
"Permanent"), 2, _(
"All advanced snap options appear in a permanent bar") },
2030 _page_toolbars.add_line(
false, _(
"Snap controls bar:"), *Gtk::make_managed<PrefRadioButtons>(snap,
"/toolbox/simplesnap"),
"",
"");
2031 }
catch (Glib::Error
const &error) {
2032 g_error(
"Couldn't load toolbar-tool-prefs user interface file: `%s`", error.what());
2038 _win_save_geom.init ( _(
"Save and restore window geometry for each document"),
"/options/savewindowgeometry/value",
PREFS_WINDOW_GEOMETRY_FILE,
true,
nullptr);
2039 _win_save_geom_prefs.init ( _(
"Remember and use last window's geometry"),
"/options/savewindowgeometry/value",
PREFS_WINDOW_GEOMETRY_LAST,
false, &_win_save_geom);
2040 _win_save_geom_off.init ( _(
"Don't save window geometry"),
"/options/savewindowgeometry/value",
PREFS_WINDOW_GEOMETRY_NONE,
false, &_win_save_geom);
2042 _win_native.init ( _(
"Native open/save dialogs"),
"/options/desktopintegration/value", 1,
true,
nullptr);
2043 _win_gtk.init ( _(
"GTK open/save dialogs"),
"/options/desktopintegration/value", 0,
false, &_win_native);
2046 Glib::ustring startModeLabels[] = {C_(
"Start mode",
"Nothing"),
2047 C_(
"Start mode",
"Splash screen only"),
2048 C_(
"Start mode",
"Welcome screen")};
2049 int startModeValues[] = {0, 1, 2};
2051 _win_start_mode.init(
"/options/boot/mode", startModeLabels, startModeValues, 2);
2052 _page_windows.add_line(
false, _(
"Show when starting:"), _win_start_mode,
"",
2053 _(
"Set what shows when loading the program normally."),
false);
2056 _win_hide_task.init ( _(
"Dialogs are hidden in taskbar"),
"/options/dialogsskiptaskbar/value",
true);
2057 _win_save_viewport.init ( _(
"Save and restore documents viewport"),
"/options/savedocviewport/value",
true);
2058 _win_zoom_resize.init ( _(
"Zoom when window is resized"),
"/options/stickyzoom/value",
false);
2059 _win_ontop_none.init ( C_(
"Dialog on top",
"None"),
"/options/transientpolicy/value",
PREFS_DIALOGS_WINDOWS_NONE,
false,
nullptr);
2065 _win_dialogs_labels_off.init( _(
"Off"),
"/options/notebooklabels/value",
PREFS_NOTEBOOK_LABELS_OFF,
false, &_win_dialogs_labels_auto);
2067 _win_dialogs_tab_close_btn.init(_(
"Show close button in tab"),
"/options/notebooktabs/show-closebutton",
false);
2070 Glib::ustring defaultSizeLabels[] = {C_(
"Window size",
"Default"),
2071 C_(
"Window size",
"Small"),
2072 C_(
"Window size",
"Large"),
2073 C_(
"Window size",
"Maximized")};
2079 _win_default_size.init(
"/options/defaultwindowsize/value", defaultSizeLabels, defaultSizeValues,
PREFS_WINDOW_SIZE_NATURAL);
2080 _page_windows.add_line(
false, _(
"Default window size:"), _win_default_size,
"",
2081 _(
"Set the default window size"),
false);
2084 _page_windows.add_group_header( _(
"Saving window size and position"), 4);
2085 _page_windows.add_line(
true,
"", _win_save_geom_off,
"",
2086 _(
"Let the window manager determine placement of all windows"));
2087 _page_windows.add_line(
true,
"", _win_save_geom_prefs,
"",
2088 _(
"Remember and use the last window's geometry (saves geometry to user preferences)"));
2089 _page_windows.add_line(
true,
"", _win_save_geom,
"",
2090 _(
"Save and restore window geometry for each document (saves geometry in the document)"));
2093 _page_windows.add_group_header( _(
"Desktop integration"));
2094 _page_windows.add_line(
true,
"", _win_native,
"",
2095 _(
"Use Windows like open and save dialogs"));
2096 _page_windows.add_line(
true,
"", _win_gtk,
"",
2097 _(
"Use GTK open and save dialogs "));
2099 _page_windows.add_group_header(_(
"Dialogs settings"), 4);
2101 std::vector<PrefItem> dock = {
2105 _page_windows.add_line(
true, _(
"Dialog behavior"), *Gtk::make_managed<PrefRadioButtons>(dock,
"/options/dialogtype/value"),
"",
"",
false,
reset_icon());
2108 std::vector<PrefItem> on_top = {
2113 _page_windows.add_line(
true, _(
"Dialog on top"), *Gtk::make_managed<PrefRadioButtons>(on_top,
"/options/transientpolicy/value"),
"",
"");
2116 std::vector<PrefItem> labels = {
2121 _page_windows.add_line(
true, _(
"Tab labels"), *Gtk::make_managed<PrefRadioButtons>(labels,
"/options/notebooklabels/value"),
"",
"",
false);
2122 _page_windows.add_line(
true,
"Dialog tabs", _win_dialogs_tab_close_btn,
"", _(
"Show close button in dialog tabs"));
2124 auto const save_dlg = Gtk::make_managed<PrefCheckButton>();
2125 save_dlg->init(_(
"Save and restore dialogs' status"),
"/options/savedialogposition/value",
true);
2126 _page_windows.add_line(
true,
"", *save_dlg,
"", _(
"Save and restore dialogs' status (the last open windows dialogs are saved when it closes)"));
2129 _page_windows.add_line(
true,
"", _win_hide_task,
"",
2130 _(
"Whether dialog windows are to be hidden in the window manager taskbar"));
2132 _page_windows.add_group_header( _(
"Text and Font dialog"));
2133 std::vector<PrefItem> lister = {
2134 { _(
"List fonts and styles"), 0, _(
"List fonts and styles separately"),
true },
2135 { _(
"Unified font browser (experimental)"), 1, _(
"Show all font styles in a single list") }
2137 _page_windows.add_line(
true, _(
"Font selector"), *Gtk::make_managed<PrefRadioButtons>(lister,
"/options/font/browser"),
"",
"",
false,
reset_icon());
2139 _page_windows.add_group_header( _(
"Miscellaneous"));
2141 _page_windows.add_line(
true,
"", _win_zoom_resize,
"",
2142 _(
"Zoom drawing when document window is resized, to keep the same area visible (this is the default which can be changed in any window using the button above the right scrollbar)"));
2143 _page_windows.add_line(
true,
"", _win_save_viewport,
"",
2144 _(
"Save documents viewport (zoom and panning position). Useful to turn off when sharing version controlled files."));
2150 static auto GRID_DEFAULT_BLOCK_COLOR =
"#0047cb4d";
2153 _compact_colorselector.init(_(
"Use compact color selector mode switch"),
"/colorselector/switcher",
true);
2154 _page_color_pickers.add_line(
false,
"", _compact_colorselector,
"", _(
"Use compact combo box for selecting color modes"),
false);
2156 _page_color_pickers.add_group_header(_(
"Visible color pickers"));
2158 auto const container = Gtk::make_managed<Gtk::Box>(Gtk::Orientation::HORIZONTAL);
2161 auto const btn = Gtk::make_managed<Gtk::ToggleButton>();
2162 auto const box = Gtk::make_managed<Gtk::Box>(Gtk::Orientation::HORIZONTAL);
2163 auto const label = Gtk::make_managed<Gtk::Label>(space->getName());
2164 label->set_valign(Gtk::Align::CENTER);
2166 UI::pack_start(*box, *Gtk::make_managed<Gtk::Image>(Gio::ThemedIcon::create(space->getIcon())));
2167 box->set_spacing(3);
2168 auto path = space->getPrefsPath() +
"visible";
2169 btn->set_active(prefs->
getBool(path));
2170 btn->set_child(*box);
2171 btn->set_has_frame(
false);
2173 btn->signal_toggled().connect([=, path = std::move(path)]() {
2174 prefs->
setBool(path, btn->get_active());
2177 auto const is_active = [](Gtk::Widget
const *
const child)
2178 {
return dynamic_cast<Gtk::ToggleButton
const &
>(*child).get_active(); };
2179 if (!buttons.empty() && std::none_of(buttons.begin(), buttons.end(), is_active)) {
2181 dynamic_cast<Gtk::ToggleButton &
>(*buttons.front()).set_active(
true);
2188 container->set_spacing(5);
2189 _page_color_pickers.add_line(
true,
"", *container,
"", _(
"Select color pickers"),
false);
2196 _page_grids.add_group_header( _(
"Line color when zooming out"));
2198 _grids_no_emphasize_on_zoom.init( _(
"Minor grid line color"),
"/options/grids/no_emphasize_when_zoomedout", 1,
true,
nullptr);
2199 _page_grids.add_line(
true,
"", _grids_no_emphasize_on_zoom,
"", _(
"The gridlines will be shown in minor grid line color"),
false);
2200 _grids_emphasize_on_zoom.init( _(
"Major grid line color"),
"/options/grids/no_emphasize_when_zoomedout", 0,
false, &_grids_no_emphasize_on_zoom);
2201 _page_grids.add_line(
true,
"", _grids_emphasize_on_zoom,
"", _(
"The gridlines will be shown in major grid line color"),
false);
2203 _page_grids.add_group_header( _(
"Default grid settings"));
2205 _page_grids.add_line(
true,
"", _grids_notebook,
"",
"",
false);
2206 _grids_notebook.set_halign(Gtk::Align::START);
2207 _grids_notebook.set_hexpand(
false);
2208 auto& grid_modular = *Gtk::make_managed<UI::Widget::DialogPage>();
2209 _grids_notebook.append_page(_grids_xy, _(
"Rectangular Grid"));
2210 _grids_notebook.append_page(_grids_axonom, _(
"Axonometric Grid"));
2211 _grids_notebook.append_page(grid_modular, _(
"Modular Grid"));
2214 _grids_xy_units.init(
"/options/grids/xy/units");
2215 _grids_xy.add_line(
false, _(
"Grid units:"), _grids_xy_units,
"",
"",
false);
2216 _grids_xy.add_line(
false, _(
"Origin X:"), _grids_xy_origin_x,
"", _(
"X coordinate of grid origin"),
false);
2217 _grids_xy.add_line(
false, _(
"Origin Y:"), _grids_xy_origin_y,
"", _(
"Y coordinate of grid origin"),
false);
2218 _grids_xy.add_line(
false, _(
"Spacing X:"), _grids_xy_spacing_x,
"", _(
"Distance between vertical grid lines"),
false);
2219 _grids_xy.add_line(
false, _(
"Spacing Y:"), _grids_xy_spacing_y,
"", _(
"Distance between horizontal grid lines"),
false);
2222 _grids_xy.add_line(
false, _(
"Grid color:"), _grids_xy_empcolor,
"", _(
"Color used for grid lines"),
false);
2223 _grids_xy_empspacing.init(
"/options/grids/xy/empspacing", 1.0, 1000.0, 1.0, 5.0, 5.0,
true,
false);
2224 _grids_xy.add_line(
false, _(
"Major grid line every:"), _grids_xy_empspacing,
"",
"",
false);
2225 _grids_xy_dotted.init( _(
"Show dots instead of lines"),
"/options/grids/xy/dotted",
false);
2226 _grids_xy.add_line(
false,
"", _grids_xy_dotted,
"", _(
"If set, display dots at gridpoints instead of gridlines"),
false);
2229 _grids_axonom_units.init(
"/options/grids/axonom/units");
2230 _grids_axonom.add_line(
false, _(
"Grid units:"), _grids_axonom_units,
"",
"",
false);
2231 _grids_axonom.add_line(
false, _(
"Origin X:"), _grids_axonom_origin_x,
"", _(
"X coordinate of grid origin"),
false);
2232 _grids_axonom.add_line(
false, _(
"Origin Y:"), _grids_axonom_origin_y,
"", _(
"Y coordinate of grid origin"),
false);
2233 _grids_axonom.add_line(
false, _(
"Spacing Y:"), _grids_axonom_spacing_y,
"", _(
"Base length of z-axis"),
false);
2234 _grids_axonom_angle_x.init(
"/options/grids/axonom/angle_x", -360.0, 360.0, 1.0, 10.0, 30.0,
false,
false);
2235 _grids_axonom_angle_z.init(
"/options/grids/axonom/angle_z", -360.0, 360.0, 1.0, 10.0, 30.0,
false,
false);
2236 _grids_axonom.add_line(
false, _(
"Angle X:"), _grids_axonom_angle_x,
"", _(
"Angle of x-axis"),
false);
2237 _grids_axonom.add_line(
false, _(
"Angle Z:"), _grids_axonom_angle_z,
"", _(
"Angle of z-axis"),
false);
2239 _grids_axonom.add_line(
false, _(
"Grid color:"), _grids_axonom_empcolor,
"", _(
"Color used for grid lines"),
false);
2240 _grids_axonom_empspacing.init(
"/options/grids/axonom/empspacing", 1.0, 1000.0, 1.0, 5.0, 5.0,
true,
false);
2241 _grids_axonom.add_line(
false, _(
"Major grid line every:"), _grids_axonom_empspacing,
"",
"",
false);
2243 auto const units = Gtk::make_managed<UI::Widget::PrefUnit>();
2244 units->init(
"/options/grids/modular/units");
2245 auto const origin_x = Gtk::make_managed<UI::Widget::PrefSpinButton>();
2246 auto const origin_y = Gtk::make_managed<UI::Widget::PrefSpinButton>();
2247 auto const block_width = Gtk::make_managed<UI::Widget::PrefSpinButton>();
2248 auto const block_height = Gtk::make_managed<UI::Widget::PrefSpinButton>();
2249 auto const gap_x = Gtk::make_managed<UI::Widget::PrefSpinButton>();
2250 auto const gap_y = Gtk::make_managed<UI::Widget::PrefSpinButton>();
2251 auto const margin_x = Gtk::make_managed<UI::Widget::PrefSpinButton>();
2252 auto const margin_y = Gtk::make_managed<UI::Widget::PrefSpinButton>();
2253 auto const color_major = Gtk::make_managed<UI::Widget::PrefColorPicker>();
2254 color_major->init(_(
"Grid color:"),
"/options/grids/modular/empcolor", GRID_DEFAULT_BLOCK_COLOR);
2256 grid_modular.add_line(
false, _(
"Grid units:"), *units,
"",
"",
false);
2257 grid_modular.add_line(
false, _(
"Origin X:"), *origin_x,
"", _(
"X coordinate of grid origin"),
false);
2258 grid_modular.add_line(
false, _(
"Origin Y:"), *origin_y,
"", _(
"Y coordinate of grid origin"),
false);
2259 grid_modular.add_line(
false, _(
"Block width:"), *block_width,
"", _(
"Width of grid modules"),
false);
2260 grid_modular.add_line(
false, _(
"Block height:"), *block_height,
"", _(
"Height of grid modules"),
false);
2261 grid_modular.add_line(
false, _(
"Gap X:"), *gap_x,
"", _(
"Horizontal distance between blocks"),
false);
2262 grid_modular.add_line(
false, _(
"Gap Y:"), *gap_y,
"", _(
"Vertical distance between blocks"),
false);
2263 grid_modular.add_line(
false, _(
"Margin X:"), *margin_x,
"", _(
"Right and left margins"),
false);
2264 grid_modular.add_line(
false, _(
"Margin Y:"), *margin_y,
"", _(
"Top and bottom margins"),
false);
2265 grid_modular.add_line(
false, _(
"Grid color:"), *color_major,
"", _(
"Color used for grid blocks"),
false);
2267 for (
auto [spin, path] : (
std::tuple<PrefSpinButton*, const char*>[]) {
2268 {&_grids_xy_origin_x,
"/options/grids/xy/origin_x"},
2269 {&_grids_xy_origin_y,
"/options/grids/xy/origin_y"},
2270 {&_grids_xy_spacing_x,
"/options/grids/xy/spacing_x"},
2271 {&_grids_xy_spacing_y,
"/options/grids/xy/spacing_y"},
2272 {&_grids_axonom_origin_x,
"/options/grids/axonom/origin_x"},
2273 {&_grids_axonom_origin_y,
"/options/grids/axonom/origin_y"},
2274 {&_grids_axonom_spacing_y,
"/options/grids/axonom/spacing_y"},
2275 {origin_x,
"/options/grids/modular/origin_x"},
2276 {origin_y,
"/options/grids/modular/origin_y"},
2277 {block_width,
"/options/grids/modular/spacing_x"},
2278 {block_height,
"/options/grids/modular/spacing_y"},
2279 {gap_x,
"/options/grids/modular/gapx"},
2280 {gap_y,
"/options/grids/modular/gapy"},
2281 {margin_x,
"/options/grids/modular/marginx"},
2282 {margin_y,
"/options/grids/modular/marginy"},
2284 spin->init(path, -10'000.0, 10'000.0, 0.1, 1.0, 0.0,
false,
false);
2285 spin->set_digits(5);
2286 spin->set_width_chars(12);
2293 _page_command_palette.add_group_header(_(
"Display Options"));
2295 _cp_show_full_action_name.init(_(
"Show command line argument names"),
"/options/commandpalette/showfullactionname/value",
false);
2296 _page_command_palette.add_line(
true,
"", _cp_show_full_action_name,
"", _(
"Show action argument names in the command palette suggestions, most useful for using them on the command line"));
2298 _cp_show_untranslated_name.init(_(
"Show untranslated (English) names"),
"/options/commandpalette/showuntranslatedname/value",
true);
2299 _page_command_palette.add_line(
true,
"", _cp_show_untranslated_name,
"", _(
"Also show the English names of the command"));
2305 initKeyboardShortcuts(iter_ui);
2347void InkscapePreferences::initPageIO()
2349 Gtk::TreeModel::iterator iter_io = this->AddPage(_page_io, _(
"Input/Output"),
PREFS_PAGE_IO);
2351 _save_use_current_dir.init( _(
"Use current directory for \"Save As ...\""),
"/dialogs/save_as/use_current_dir",
true);
2352 _page_io.add_line(
false,
"", _save_use_current_dir,
"",
2353 _(
"When this option is on, the \"Save as...\" and \"Save a Copy...\" dialogs will always open in the directory where the currently open document is; when it's off, each will open in the directory where you last saved a file using it"),
true);
2355 _misc_default_metadata.init( _(
"Add default metadata to new documents"),
"/metadata/addToNewFile",
false);
2356 _page_io.add_line(
false,
"", _misc_default_metadata,
"",
2357 _(
"Add default metadata to new documents. Default metadata can be set from Document Properties->Metadata."),
true);
2359 _export_all_extensions.init( _(
"Show all outputs in Export Dialog"),
"/dialogs/export/show_all_extensions",
false);
2360 _page_io.add_line(
false,
"", _export_all_extensions,
"",
2361 _(
"Will list all possible output extensions in the Export Dialog selection."),
true);
2364 _mouse_sens.init (
"/options/cursortolerance/value", 0.0, 30.0, 1.0, 1.0, 8.0,
true,
false);
2365 _page_mouse.add_line(
false, _(
"_Grab sensitivity:"), _mouse_sens, _(
"pixels"),
2366 _(
"How close on the screen you need to be to an object to be able to grab it with mouse (in screen pixels)"),
false,
reset_icon());
2367 _mouse_thres.init (
"/options/dragtolerance/value", 0.0, 100.0, 1.0, 1.0, 8.0,
true,
false);
2368 _page_mouse.add_line(
false, _(
"_Click/drag threshold:"), _mouse_thres, _(
"pixels"),
2369 _(
"Maximum mouse drag (in screen pixels) which is considered a click, not a drag"),
false);
2371 _mouse_use_ext_input.init( _(
"Use pressure-sensitive tablet"),
"/options/useextinput/value",
true);
2372 _page_mouse.add_line(
false,
"",_mouse_use_ext_input,
"",
2373 _(
"Use the capabilities of a tablet or other pressure-sensitive device. Disable this only if you have problems with the tablet (you can still use it as a mouse)"),
false,
reset_icon());
2375 _mouse_switch_on_ext_input.init( _(
"Switch tool based on tablet device"),
"/options/switchonextinput/value",
false);
2376 _page_mouse.add_line(
false,
"",_mouse_switch_on_ext_input,
"",
2377 _(
"Change tool as different devices are used on the tablet (pen, eraser, mouse)"),
false,
reset_icon());
2381 _svgoutput_usenamedcolors.init( _(
"Use named colors"),
"/options/svgoutput/usenamedcolors",
false);
2382 _page_svgoutput.add_line(
false,
"", _svgoutput_usenamedcolors,
"", _(
"If set, write the CSS name of the color when available (e.g. 'red' or 'magenta') instead of the numeric value"),
false);
2384 _page_svgoutput.add_group_header( _(
"XML formatting"));
2386 _svgoutput_inlineattrs.init( _(
"Inline attributes"),
"/options/svgoutput/inlineattrs",
false);
2387 _page_svgoutput.add_line(
true,
"", _svgoutput_inlineattrs,
"", _(
"Put attributes on the same line as the element tag"),
false);
2389 _svgoutput_indent.init(
"/options/svgoutput/indent", 0.0, 1000.0, 1.0, 2.0, 2.0,
true,
false);
2390 _page_svgoutput.add_line(
true, _(
"_Indent, spaces:"), _svgoutput_indent,
"", _(
"The number of spaces to use for indenting nested elements; set to 0 for no indentation"),
false);
2392 _page_svgoutput.add_group_header( _(
"Path data"));
2394 Glib::ustring
const pathstringFormatLabels[] = {_(
"Absolute"), _(
"Relative"), _(
"Optimized")};
2395 int const pathstringFormatValues[] = {0, 1, 2};
2396 _svgoutput_pathformat.init(
"/options/svgoutput/pathstring_format", pathstringFormatLabels, pathstringFormatValues, 2);
2397 _page_svgoutput.add_line(
true, _(
"Path string format:"), _svgoutput_pathformat,
"", _(
"Path data should be written: only with absolute coordinates, only with relative coordinates, or optimized for string length (mixed absolute and relative coordinates)"),
false);
2399 _svgoutput_forcerepeatcommands.init( _(
"Force repeat commands"),
"/options/svgoutput/forcerepeatcommands",
false);
2400 _page_svgoutput.add_line(
true,
"", _svgoutput_forcerepeatcommands,
"", _(
"Force repeating of the same path command (for example, 'L 1,2 L 3,4' instead of 'L 1,2 3,4')"),
false);
2402 _page_svgoutput.add_group_header( _(
"Numbers"));
2404 _svgoutput_numericprecision.init(
"/options/svgoutput/numericprecision", 1.0, 16.0, 1.0, 2.0, 8.0,
true,
false);
2405 _page_svgoutput.add_line(
true, _(
"_Numeric precision:"), _svgoutput_numericprecision,
"", _(
"Significant figures of the values written to the SVG file"),
false);
2407 _svgoutput_minimumexponent.init(
"/options/svgoutput/minimumexponent", -32.0, -1, 1.0, 2.0, -8.0,
true,
false);
2408 _page_svgoutput.add_line(
true, _(
"Minimum _exponent:"), _svgoutput_minimumexponent,
"", _(
"The smallest number written to SVG is 10 to the power of this exponent; anything smaller is written as zero"),
false);
2413 _page_svgoutput.add_group_header( _(
"Improper Attributes Actions"));
2415 _svgoutput_attrwarn.init( _(
"Print warnings"),
"/options/svgoutput/incorrect_attributes_warn",
true);
2416 _page_svgoutput.add_line(
true,
"", _svgoutput_attrwarn,
"", _(
"Print warning if invalid or non-useful attributes found. Database files located in inkscape_data_dir/attributes."),
false);
2417 _svgoutput_attrremove.init( _(
"Remove attributes"),
"/options/svgoutput/incorrect_attributes_remove",
false);
2418 _page_svgoutput.add_line(
true,
"", _svgoutput_attrremove,
"", _(
"Delete invalid or non-useful attributes from element tag"),
false);
2421 _page_svgoutput.add_group_header( _(
"Inappropriate Style Properties Actions"));
2423 _svgoutput_stylepropwarn.init( _(
"Print warnings"),
"/options/svgoutput/incorrect_style_properties_warn",
true);
2424 _page_svgoutput.add_line(
true,
"", _svgoutput_stylepropwarn,
"", _(
"Print warning if inappropriate style properties found (i.e. 'font-family' set on a <rect>). Database files located in inkscape_data_dir/attributes."),
false);
2425 _svgoutput_stylepropremove.init( _(
"Remove style properties"),
"/options/svgoutput/incorrect_style_properties_remove",
false);
2426 _page_svgoutput.add_line(
true,
"", _svgoutput_stylepropremove,
"", _(
"Delete inappropriate style properties"),
false);
2429 _page_svgoutput.add_group_header( _(
"Non-useful Style Properties Actions"));
2431 _svgoutput_styledefaultswarn.init( _(
"Print warnings"),
"/options/svgoutput/style_defaults_warn",
true);
2432 _page_svgoutput.add_line(
true,
"", _svgoutput_styledefaultswarn,
"", _(
"Print warning if redundant style properties found (i.e. if a property has the default value and a different value is not inherited or if value is the same as would be inherited). Database files located in inkscape_data_dir/attributes."),
false);
2433 _svgoutput_styledefaultsremove.init( _(
"Remove style properties"),
"/options/svgoutput/style_defaults_remove",
false);
2434 _page_svgoutput.add_line(
true,
"", _svgoutput_styledefaultsremove,
"", _(
"Delete redundant style properties"),
false);
2436 _page_svgoutput.add_group_header( _(
"Check Attributes and Style Properties on"));
2438 _svgoutput_check_reading.init( _(
"Reading"),
"/options/svgoutput/check_on_reading",
false);
2439 _page_svgoutput.add_line(
true,
"", _svgoutput_check_reading,
"", _(
"Check attributes and style properties on reading in SVG files (including those internal to Inkscape which will slow down startup)"),
false);
2440 _svgoutput_check_editing.init( _(
"Editing"),
"/options/svgoutput/check_on_editing",
false);
2441 _page_svgoutput.add_line(
true,
"", _svgoutput_check_editing,
"", _(
"Check attributes and style properties while editing SVG files (may slow down Inkscape, mostly useful for debugging)"),
false);
2442 _svgoutput_check_writing.init( _(
"Writing"),
"/options/svgoutput/check_on_writing",
true);
2443 _page_svgoutput.add_line(
true,
"", _svgoutput_check_writing,
"", _(
"Check attributes and style properties on writing out SVG files"),
false);
2450 _page_svgexport.add_group_header( _(
"SVG 2"));
2451 _svgexport_insert_text_fallback.init( _(
"Insert SVG 1.1 fallback in text"),
"/options/svgexport/text_insertfallback",
true );
2452 _svgexport_insert_mesh_polyfill.init( _(
"Insert JavaScript code for mesh gradients"),
"/options/svgexport/mesh_insertpolyfill",
true );
2453 _svgexport_insert_hatch_polyfill.init( _(
"Insert JavaScript code for SVG2 hatches"),
"/options/svgexport/hatch_insertpolyfill",
true );
2455 _page_svgexport.add_line(
false,
"", _svgexport_insert_text_fallback,
"", _(
"Adds fallback options for non-SVG 2 renderers."),
false);
2456 _page_svgexport.add_line(
false,
"", _svgexport_insert_mesh_polyfill,
"", _(
"Adds a JavaScript polyfill for rendering meshes in web browsers."),
false);
2457 _page_svgexport.add_line(
false,
"", _svgexport_insert_hatch_polyfill,
"", _(
"Adds a JavaScript polyfill for rendering hatches in web browsers."),
false);
2460 _page_svgexport.add_group_header( _(
"SVG 2 to SVG 1.1"));
2462 _svgexport_remove_marker_auto_start_reverse.init( _(
"Use correct marker direction in SVG 1.1 renderers"),
"/options/svgexport/marker_autostartreverse",
false);
2463 _svgexport_remove_marker_context_paint.init( _(
"Use correct marker colors in SVG 1.1 renderers"),
"/options/svgexport/marker_contextpaint",
false);
2465 _page_svgexport.add_line(
false,
"", _svgexport_remove_marker_auto_start_reverse,
"", _(
"SVG 2 allows markers to automatically be reversed at the start of a path with 'auto_start_reverse'. This adds a rotated duplicate of the marker's definition."),
false);
2466 _page_svgexport.add_line(
false,
"", _svgexport_remove_marker_context_paint,
"", _(
"SVG 2 allows markers to automatically match the stroke color by using 'context_paint' or 'context_fill'. This adjusts the markers own colors."),
false);
2474 Glib::ustring
const intentLabels[] = {_(
"Perceptual"), _(
"Relative Colorimetric"),
2475 _(
"Saturation"), _(
"Absolute Colorimetric")};
2476 int const intentValues[] = {0, 1, 2, 3};
2478 _page_cms.add_group_header( _(
"Display adjustment"));
2480 Glib::ustring tmpStr;
2483 tmpStr += path.first;
2486 gchar* profileTip = g_strdup_printf(_(
"The ICC profile to use to calibrate display output.\nSearched directories:%s"), tmpStr.c_str());
2487 _page_cms.add_line(
true, _(
"User monitor profile:"), _cms_display_profile,
"",
2490 profileTip =
nullptr;
2492 _cms_from_user.init( _(
"Use profile from user"),
"/options/displayprofile/use_user_profile",
false);
2493 _page_cms.add_line(
true,
"", _cms_from_user,
"",
2494 _(
"Use a user-specified ICC profile for monitor color correction. Warning: System wide color correction should be disabled."),
false);
2496 _cms_intent.init(
"/options/displayprofile/intent", intentLabels, intentValues, 0);
2497 _page_cms.add_line(
true, _(
"Display rendering intent:"), _cms_intent,
"",
2498 _(
"The rendering intent to use to calibrate display output"),
false);
2500 _page_cms.add_group_header( _(
"Proofing"));
2502 _cms_softproof.init( _(
"Simulate output on screen"),
"/options/softproof/enable",
false);
2503 _page_cms.add_line(
true,
"", _cms_softproof,
"",
2504 _(
"Simulates output of target device"),
false);
2506 _cms_gamutwarn.init( _(
"Mark out of gamut colors"),
"/options/softproof/gamutwarn",
false);
2507 _page_cms.add_line(
true,
"", _cms_gamutwarn,
"",
2508 _(
"Highlights colors that are out of gamut for the target device"),
false);
2510 Glib::ustring colorStr = prefs->
getString(
"/options/softproof/gamutcolor");
2512 Gdk::RGBA tmpColor( colorStr.empty() ?
"#00ff00" : colorStr);
2513 _cms_gamutcolor.set_rgba( tmpColor );
2515 _page_cms.add_line(
true, _(
"Out of gamut warning color:"), _cms_gamutcolor,
"",
2516 _(
"Selects the color used for out of gamut warning"),
false);
2518 _page_cms.add_line(
true, _(
"Device profile:"), _cms_proof_profile,
"",
2519 _(
"The ICC profile to use to simulate device output"),
false);
2521 _cms_proof_intent.init(
"/options/softproof/intent", intentLabels, intentValues, 0);
2522 _page_cms.add_line(
true, _(
"Device rendering intent:"), _cms_proof_intent,
"",
2523 _(
"The rendering intent to use to calibrate device output"),
false);
2525 _cms_proof_blackpoint.init( _(
"Black point compensation"),
"/options/softproof/bpc",
false);
2526 _page_cms.add_line(
true,
"", _cms_proof_blackpoint,
"",
2527 _(
"Enables black point compensation"),
false);
2533 _cms_display_profile.append(_(
"<none>"));
2535 for (
auto profile : cms_system.getDisplayProfiles()) {
2536 _cms_display_profile.append(profile->getName());
2537 if (profile->getPath() ==
current) {
2538 _cms_display_profile.set_active(
index);
2543 _cms_display_profile.set_active(0);
2548 for (
auto profile : cms_system.getOutputProfiles()) {
2549 _cms_proof_profile.append(profile->getName());
2550 if (profile->getPath() ==
current) {
2551 _cms_proof_profile.set_active(
index);
2557 _cms_gamutcolor.signal_color_set().connect(sigc::bind(&
gamutColorChanged, &_cms_gamutcolor));
2559 _cms_display_profile.signal_changed().connect(sigc::bind(&
profileComboChanged, &_cms_display_profile));
2560 _cms_proof_profile.signal_changed().connect(sigc::bind(&
proofComboChanged, &_cms_proof_profile));
2565 _save_autosave_enable.init( _(
"Enable autosave"),
"/options/autosave/enable",
true);
2566 _page_autosave.add_line(
false,
"", _save_autosave_enable,
"", _(
"Automatically save the current document(s) at a given interval, thus minimizing loss in case of a crash"),
false);
2567 if (prefs->
getString(
"/options/autosave/path").empty()) {
2569 prefs->
setString(
"/options/autosave/path", Glib::build_filename(Glib::get_user_cache_dir(),
"inkscape"));
2572 _save_autosave_path_dir.init(prefs->
getString(
"/options/autosave/path"),
"/options/autosave/path",
2573 Glib::build_filename(Glib::get_user_cache_dir(),
"inkscape"));
2574 _page_autosave.add_line(
false, C_(
"Filesystem",
"Autosave _directory:"), _save_autosave_path_dir,
"",
2575 _(
"The directory where autosaves will be written. This should be an absolute path (starts "
2576 "with / on UNIX or a drive letter such as C: on Windows)."),
2579 _save_autosave_interval.init(
"/options/autosave/interval", 1.0, 10800.0, 1.0, 10.0, 10.0,
true,
false);
2580 _page_autosave.add_line(
false, _(
"_Interval (in minutes):"), _save_autosave_interval,
"", _(
"Interval (in minutes) at which document will be autosaved"),
false);
2581 _save_autosave_max.init(
"/options/autosave/max", 1.0, 10000.0, 1.0, 10.0, 10.0,
true,
false);
2582 _page_autosave.add_line(
false, _(
"_Maximum number of autosaves:"), _save_autosave_max,
"", _(
"Maximum number of autosaved files; use this to limit the storage space used"),
false);
2592 _page_notfound.add_group_header(_(
"No matches were found, try another search!"));
2595void InkscapePreferences::initPageBehavior()
2597 Gtk::TreeModel::iterator iter_behavior = this->AddPage(_page_behavior, _(
"Behavior"),
PREFS_PAGE_BEHAVIOR);
2599 _misc_simpl.init(
"/options/simplifythreshold/value", 0.0001, 1.0, 0.0001, 0.0010, 0.0010,
false,
false);
2600 _page_behavior.add_line(
false, _(
"_Simplification threshold:"), _misc_simpl,
"",
2601 _(
"How strong is the Node tool's Simplify command by default. If you invoke this command several times in quick succession, it will act more and more aggressively; invoking it again after a pause restores the default threshold."),
false);
2603 _undo_limit.init(
"",
"/options/undo/limit",
true);
2604 _page_behavior.add_line(
false, _(
"Limit Undo Size:"), _undo_limit,
"",
2605 _(
"Enable the undo limit and remove old changes. Disabling this option will use more memory."));
2606 _undo_size.init(
"/options/undo/size", 1.0, 32000.0, 1.0, 1.0, 200.0,
true,
false);
2607 _page_behavior.add_line(
false, _(
"Maximum _Undo Size:"), _undo_size,
"",
2608 _(
"How large the undo log will be allowed to get before being trimmed to free memory."),
false );
2609 _undo_limit.changed_signal.connect(sigc::mem_fun(_undo_size, &Gtk::Widget::set_sensitive));
2610 _undo_size.set_sensitive(_undo_limit.get_active());
2612 _markers_color_stock.init ( _(
"Color stock markers the same color as object"),
"/options/markers/colorStockMarkers",
true);
2613 _markers_color_custom.init ( _(
"Color custom markers the same color as object"),
"/options/markers/colorCustomMarkers",
false);
2614 _markers_color_update.init ( _(
"Update marker color when object color changes"),
"/options/markers/colorUpdateMarkers",
true);
2617 _sel_all.init ( _(
"Select in all layers"),
"/options/kbselection/inlayer",
PREFS_SELECTION_ALL,
false,
nullptr);
2618 _sel_current.init ( _(
"Select only within current layer"),
"/options/kbselection/inlayer",
PREFS_SELECTION_LAYER,
true, &_sel_all);
2620 _sel_hidden.init ( _(
"Ignore hidden objects and layers"),
"/options/kbselection/onlyvisible",
true);
2621 _sel_locked.init ( _(
"Ignore locked objects and layers"),
"/options/kbselection/onlysensitive",
true);
2622 _sel_inlayer_same.init ( _(
"Select same behaves like select all"),
"/options/selection/samelikeall",
false);
2624 _sel_layer_deselects.init ( _(
"Deselect upon layer change"),
"/options/selection/layerdeselect",
true);
2626 _sel_touch_topmost_only.init ( _(
"Select the topmost items only when in touch selection mode"),
"/options/selection/touchsel_topmost_only",
true);
2627 _sel_zero_opacity.init(_(
"Select transparent objects, strokes, and fills"),
"/options/selection/zeroopacity",
false);
2629 _page_select.add_line(
false,
"", _sel_layer_deselects,
"",
2630 _(
"Uncheck this to be able to keep the current objects selected when the current layer changes"));
2631 _page_select.add_line(
2632 false,
"", _sel_zero_opacity,
"",
2633 _(
"Check to make objects, strokes, and fills which are completely transparent selectable even if not in outline mode"));
2635 _page_select.add_line(
false,
"", _sel_touch_topmost_only,
"",
2636 _(
"In touch selection mode, if multiple items overlap at a point, select only the topmost item"));
2638 _page_select.add_group_header( _(
"Ctrl+A, Tab, Shift+Tab"));
2639 _page_select.add_line(
true,
"", _sel_all,
"",
2640 _(
"Make keyboard selection commands work on objects in all layers"));
2641 _page_select.add_line(
true,
"", _sel_current,
"",
2642 _(
"Make keyboard selection commands work on objects in current layer only"));
2643 _page_select.add_line(
true,
"", _sel_recursive,
"",
2644 _(
"Make keyboard selection commands work on objects in current layer and all its sublayers"));
2645 _page_select.add_line(
true,
"", _sel_hidden,
"",
2646 _(
"Uncheck this to be able to select objects that are hidden (either by themselves or by being in a hidden layer)"));
2647 _page_select.add_line(
true,
"", _sel_locked,
"",
2648 _(
"Uncheck this to be able to select objects that are locked (either by themselves or by being in a locked layer)"));
2649 _page_select.add_line(
true,
"", _sel_inlayer_same,
"",
2650 _(
"Check this to make the 'select same' functions work like the select all functions, restricting to current layer only."));
2652 _sel_cycle.init ( _(
"Wrap when cycling objects in z-order"),
"/options/selection/cycleWrap",
true);
2654 _page_select.add_group_header( _(
"Alt+Scroll Wheel"));
2655 _page_select.add_line(
true,
"", _sel_cycle,
"",
2656 _(
"Wrap around at start and end when cycling objects in z-order"));
2658 auto const paste_above_selected = Gtk::make_managed<UI::Widget::PrefCheckButton>();
2659 paste_above_selected->init(_(
"Paste above selection instead of layer-top"),
"/options/paste/aboveselected",
true);
2660 _page_select.add_line(
false,
"", *paste_above_selected,
"",
2661 _(
"If checked, pasted items and imported documents will be placed immediately above the "
2662 "current selection (z-order). Otherwise, insertion happens on top of all objects in the current layer."));
2667 _trans_scale_stroke.init ( _(
"Scale stroke width"),
"/options/transform/stroke",
true);
2668 _trans_scale_corner.init ( _(
"Scale rounded corners in rectangles"),
"/options/transform/rectcorners",
false);
2669 _trans_gradient.init ( _(
"Transform gradients"),
"/options/transform/gradient",
true);
2670 _trans_pattern.init ( _(
"Transform patterns"),
"/options/transform/pattern",
false);
2671 _trans_dash_scale.init(_(
"Scale dashes with stroke"),
"/options/dash/scale",
true);
2672 _trans_optimized.init ( _(
"Optimized"),
"/options/preservetransform/value", 0,
true,
nullptr);
2673 _trans_preserved.init ( _(
"Preserved"),
"/options/preservetransform/value", 1,
false, &_trans_optimized);
2675 _page_transforms.add_line(
false,
"", _trans_scale_stroke,
"",
2676 _(
"When scaling objects, scale the stroke width by the same proportion"));
2677 _page_transforms.add_line(
false,
"", _trans_scale_corner,
"",
2678 _(
"When scaling rectangles, scale the radii of rounded corners"));
2679 _page_transforms.add_line(
false,
"", _trans_gradient,
"",
2680 _(
"Move gradients (in fill or stroke) along with the objects"));
2681 _page_transforms.add_line(
false,
"", _trans_pattern,
"",
2682 _(
"Move patterns (in fill or stroke) along with the objects"));
2683 _page_transforms.add_line(
false,
"", _trans_dash_scale,
"", _(
"When changing stroke width, scale dash array"));
2684 _page_transforms.add_group_header( _(
"Store transformation"));
2685 _page_transforms.add_line(
true,
"", _trans_optimized,
"",
2686 _(
"If possible, apply transformation to objects without adding a transform= attribute"));
2687 _page_transforms.add_line(
true,
"", _trans_preserved,
"",
2688 _(
"Always store transformation as a transform= attribute on objects"));
2693 _scroll_wheel.init (
"/options/wheelscroll/value", 0.0, 1000.0, 1.0, 1.0, 40.0,
true,
false);
2694 _page_scrolling.add_line(
false, _(
"Mouse _wheel scrolls by:"), _scroll_wheel, _(
"pixels"),
2695 _(
"One mouse wheel notch scrolls by this distance in screen pixels (horizontally with Shift)"),
false);
2696 _page_scrolling.add_group_header( _(
"Ctrl+arrows"));
2697 _scroll_arrow_px.init (
"/options/keyscroll/value", 0.0, 1000.0, 1.0, 1.0, 10.0,
true,
false);
2698 _page_scrolling.add_line(
true, _(
"Sc_roll by:"), _scroll_arrow_px, _(
"pixels"),
2699 _(
"Pressing Ctrl+arrow key scrolls by this distance (in screen pixels)"),
false);
2700 _scroll_arrow_acc.init (
"/options/scrollingacceleration/value", 0.0, 5.0, 0.01, 1.0, 0.35,
false,
false);
2701 _page_scrolling.add_line(
true, _(
"_Acceleration:"), _scroll_arrow_acc,
"",
2702 _(
"Pressing and holding Ctrl+arrow will gradually speed up scrolling (0 for no acceleration)"),
false);
2703 _page_scrolling.add_group_header( _(
"Autoscrolling"));
2704 _scroll_auto_speed.init (
"/options/autoscrollspeed/value", 0.0, 5.0, 0.01, 1.0, 0.7,
false,
false);
2705 _page_scrolling.add_line(
true, _(
"_Speed:"), _scroll_auto_speed,
"",
2706 _(
"How fast the canvas autoscrolls when you drag beyond canvas edge (0 to turn autoscroll off)"),
false);
2707 _scroll_auto_thres.init (
"/options/autoscrolldistance/value", -600.0, 600.0, 1.0, 1.0, -10.0,
true,
false);
2708 _page_scrolling.add_line(
true, _(
"_Threshold:"), _scroll_auto_thres, _(
"pixels"),
2709 _(
"How far (in screen pixels) you need to be from the canvas edge to trigger autoscroll; positive is outside the canvas, negative is within the canvas"),
false);
2710 _scroll_space.init ( _(
"Mouse move pans when Space is pressed"),
"/options/spacebarpans/value",
true);
2711 _page_scrolling.add_line(
true,
"", _scroll_space,
"",
2712 _(
"When on, pressing and holding Space and dragging pans canvas"));
2716 _page_snapping.add_group_header( _(
"Snap indicator"));
2718 _snap_indicator.init( _(
"Enable snap indicator"),
"/options/snapindicator/value",
true);
2719 _page_snapping.add_line(
true,
"", _snap_indicator,
"",
2720 _(
"After snapping, a symbol is drawn at the point that has snapped"));
2721 _snap_indicator.changed_signal.connect( sigc::mem_fun(_snap_persistence, &Gtk::Widget::set_sensitive) );
2723 _snap_indicator_distance.init( _(
"Show snap distance in case of alignment or distribution snap"),
"/options/snapindicatordistance/value",
false);
2724 _page_snapping.add_line(
true,
"", _snap_indicator_distance,
"",
2725 _(
"Show snap distance in case of alignment or distribution snap"));
2727 _snap_persistence.init(
"/options/snapindicatorpersistence/value", 0.1, 10, 0.1, 1, 2, 1);
2728 _page_snapping.add_line(
true, _(
"Snap indicator persistence (in seconds):"), _snap_persistence,
"",
2729 _(
"Controls how long the snap indicator message will be shown, before it disappears"),
true);
2732 _page_snapping.add_group_header( _(
"What should snap"));
2734 _snap_closest_only.init( _(
"Only snap the node closest to the pointer"),
"/options/snapclosestonly/value",
false);
2735 _page_snapping.add_line(
true,
"", _snap_closest_only,
"",
2736 _(
"Only try to snap the node that is initially closest to the mouse pointer"));
2738 _snap_mouse_pointer.init( _(
"Snap the mouse pointer when dragging a constrained knot"),
"/options/snapmousepointer/value",
false);
2739 _page_snapping.add_line(
true,
"", _snap_mouse_pointer,
"",
2740 _(
"When dragging a knot along a constraint line, then snap the position of the mouse pointer instead of snapping the projection of the knot onto the constraint line"));
2742 _snap_weight.init(
"/options/snapweight/value", 0, 1, 0.1, 0.2, 0.5, 1);
2743 _page_snapping.add_line(
true, _(
"_Weight factor:"), _snap_weight,
"",
2744 _(
"When multiple snap solutions are found, then Inkscape can either prefer the closest transformation (when set to 0), or prefer the node that was initially the closest to the pointer (when set to 1)"),
true);
2746 _page_snapping.add_group_header( _(
"Delayed snap"));
2748 _snap_delay.init(
"/options/snapdelay/value", 0, 1, 0.1, 0.2, 0, 1);
2749 _page_snapping.add_line(
true, _(
"Delay (in seconds):"), _snap_delay,
"",
2750 _(
"Postpone snapping as long as the mouse is moving, and then wait an additional fraction of a second. This additional delay is specified here. When set to zero or to a very small number, snapping will be immediate."),
true);
2752 _page_snapping.add_group_header( _(
"Restrict Snap Targets"));
2754 _snap_always_grid.init(_(
"Always snap to grids"),
"/options/snap/grid/always",
false);
2755 _page_snapping.add_line(
true,
"", _snap_always_grid,
"", _(
"When a grid is visible, and snapping to grids is active, other snap targets will be ignored, unless explicitly allowed below."));
2757 _snap_always_guide.init(_(
"Always snap to guides"),
"/options/snap/guide/always",
false);
2758 _page_snapping.add_line(
true,
"", _snap_always_guide,
"", _(
"When there are any guidelines in the current viewport, and snapping to guides is active, other snap targets will be ignored, unless explicitly allowed below."));
2760 _page_snapping.add_group_header( _(
"While Always Snapping to Grid/Guides"));
2762 _snap_always_object.init(_(
"Allow snapping to objects"),
"/options/snap/object/always",
false);
2763 _page_snapping.add_line(
true,
"", _snap_always_object,
"", _(
"Allow snapping to objects while 'Always snap to grids / guides' is active, if an object is closer."));
2765 _snap_always_align.init(_(
"Allow alignment snapping"),
"/options/snap/alignment/always",
false);
2766 _page_snapping.add_line(
true,
"", _snap_always_align,
"", _(
"Allow alignment snapping while 'Always snap to grids / guides' is active, if an alignment snap target is closer."));
2768 _snap_always_dist.init(_(
"Allow distribution snapping"),
"/options/snap/distribution/always",
false);
2769 _page_snapping.add_line(
true,
"", _snap_always_dist,
"", _(
"Allow distribution snapping while 'Always snap to grids / guides' is active, if a distribution snap target is closer."));
2776 _steps_arrow.init (
"/options/nudgedistance/value", 0.0, 1000.0, 0.01, 2.0, UNIT_TYPE_LINEAR,
"px");
2777 _page_steps.add_line(
false, _(
"_Arrow keys move by:"), _steps_arrow,
"",
2778 _(
"Pressing an arrow key moves selected object(s) or node(s) by this distance"),
false);
2781 _steps_scale.init (
"/options/defaultscale/value", 0.0, 1000.0, 0.01, 2.0, UNIT_TYPE_LINEAR,
"px");
2782 _page_steps.add_line(
false, _(
"> and < _scale by:"), _steps_scale,
"",
2783 _(
"Pressing > or < scales selection up or down by this increment"),
false);
2785 _steps_inset.init (
"/options/defaultoffsetwidth/value", 0.0, 3000.0, 0.01, 2.0, UNIT_TYPE_LINEAR,
"px");
2786 _page_steps.add_line(
false, _(
"_Inset/Outset by:"), _steps_inset,
"",
2787 _(
"Inset and Outset commands displace the path by this distance"),
false);
2789 _steps_compass.init ( _(
"Compass-like display of angles"),
"/options/compassangledisplay/value",
true);
2790 _page_steps.add_line(
false,
"", _steps_compass,
"",
2791 _(
"When on, angles are displayed with 0 at north, 0 to 360 range, positive clockwise; otherwise with 0 at east, -180 to 180 range, positive counterclockwise"));
2794 Glib::ustring
const labels[] = {
"90",
"60",
"45",
"36",
"30",
"22.5",
"18",
"15",
"12",
"10",
2795 "7.5",
"6",
"5",
"3",
"2",
"1",
"0.5", C_(
"Rotation angle",
"None")};
2796 int const values[] = {2, 3, 4, 5, 6, 8, 10, 12, 15, 18, 24, 30, 36, 60, 90, 180, 360, 0};
2797 _steps_rot_snap.init(
"/options/rotationsnapsperpi/value", labels, values, 12);
2799 _steps_rot_snap.set_size_request(_sb_width);
2800 _page_steps.add_line(
false, _(
"_Rotation snaps every:"), _steps_rot_snap, _(
"degrees"),
2801 _(
"Rotating with Ctrl pressed snaps every that much degrees; also, pressing [ or ] rotates by this amount"),
false);
2803 _steps_rot_relative.init ( _(
"Relative snapping of guideline angles"),
"/options/relativeguiderotationsnap/value",
false);
2804 _page_steps.add_line(
false,
"", _steps_rot_relative,
"",
2805 _(
"When on, the snap angles when rotating a guideline will be relative to the original angle"));
2807 _steps_zoom.init (
"/options/zoomincrement/value", 101.0, 500.0, 1.0, 1.0, M_SQRT2,
true,
true);
2808 _page_steps.add_line(
false, _(
"_Zoom in/out by:"), _steps_zoom, _(
"%"),
2809 _(
"Zoom tool click, +/- keys, and middle click zoom in and out by this multiplier"),
false);
2811 _middle_mouse_zoom.init ( _(
"Zoom with middle mouse click"),
"/options/middlemousezoom/value",
true);
2812 _page_steps.add_line(
true,
"", _middle_mouse_zoom,
"",
2813 _(
"When activated, clicking the middle mouse button (usually the mouse wheel) zooms."));
2815 _page_steps.add_group_header( _(
"Canvas rotation"));
2817 _steps_rotate.init (
"/options/rotateincrement/value", 1, 90, 1.0, 5.0, 15,
false,
false);
2818 _page_steps.add_line(
false, _(
"_Rotate canvas by:"), _steps_rotate, _(
"degrees"),
2819 _(
"Rotate canvas clockwise and counter-clockwise by this amount."),
false);
2821 _move_rotated.init ( _(
"Arrow keys move object relative to screen"),
"/options/moverotated/value",
true);
2822 _page_steps.add_line(
false,
"", _move_rotated,
"",
2823 _(
"When on, arrow keys move objects relative to screen. When the canvas is rotated, the selection will then still be moved horizontally and vertically relative to the screen, not to the rotated document."));
2828 _clone_option_parallel.init ( _(
"Move in parallel"),
"/options/clonecompensation/value",
2830 _clone_option_stay.init ( _(
"Stay unmoved"),
"/options/clonecompensation/value",
2832 _clone_option_transform.init ( _(
"Move according to transform"),
"/options/clonecompensation/value",
2834 _clone_option_unlink.init ( _(
"Are unlinked"),
"/options/cloneorphans/value",
2836 _clone_option_delete.init ( _(
"Are deleted"),
"/options/cloneorphans/value",
2838 _clone_option_keep.init ( _(
"Become orphans"),
"/options/cloneorphans/value",
2841 _page_clones.add_group_header( _(
"Moving original: clones and linked offsets"));
2842 _page_clones.add_line(
true,
"", _clone_option_parallel,
"",
2843 _(
"Clones are translated by the same vector as their original"));
2844 _page_clones.add_line(
true,
"", _clone_option_stay,
"",
2845 _(
"Clones preserve their positions when their original is moved"));
2846 _page_clones.add_line(
true,
"", _clone_option_transform,
"",
2847 _(
"Each clone moves according to the value of its transform= attribute; for example, a rotated clone will move in a different direction than its original"));
2848 _page_clones.add_group_header( _(
"Deleting original: clones"));
2849 _page_clones.add_line(
true,
"", _clone_option_unlink,
"",
2850 _(
"Orphaned clones are converted to regular objects"));
2851 _page_clones.add_line(
true,
"", _clone_option_delete,
"",
2852 _(
"Orphaned clones are deleted along with their original"));
2853 _page_clones.add_line(
true,
"", _clone_option_keep,
"",
2854 _(
"Orphaned clones are not modified"));
2856 _page_clones.add_group_header( _(
"Duplicating original+clones/linked offset"));
2858 _clone_relink_on_duplicate.init ( _(
"Relink duplicated clones"),
"/options/relinkclonesonduplicate/value",
false);
2859 _page_clones.add_line(
true,
"", _clone_relink_on_duplicate,
"",
2860 _(
"When duplicating a selection containing both a clone and its original (possibly in groups), relink the duplicated clone to the duplicated original instead of the old original"));
2862 _page_clones.add_group_header( _(
"Unlinking clones"));
2863 _clone_to_curves.init ( _(
"Path operations unlink clones"),
"/options/pathoperationsunlink/value",
true);
2864 _page_clones.add_line(
true,
"", _clone_to_curves,
"",
2865 _(
"The following path operations will unlink clones: Stroke to path, Object to path, Boolean operations, Combine, Break apart"));
2866 _clone_ignore_to_curves.init ( _(
"'Object to Path' only unlinks (keeps LPEs, shapes)"),
"/options/clonestocurvesjustunlink/value",
true);
2867 _page_clones.add_line(
true,
"", _clone_ignore_to_curves,
"",
2868 _(
"'Object to path' only unlinks clones when they are converted to paths, but preserves any LPEs and shapes within the clones."));
2873 _mask_mask_on_top.init ( _(
"When applying, use the topmost selected object as clippath/mask"),
"/options/maskobject/topmost",
true);
2874 _page_mask.add_line(
false,
"", _mask_mask_on_top,
"",
2875 _(
"Uncheck this to use the bottom selected object as the clipping path or mask"));
2876 _mask_mask_on_ungroup.init ( _(
"When ungrouping, clips/masks are preserved in children"),
"/options/maskobject/maskonungroup",
true);
2877 _page_mask.add_line(
false,
"", _mask_mask_on_ungroup,
"",
2878 _(
"Uncheck this to remove clip/mask on ungroup"));
2879 _mask_mask_remove.init ( _(
"Remove clippath/mask object after applying"),
"/options/maskobject/remove",
true);
2880 _page_mask.add_line(
false,
"", _mask_mask_remove,
"",
2881 _(
"After applying, remove the object used as the clipping path or mask from the drawing"));
2883 _page_mask.add_group_header( _(
"Before applying"));
2885 _mask_grouping_none.init( _(
"Do not group clipped/masked objects"),
"/options/maskobject/grouping",
PREFS_MASKOBJECT_GROUPING_NONE,
true,
nullptr);
2886 _mask_grouping_separate.init( _(
"Put every clipped/masked object in its own group"),
"/options/maskobject/grouping",
PREFS_MASKOBJECT_GROUPING_SEPARATE,
false, &_mask_grouping_none);
2887 _mask_grouping_all.init( _(
"Put all clipped/masked objects into one group"),
"/options/maskobject/grouping",
PREFS_MASKOBJECT_GROUPING_ALL,
false, &_mask_grouping_none);
2889 _page_mask.add_line(
true,
"", _mask_grouping_none,
"",
2890 _(
"Apply clippath/mask to every object"));
2892 _page_mask.add_line(
true,
"", _mask_grouping_separate,
"",
2893 _(
"Apply clippath/mask to groups containing single object"));
2895 _page_mask.add_line(
true,
"", _mask_grouping_all,
"",
2896 _(
"Apply clippath/mask to group containing all objects"));
2898 _page_mask.add_group_header( _(
"After releasing"));
2900 _mask_ungrouping.init ( _(
"Ungroup automatically created groups"),
"/options/maskobject/ungrouping",
true);
2901 _page_mask.add_line(
true,
"", _mask_ungrouping,
"",
2902 _(
"Ungroup groups created when setting clip/mask"));
2907 _page_markers.add_group_header( _(
"Stroke Style Markers"));
2908 _page_markers.add_line(
true,
"", _markers_color_stock,
"",
2909 _(
"Stroke color same as object, fill color either object fill color or marker fill color"));
2910 _page_markers.add_line(
true,
"", _markers_color_custom,
"",
2911 _(
"Stroke color same as object, fill color either object fill color or marker fill color"));
2912 _page_markers.add_line(
true,
"", _markers_color_update,
"",
2913 _(
"Update marker color when object color changes"));
2918 _clipboard_style_computed.init(_(
"Copy computed style"),
"/options/copycomputedstyle/value", 1,
true,
nullptr);
2919 _clipboard_style_verbatim.init(_(
"Copy class and style attributes verbatim"),
"/options/copycomputedstyle/value", 0,
2920 false, &_clipboard_style_computed);
2922 _page_clipboard.add_group_header(_(
"Copying objects to the clipboard"));
2923 _page_clipboard.add_line(
true,
"", _clipboard_style_computed,
"",
2924 _(
"The object's 'style' attribute will be set to the computed style, "
2925 "preserving the object's appearance as in previous Inkscape versions"));
2926 _page_clipboard.add_line(
2927 true,
"", _clipboard_style_verbatim,
"",
2928 _(
"The object's 'style' and 'class' values will be copied verbatim, and will replace those of the target object when using 'Paste style'"));
2933 _page_cleanup.add_group_header( _(
"Document cleanup"));
2934 _cleanup_swatches.init ( _(
"Remove unused swatches when doing a document cleanup"),
"/options/cleanupswatches/value",
false);
2935 _page_cleanup.add_line(
true,
"", _cleanup_swatches,
"",
2936 _(
"Remove unused swatches when doing a document cleanup"));
2938 _page_lpe.add_group_header( _(
"General"));
2939 _lpe_show_experimental.init ( _(
"Show experimental effects"),
"/dialogs/livepatheffect/showexperimental",
false);
2940 _page_lpe.add_line(
true,
"", _lpe_show_experimental,
"",
2941 _(
"Show experimental effects"));
2942 _page_lpe.add_group_header( _(
"Tiling"));
2943 _lpe_copy_mirroricons.init ( _(
"Add advanced tiling options"),
"/live_effects/copy/mirroricons",
true);
2944 _page_lpe.add_line(
true,
"", _lpe_copy_mirroricons,
"",
2945 _(
"Enables using 16 advanced mirror options between the copies (so there can be copies that are mirrored differently between the rows and the columns) for Tiling LPE"));
2949void InkscapePreferences::initPageRendering()
2952 _filter_multi_threaded.init(
"/options/threading/numthreads", 0.0, 32.0, 1.0, 2.0, 0.0,
true,
false);
2953 _page_rendering.add_line(
false, _(
"Number of _Threads:"), _filter_multi_threaded,
"", _(
"Configure number of threads to use when rendering. The default value of zero means choose automatically."),
false);
2956 _rendering_cache_size.init(
"/options/renderingcache/size", 0.0, 4096.0, 1.0, 32.0, 64.0,
true,
false);
2957 _page_rendering.add_line(
false, _(
"Rendering _cache size:"), _rendering_cache_size, C_(
"mebibyte (2^20 bytes) abbreviation",
"MiB"), _(
"Set the amount of memory per document which can be used to store rendered parts of the drawing for later reuse; set to zero to disable caching"),
false);
2960 _rendering_xray_radius.init(
"/options/rendering/xray-radius", 1.0, 1500.0, 1.0, 100.0, 100.0,
true,
false);
2961 _page_rendering.add_line(
false, _(
"X-ray radius:"), _rendering_xray_radius,
"", _(
"Radius of the circular area around the mouse cursor in X-ray mode"),
false);
2964 _rendering_outline_overlay_opacity.init(
"/options/rendering/outline-overlay-opacity", 0.0, 100.0, 1.0, 5.0, 50.0,
true,
false);
2965 _page_rendering.add_line(
false, _(
"Outline overlay opacity:"), _rendering_outline_overlay_opacity, _(
"%"), _(
"Opacity of the overlay in outline overlay view mode"),
false);
2969 constexpr int values[] = { 1, 2, 3 };
2970 Glib::ustring
const labels[] = { _(
"Responsive"), _(
"Full redraw"), _(
"Multiscale") };
2971 _canvas_update_strategy.init(
"/options/rendering/update_strategy", labels, values, 3);
2972 _page_rendering.add_line(
false, _(
"Update strategy:"), _canvas_update_strategy,
"", _(
"How to update continually changing content when it can't be redrawn fast enough"),
false);
2976 _canvas_request_opengl.init(_(
"Enable OpenGL"),
"/options/rendering/request_opengl",
false);
2977 _page_rendering.add_line(
false,
"", _canvas_request_opengl,
"", _(
"Request that the canvas should be painted with OpenGL rather than Cairo. If OpenGL is unsupported, it will fall back to Cairo."),
false);
2980 _blur_quality_best.init ( _(
"Best quality (slowest)"),
"/options/blurquality/value",
2982 _blur_quality_better.init ( _(
"Better quality (slower)"),
"/options/blurquality/value",
2984 _blur_quality_normal.init ( _(
"Average quality"),
"/options/blurquality/value",
2986 _blur_quality_worse.init ( _(
"Lower quality (faster)"),
"/options/blurquality/value",
2988 _blur_quality_worst.init ( _(
"Lowest quality (fastest)"),
"/options/blurquality/value",
2991 _page_rendering.add_group_header( _(
"Gaussian blur quality for display"));
2992 _page_rendering.add_line(
true,
"", _blur_quality_best,
"",
2993 _(
"Best quality, but display may be very slow at high zooms (bitmap export always uses best quality)"));
2994 _page_rendering.add_line(
true,
"", _blur_quality_better,
"",
2995 _(
"Better quality, but slower display"));
2996 _page_rendering.add_line(
true,
"", _blur_quality_normal,
"",
2997 _(
"Average quality, acceptable display speed"));
2998 _page_rendering.add_line(
true,
"", _blur_quality_worse,
"",
2999 _(
"Lower quality (some artifacts), but display is faster"));
3000 _page_rendering.add_line(
true,
"", _blur_quality_worst,
"",
3001 _(
"Lowest quality (considerable artifacts), but display is fastest"));
3004 _filter_quality_best.init ( _(
"Best quality (slowest)"),
"/options/filterquality/value",
3006 _filter_quality_better.init ( _(
"Better quality (slower)"),
"/options/filterquality/value",
3008 _filter_quality_normal.init ( _(
"Average quality"),
"/options/filterquality/value",
3010 _filter_quality_worse.init ( _(
"Lower quality (faster)"),
"/options/filterquality/value",
3012 _filter_quality_worst.init ( _(
"Lowest quality (fastest)"),
"/options/filterquality/value",
3015 _page_rendering.add_group_header( _(
"Filter effects quality for display"));
3016 _page_rendering.add_line(
true,
"", _filter_quality_best,
"",
3017 _(
"Best quality, but display may be very slow at high zooms (bitmap export always uses best quality)"));
3018 _page_rendering.add_line(
true,
"", _filter_quality_better,
"",
3019 _(
"Better quality, but slower display"));
3020 _page_rendering.add_line(
true,
"", _filter_quality_normal,
"",
3021 _(
"Average quality, acceptable display speed"));
3022 _page_rendering.add_line(
true,
"", _filter_quality_worse,
"",
3023 _(
"Lower quality (some artifacts), but display is faster"));
3024 _page_rendering.add_line(
true,
"", _filter_quality_worst,
"",
3025 _(
"Lowest quality (considerable artifacts), but display is fastest"));
3027#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 18, 0)
3028 _cairo_dithering.init(_(
"Use dithering"),
"/options/dithering/value",
true);
3029 _page_rendering.add_line(
false,
"", _cairo_dithering,
"", _(
"Makes gradients smoother. This can significantly impact the size of generated PNG files."));
3032 auto const grid = Gtk::make_managed<Gtk::Grid>();
3033 grid->set_margin(12);
3034 grid->set_orientation(Gtk::Orientation::VERTICAL);
3035 grid->set_column_spacing(12);
3036 grid->set_row_spacing(6);
3038 auto const revealer = Gtk::make_managed<Gtk::Revealer>();
3039 revealer->set_child(*grid);
3042 _canvas_developer_mode_enabled.init(_(
"Enable developer mode"),
"/options/rendering/devmode",
false);
3043 _canvas_developer_mode_enabled.signal_toggled().connect([revealer,
this] { revealer->set_reveal_child(_canvas_developer_mode_enabled.get_active()); });
3045 _page_rendering.add_group_header(_(
"Developer mode"));
3046 _page_rendering.add_line(
true,
"", _canvas_developer_mode_enabled,
"", _(
"Enable additional debugging options"),
false);
3047 _page_rendering.attach_next_to(*revealer, Gtk::PositionType::BOTTOM);
3049 auto add_devmode_line = [&] (Glib::ustring
const &
label, Gtk::Widget &widget, Glib::ustring
const &suffix, Glib::ustring
const &tip) {
3050 widget.set_tooltip_text(tip);
3052 auto const hb = Gtk::make_managed<Gtk::Box>();
3053 hb->set_spacing(12);
3054 hb->set_hexpand(
true);
3056 hb->set_valign(Gtk::Align::CENTER);
3058 auto const label_widget = Gtk::make_managed<Gtk::Label>(
label, Gtk::Align::START, Gtk::Align::CENTER,
true);
3059 label_widget->set_mnemonic_widget(widget);
3060 label_widget->set_markup(label_widget->get_text());
3061 label_widget->set_margin_start(12);
3063 label_widget->set_valign(Gtk::Align::CENTER);
3064 grid->attach_next_to(*label_widget, Gtk::PositionType::BOTTOM);
3065 grid->attach_next_to(*hb, *label_widget, Gtk::PositionType::RIGHT, 1, 1);
3067 if (!suffix.empty()) {
3068 auto const suffix_widget = Gtk::make_managed<Gtk::Label>(suffix, Gtk::Align::START, Gtk::Align::CENTER,
true);
3069 suffix_widget->set_markup(suffix_widget->get_text());
3074 auto add_devmode_group_header = [&] (Glib::ustring
const &
name) {
3075 auto const label_widget = Gtk::make_managed<Gtk::Label>(Glib::ustring(
"<b>") +
name + Glib::ustring(
"</b>") , Gtk::Align::START , Gtk::Align::CENTER,
true);
3076 label_widget->set_use_markup(
true);
3077 label_widget->set_valign(Gtk::Align::CENTER);
3078 grid->attach_next_to(*label_widget, Gtk::PositionType::BOTTOM);
3083 add_devmode_group_header(_(
"Low-level tuning options"));
3084 _canvas_tile_size.init(
"/options/rendering/tile_size", 1.0, 10000.0, 1.0, 0.0, 300.0,
true,
false);
3085 add_devmode_line(_(
"Tile size"), _canvas_tile_size,
"", _(
"Halve rendering tile rectangles until their largest dimension is this small"));
3086 _canvas_render_time_limit.init(
"/options/rendering/render_time_limit", 1.0, 5000.0, 1.0, 0.0, 80.0,
true,
false);
3087 add_devmode_line(_(
"Render time limit"), _canvas_render_time_limit, C_(
"millisecond abbreviation",
"ms"), _(
"The maximum time allowed for a rendering time slice"));
3089 constexpr int values[] = { 1, 2, 3, 4 };
3090 Glib::ustring
const labels[] = { _(
"Auto"), _(
"Persistent"), _(
"Asynchronous"), _(
"Synchronous") };
3091 _canvas_pixelstreamer_method.init(
"/options/rendering/pixelstreamer_method", labels, values, 1);
3092 add_devmode_line(_(
"Pixel streaming method"), _canvas_pixelstreamer_method,
"", _(
"Change the method used for streaming pixel data to the GPU. The default is Auto, which picks the best method available at runtime. As for the other options, higher up is better."));
3094 _canvas_padding.init(
"/options/rendering/padding", 0.0, 1000.0, 1.0, 0.0, 350.0,
true,
false);
3095 add_devmode_line(_(
"Buffer padding"), _canvas_padding, C_(
"pixel abbreviation",
"px"), _(
"Use buffers bigger than the window by this amount"));
3096 _canvas_prerender.init(
"/options/rendering/prerender", 0.0, 1000.0, 1.0, 0.0, 100.0,
true,
false);
3097 add_devmode_line(_(
"Prerender margin"), _canvas_prerender,
"", _(
"Pre-render a margin around the visible region."));
3098 _canvas_preempt.init(
"/options/rendering/preempt", 0.0, 1000.0, 1.0, 0.0, 250.0,
true,
false);
3099 add_devmode_line(_(
"Preempt size"), _canvas_preempt,
"", _(
"Prevent thin tiles at the rendering edge by making them at least this size."));
3100 _canvas_coarsener_min_size.init(
"/options/rendering/coarsener_min_size", 0.0, 1000.0, 1.0, 0.0, 200.0,
true,
false);
3101 add_devmode_line(_(
"Min size for coarsener algorithm"), _canvas_coarsener_min_size, C_(
"pixel abbreviation",
"px"), _(
"Coarsener algorithm only processes rectangles smaller/thinner than this."));
3102 _canvas_coarsener_glue_size.init(
"/options/rendering/coarsener_glue_size", 0.0, 1000.0, 1.0, 0.0, 80.0,
true,
false);
3103 add_devmode_line(_(
"Glue size for coarsener algorithm"), _canvas_coarsener_glue_size, C_(
"pixel abbreviation",
"px"), _(
"Coarsener algorithm absorbs nearby rectangles within this distance."));
3104 _canvas_coarsener_min_fullness.init(
"/options/rendering/coarsener_min_fullness", 0.0, 1.0, 0.0, 0.0, 0.3,
false,
false);
3105 add_devmode_line(_(
"Min fullness for coarsener algorithm"), _canvas_coarsener_min_fullness,
"", _(
"Refuse coarsening algorithm's attempt if the result would be more empty than this."));
3107 add_devmode_group_header(_(
"Debugging, profiling and experiments"));
3108 _canvas_debug_framecheck.init(
"",
"/options/rendering/debug_framecheck",
false);
3109 add_devmode_line(_(
"Framecheck"), _canvas_debug_framecheck,
"", _(
"Print profiling data of selected operations to a file"));
3110 _canvas_debug_logging.init(
"",
"/options/rendering/debug_logging",
false);
3111 add_devmode_line(_(
"Logging"), _canvas_debug_logging,
"", _(
"Log certain events to the console"));
3112 _canvas_debug_delay_redraw.init(
"",
"/options/rendering/debug_delay_redraw",
false);
3113 add_devmode_line(_(
"Delay redraw"), _canvas_debug_delay_redraw,
"", _(
"Introduce a fixed delay for each tile"));
3114 _canvas_debug_delay_redraw_time.init(
"/options/rendering/debug_delay_redraw_time", 0.0, 1000000.0, 1.0, 0.0, 50.0,
true,
false);
3115 add_devmode_line(_(
"Delay redraw time"), _canvas_debug_delay_redraw_time, C_(
"microsecond abbreviation",
"μs"), _(
"The delay to introduce for each tile"));
3116 _canvas_debug_show_redraw.init(
"",
"/options/rendering/debug_show_redraw",
false);
3117 add_devmode_line(_(
"Show redraw"), _canvas_debug_show_redraw,
"", _(
"Paint a translucent random colour over each newly drawn tile"));
3118 _canvas_debug_show_unclean.init(
"",
"/options/rendering/debug_show_unclean",
false);
3119 add_devmode_line(_(
"Show unclean region"), _canvas_debug_show_unclean,
"", _(
"Show the region that needs to be redrawn in red (only in Cairo mode)"));
3120 _canvas_debug_show_snapshot.init(
"",
"/options/rendering/debug_show_snapshot",
false);
3121 add_devmode_line(_(
"Show snapshot region"), _canvas_debug_show_snapshot,
"", _(
"Show the region that still contains a saved copy of previously rendered content in blue (only in Cairo mode)"));
3122 _canvas_debug_show_clean.init(
"",
"/options/rendering/debug_show_clean",
false);
3123 add_devmode_line(_(
"Show clean region's fragmentation"), _canvas_debug_show_clean,
"", _(
"Show the outlines of the rectangles in the region where rendering is complete in green (only in Cairo mode)"));
3124 _canvas_debug_disable_redraw.init(
"",
"/options/rendering/debug_disable_redraw",
false);
3125 add_devmode_line(_(
"Disable redraw"), _canvas_debug_disable_redraw,
"", _(
"Temporarily disable the idle redraw process completely"));
3126 _canvas_debug_sticky_decoupled.init(
"",
"/options/rendering/debug_sticky_decoupled",
false);
3127 add_devmode_line(_(
"Sticky decoupled mode"), _canvas_debug_sticky_decoupled,
"", _(
"Stay in decoupled mode even after rendering is complete"));
3128 _canvas_debug_animate.init(
"",
"/options/rendering/debug_animate",
false);
3129 add_devmode_line(_(
"Animate"), _canvas_debug_animate,
"", _(
"Continuously adjust viewing parameters in an animation loop."));
3219void InkscapePreferences::initKeyboardShortcuts(Gtk::TreeModel::iterator iter_ui)
3224 auto const &default_value = values.front();
3225 _kb_filelist.init(
"/options/kbshortcuts/shortcutfile", labels, values, default_value);
3228 Glib::ustring::compose(_(
"Select a file of predefined shortcuts and modifiers to use. Any customizations you "
3229 "create will be added separately to %1"),
3231 _page_keyshortcuts.add_line(
false, _(
"Keyboard file:"), _kb_filelist,
"", tooltip.c_str(),
false);
3235 _kb_store = Gtk::TreeStore::create(
_kb_columns );
3236 _kb_store->set_sort_column ( GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID, Gtk::SortType::ASCENDING );
3238 _kb_filter = Gtk::TreeModelFilter::create(_kb_store);
3239 _kb_filter->set_visible_func (sigc::mem_fun(*
this, &InkscapePreferences::onKBSearchFilter));
3241 _kb_shortcut_renderer.property_editable() =
true;
3243 _kb_tree.set_model(_kb_filter);
3244 _kb_tree.append_column(_(
"Name"),
_kb_columns.name);
3245 _kb_tree.append_column(_(
"Shortcut"), _kb_shortcut_renderer);
3246 _kb_tree.append_column(_(
"Description"),
_kb_columns.description);
3249 _kb_tree.set_expander_column(*_kb_tree.get_column(0));
3252 _kb_tree.get_column(0)->set_resizable(
true);
3253 _kb_tree.get_column(0)->set_clickable(
true);
3254 _kb_tree.get_column(0)->set_fixed_width (200);
3257 _kb_tree.get_column(1)->set_resizable(
true);
3258 _kb_tree.get_column(1)->set_clickable(
true);
3259 _kb_tree.get_column(1)->set_fixed_width (150);
3261 _kb_tree.get_column(1)->set_cell_data_func(_kb_shortcut_renderer, &InkscapePreferences::onKBShortcutRenderer);
3264 auto desc_renderer =
dynamic_cast<Gtk::CellRendererText*
>(_kb_tree.get_column_cell_renderer(2));
3265 desc_renderer->property_wrap_mode() = Pango::WrapMode::WORD;
3266 desc_renderer->property_wrap_width() = 600;
3267 _kb_tree.get_column(2)->set_resizable(
true);
3268 _kb_tree.get_column(2)->set_clickable(
true);
3269 _kb_tree.get_column(2)->set_expand(
true);
3272 _kb_tree.get_column(3)->set_resizable(
true);
3273 _kb_tree.get_column(3)->set_clickable(
true);
3275 _kb_shortcut_renderer.signal_accel_edited().connect( sigc::mem_fun(*
this, &InkscapePreferences::onKBTreeEdited) );
3276 _kb_shortcut_renderer.signal_accel_cleared().connect( sigc::mem_fun(*
this, &InkscapePreferences::onKBTreeCleared) );
3278 _kb_notebook.append_page(_kb_page_shortcuts, _(
"Shortcuts"));
3279 auto const shortcut_scroller = Gtk::make_managed<Gtk::ScrolledWindow>();
3280 shortcut_scroller->set_child(_kb_tree);
3281 shortcut_scroller->set_hexpand();
3282 shortcut_scroller->set_vexpand();
3284 _kb_search.init(
"/options/kbshortcuts/value",
true);
3287 _kb_search.set_text({});
3288 _kb_page_shortcuts.add_line(
false, _(
"Search:"), _kb_search,
"",
"",
true);
3289 _kb_page_shortcuts.attach(*shortcut_scroller, 0, 3, 2, 1);
3291 _mod_store = Gtk::TreeStore::create( _mod_columns );
3292 _mod_tree.set_model(_mod_store);
3293 _mod_tree.append_column(_(
"Name"), _mod_columns.name);
3294 _mod_tree.append_column(
"hot", _mod_columns.and_modifiers);
3295 _mod_tree.append_column(_(
"ID"), _mod_columns.id);
3296 _mod_tree.set_tooltip_column(2);
3299 auto const and_keys_header = Gtk::make_managed<Gtk::Label>(_(
"Modifier"));
3300 and_keys_header->set_tooltip_text(_(
"All keys specified must be held down to activate this functionality."));
3301 and_keys_header->set_visible(
true);
3302 auto and_keys_column = _mod_tree.get_column(1);
3303 and_keys_column->set_widget(*and_keys_header);
3305 auto const edit_bar = Gtk::make_managed<Gtk::Box>();
3306 _kb_mod_ctrl.set_label(
"Ctrl");
3307 _kb_mod_shift.set_label(
"Shift");
3308 _kb_mod_alt.set_label(
"Alt");
3309 _kb_mod_meta.set_label(
"Meta");
3310 _kb_mod_enabled.set_label(_(
"Enabled"));
3311 edit_bar->append(_kb_mod_ctrl);
3312 edit_bar->append(_kb_mod_shift);
3313 edit_bar->append(_kb_mod_alt);
3314 edit_bar->append(_kb_mod_meta);
3315 edit_bar->append(_kb_mod_enabled);
3316 _kb_mod_ctrl.signal_toggled().connect(sigc::mem_fun(*
this, &InkscapePreferences::on_modifier_edited));
3317 _kb_mod_shift.signal_toggled().connect(sigc::mem_fun(*
this, &InkscapePreferences::on_modifier_edited));
3318 _kb_mod_alt.signal_toggled().connect(sigc::mem_fun(*
this, &InkscapePreferences::on_modifier_edited));
3319 _kb_mod_meta.signal_toggled().connect(sigc::mem_fun(*
this, &InkscapePreferences::on_modifier_edited));
3320 _kb_mod_enabled.signal_toggled().connect(sigc::mem_fun(*
this, &InkscapePreferences::on_modifier_enabled));
3321 _kb_page_modifiers.add_line(
false, _(
"Change:"), *edit_bar,
"",
"",
true);
3323 _mod_tree.get_selection()->signal_changed().connect(sigc::mem_fun(*
this, &InkscapePreferences::on_modifier_selection_changed));
3324 on_modifier_selection_changed();
3326 _kb_notebook.append_page(_kb_page_modifiers, _(
"Tools Modifiers"));
3327 auto const mod_scroller = Gtk::make_managed<Gtk::ScrolledWindow>();
3328 mod_scroller->set_child(_mod_tree);
3329 mod_scroller->set_hexpand();
3330 mod_scroller->set_vexpand();
3331 _kb_page_modifiers.attach(*mod_scroller, 0, 1, 2, 1);
3334 _page_keyshortcuts.attach(_kb_notebook, 0, row, 2, 1);
3339 auto const box_buttons = Gtk::make_managed<Gtk::Box>();
3341 box_buttons->set_spacing(4);
3342 box_buttons->set_hexpand();
3343 _page_keyshortcuts.attach(*box_buttons, 0, row, 3, 1);
3345 auto const kb_reset = Gtk::make_managed<Gtk::Button>(_(
"Reset"));
3346 kb_reset->set_use_underline();
3347 kb_reset->set_tooltip_text(_(
"Remove all your customized keyboard shortcuts, and revert to the shortcuts in the shortcut file listed above"));
3350 auto const kb_export = Gtk::make_managed<Gtk::Button>(_(
"Export ..."));
3351 kb_export->set_use_underline();
3352 kb_export->set_tooltip_text(_(
"Export custom keyboard shortcuts to a file"));
3353 UI::pack_end(*box_buttons, *kb_export,
false,
true, 6);
3355 auto const kb_import = Gtk::make_managed<Gtk::Button>(_(
"Import ..."));
3356 kb_import->set_use_underline();
3357 kb_import->set_tooltip_text(_(
"Import custom keyboard shortcuts from a file"));
3358 UI::pack_end(*box_buttons, *kb_import,
false,
true, 6);
3360 kb_reset->signal_clicked().connect( sigc::mem_fun(*
this, &InkscapePreferences::onKBReset) );
3361 kb_import->signal_clicked().connect( sigc::mem_fun(*
this, &InkscapePreferences::onKBImport) );
3362 kb_export->signal_clicked().connect( sigc::mem_fun(*
this, &InkscapePreferences::onKBExport) );
3363 _kb_filelist.signal_changed().connect( sigc::mem_fun(*
this, &InkscapePreferences::onKBList) );
3364 _page_keyshortcuts.signal_realize().connect( sigc::mem_fun(*
this, &InkscapePreferences::onKBRealize) );
3366 auto const key = Gtk::EventControllerKey::create();
3367 key->signal_key_released().connect([
this](
auto &&...args) { onKBSearchKeyReleased(); });
3368 _kb_search.add_controller(
key);
3370 _keyboard_sizegroup = Gtk::SizeGroup::create(Gtk::SizeGroup::Mode::HORIZONTAL);
3371 _keyboard_sizegroup->add_widget(*kb_reset);
3372 _keyboard_sizegroup->add_widget(*kb_export);
3373 _keyboard_sizegroup->add_widget(*kb_import);
3377 _kb_shortcuts_loaded =
false;
3378 Gtk::TreeStore::iterator iter_group = _kb_store->append();
3379 (*iter_group)[
_kb_columns.name] = _(
"Loading ...");
3383 (*iter_group)[
_kb_columns.shortcutkey] = Gtk::AccelKey();
3386 Gtk::TreeStore::iterator iter_mods = _mod_store->append();
3387 (*iter_mods)[_mod_columns.name] = _(
"Loading ...");
3388 (*iter_group)[_mod_columns.id] =
"";
3389 (*iter_group)[_mod_columns.description] = _(
"Unable to load keyboard modifier list.");
3390 (*iter_group)[_mod_columns.and_modifiers] =
"";