inkscape-preferences.cpp revision 6a13f00062e752dfe3aecd06dbc6d57c5f62ba8c
/**
* \brief Inkscape Preferences dialog
*
* Authors:
* Carl Hetherington
* Marco Scholten
*
* Copyright (C) 2004, 2006 Authors
*
* Released under GNU GPL. Read the file 'COPYING' for more information.
*/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <gtkmm/scrolledwindow.h>
#include <gtkmm/alignment.h>
#include "prefs-utils.h"
#include "inkscape-preferences.h"
#include "verbs.h"
#include "selcue.h"
#include "unit-constants.h"
#include <iostream>
#include "enums.h"
#include "inkscape.h"
#include "desktop-handles.h"
#include "message-stack.h"
#include "style.h"
#include "selection.h"
#include "selection-chemistry.h"
#include "ui/widget/style-swatch.h"
namespace Inkscape {
namespace UI {
namespace Dialog {
{
//get the width of a spinbutton
this->show_all_children();
delete sb;
//Main HBox
//Pagelist
_page_list.set_headers_visible(false);
page_list_selection->signal_changed().connect(sigc::mem_fun(*this, &InkscapePreferences::on_pagelist_selection_changed));
//Pages
initPageMisc();
//calculate the size request for this dialog
this->show_all_children();
}
{
}
void InkscapePreferences::present()
{
}
{
}
Gtk::TreeModel::iterator InkscapePreferences::AddPage(DialogPage& p, Glib::ustring title, Gtk::TreeModel::iterator parent, int id)
{
if (parent)
else
return iter;
}
void InkscapePreferences::initPageMouse()
{
_("How close on the screen you need to be to an object to be able to grab it with mouse (in screen pixels)"), false);
_("Maximum mouse drag (in screen pixels) which is considered a click, not a drag"), false);
}
void InkscapePreferences::initPageScrolling()
{
_("One mouse wheel notch scrolls by this distance in screen pixels (horizontally with Shift)"), false);
_("Pressing Ctrl+arrow key scrolls by this distance (in screen pixels)"), false);
_scroll_arrow_acc.init ( "options.scrollingacceleration", "value", 0.0, 5.0, 0.01, 1.0, 0.35, false, false);
_("Pressing and holding Ctrl+arrow will gradually speed up scrolling (0 for no acceleration)"), false);
_scroll_auto_speed.init ( "options.autoscrollspeed", "value", 0.0, 5.0, 0.01, 1.0, 0.7, false, false);
_("How fast the canvas autoscrolls when you drag beyond canvas edge (0 to turn autoscroll off)"), false);
_scroll_auto_thres.init ( "options.autoscrolldistance", "value", -600.0, 600.0, 1.0, 1.0, -10.0, true, false);
_("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);
}
void InkscapePreferences::initPageSteps()
{
_("Pressing an arrow key moves selected object(s) or node(s) by this distance (in px units)"), false);
_("Pressing > or < scales selection up or down by this increment (in px units)"), false);
_steps_inset.init ( "options.defaultoffsetwidth", "value", 0.0, 3000.0, 0.01, 1.0, 2.0, false, false);
_("Inset and Outset commands displace the path by this distance (in px units)"), false);
_steps_compass.init ( _("Compass-like display of angles"), "options.compassangledisplay", "value", true);
_("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"));
int const num_items = 12;
Glib::ustring labels[num_items] = {"90", "60", "45", "30", "15", "10", "7.5", "6", "3", "2", "1", _("None")};
_("Rotating with Ctrl pressed snaps every that much degrees; also, pressing [ or ] rotates by this amount"), false);
_steps_zoom.init ( "options.zoomincrement", "value", 101.0, 500.0, 1.0, 1.0, 1.414213562, true, true);
_("Zoom tool click, +/- keys, and middle click zoom in and out by this multiplier"), false);
}
void InkscapePreferences::AddSelcueCheckbox(DialogPage& p, const std::string& prefs_path, bool def_value)
{
p.add_line( false, "", *cb, "", _("Whether selected objects display a selection cue (the same as in selector)"));
}
void InkscapePreferences::AddGradientCheckbox(DialogPage& p, const std::string& prefs_path, bool def_value)
{
}
{
return;
_("<b>No objects selected</b> to take the style from."));
return;
}
if (!item) {
/* TODO: If each item in the selection has the same style then don't consider it an error.
* Maybe we should try to handle multiple selections anyway, e.g. the intersection of the
* style attributes for the selected items. */
_("<b>More than one object selected.</b> Cannot take style from multiple objects."));
return;
}
if (!css) return;
// only store text style for the text tool
}
// we cannot store properties with uris - they will be invalid in other documents
// update the swatch
if (swatch) {
if (tool_repr) {
}
}
}
{
p.add_group_header( _("Create new objects with:"));
_("Apply the style you last set on an object"));
p.set_tip( *own, _("Each tool may store its own style to apply to the newly created objects. Use the button below to set it."));
// style swatch
StyleSwatch *swatch = 0;
if (tool_repr) {
}
button->signal_clicked().connect( sigc::bind( sigc::ptr_fun(StyleFromSelectionToTool), prefs_path.c_str(), swatch) );
_("Remember the style of the (first) selected object as this tool's style"));
}
void InkscapePreferences::initPageTools()
{
_calligrapy_use_abs_size.init ( _("Width is in absolute units"), "tools.calligraphic", "abs_width", false);
_connector_ignore_text.init( _("Don't attach connectors to text objects"), "tools.connector", "ignoretext", true);
//Selector
_("Show the actual objects when moving or transforming"));
_t_sel_trans_outl.init ( _("Box outline"), "tools.select", "show", "outline", false, &_t_sel_trans_obj);
_("Show only a box outline of the objects when moving or transforming"));
_("No per-object selection indication"));
_t_sel_cue_mark.init ( _("Mark"), "options.selcue", "value", Inkscape::SelCue::MARK, true, &_t_sel_cue_none);
_("Each selected object has a diamond mark in the top left corner"));
_t_sel_cue_box.init ( _("Box"), "options.selcue", "value", Inkscape::SelCue::BBOX, false, &_t_sel_cue_none);
_("Each selected object displays its bounding box"));
_t_sel_org_edge.init ( _("Opposite bounding box edge"), "tools.select", "scale_origin", "bbox", true, 0);
_("Default scale origin will be on the bounding box of the item"));
_t_sel_org_node.init ( _("Farthest opposite node"), "tools.select", "scale_origin", "points", false, &_t_sel_org_edge);
_("Default scale origin will be on the bounding box of the item's points"));
//Node
//Zoom
//Shapes
Gtk::TreeModel::iterator iter_shapes = this->AddPage(_page_shapes, _("Shapes"), iter_tools, PREFS_PAGE_TOOLS_SHAPES);
//Rectangle
//ellipse
//star
//spiral
//Pencil
_t_pencil_tolerance.init ( "tools.freehand.pencil", "tolerance", 0.0, 100.0, 0.5, 1.0, 10.0, false, false);
_("This value affects the amount of smoothing applied to freehand lines; lower values produce more uneven paths with more nodes"),
false );
//Pen
//Calligraphy
_("If on, pen width is in absolute units (px) independent of zoom; otherwise pen width depends on zoom so that it looks the same at any zoom"));
_("If on, each object created with this tool will remain selected after you finish drawing it"));
//Text
//Gradient
//Connector
_("If on, connector attachment points will not be shown for text objects"));
//Dropper
}
void InkscapePreferences::initPageWindows()
{
_win_hide_task.init ( _("Dialogs are hidden in taskbar"), "options.dialogsskiptaskbar", "value", true);
_win_ontop_normal.init ( _("Normal"), "options.transientpolicy", "value", 1, true, &_win_ontop_none);
_win_ontop_agressive.init ( _("Aggressive"), "options.transientpolicy", "value", 2, false, &_win_ontop_none);
_("Save the window size and position with each document (only for Inkscape SVG format)"));
_("Whether dialog windows are to be hidden in the window manager taskbar"));
_("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)"));
_("Whether dialog windows have a close button (requires restart)"));
_("Dialogs are treated as regular windows"));
_("Dialogs stay on top of document windows"));
_("Same as Normal but may work better with some window managers"));
}
void InkscapePreferences::initPageClones()
{
SP_CLONE_COMPENSATION_PARALLEL, true, 0);
_clone_option_transform.init ( _("Move according to transform"), "options.clonecompensation", "value",
SP_CLONE_COMPENSATION_NONE, false, &_clone_option_parallel);
SP_CLONE_ORPHANS_UNLINK, true, 0);
SP_CLONE_ORPHANS_DELETE, false, &_clone_option_unlink);
_("Clones are translated by the same vector as their original."));
_("Clones preserve their positions when their original is moved."));
_("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."));
_("Orphaned clones are converted to regular objects."));
_("Orphaned clones are deleted along with their original."));
}
{
_trans_scale_corner.init ( _("Scale rounded corners in rectangles"), "options.transform", "rectcorners", false);
_trans_preserved.init ( _("Preserved"), "options.preservetransform", "value", 1, false, &_trans_optimized);
_("When scaling objects, scale the stroke width by the same proportion"));
_("When scaling rectangles, scale the radii of rounded corners"));
_("Transform gradients (in fill or stroke) along with the objects"));
_("Transform patterns (in fill or stroke) along with the objects"));
_("If possible, apply transformation to objects without adding a transform= attribute"));
_("Always store transformation as a transform= attribute on objects"));
}
void InkscapePreferences::initPageSelecting()
{
_sel_all.init ( _("Select in all layers"), "options.kbselection", "inlayer", PREFS_SELECTION_ALL, false, 0);
_sel_current.init ( _("Select only within current layer"), "options.kbselection", "inlayer", PREFS_SELECTION_LAYER, true, &_sel_all);
_sel_recursive.init ( _("Select in current layer and sublayers"), "options.kbselection", "inlayer", PREFS_SELECTION_LAYER_RECURSIVE, false, &_sel_all);
_sel_layer_deselects.init ( _("Deselect upon layer change"), "options.selection", "layerdeselect", true);
_("Make keyboard selection commands work on objects in all layers"));
_("Make keyboard selection commands work on objects in current layer only"));
_("Make keyboard selection commands work on objects in current layer and all its sublayers"));
_("Uncheck this to be able to select objects that are hidden (either by themselves or by being in a hidden group or layer)"));
_("Uncheck this to be able to select objects that are locked (either by themselves or by being in a locked group or layer)"));
_("Uncheck this to be able to keep the current objects selected when the current layer changes"));
}
void InkscapePreferences::initPageMisc()
{
_misc_export.init("dialogs.export.defaultxdpi", "value", 0.0, 6000.0, 1.0, 1.0, PX_PER_IN, true, false);
_("Default bitmap resolution (in dots per inch) in the Export dialog"), false);
_misc_imp_bitmap.init( _("Import bitmap as <image>"), "options.importbitmapsasimages", "value", true);
_("When on, an imported bitmap creates an <image> element; otherwise it is a rectangle with bitmap fill"), true);
_misc_comment.init( _("Add label comments to printing output"), "printing.debug", "show-label-comments", false);
_("When on, a comment will be added to the raw print output, marking the rendered output for an object with its label"), true);
_("The maximum length of the Open Recent list in the File menu"), false);
_misc_simpl.init("options.simplifythreshold", "value", 0.0001, 1.0, 0.0001, 0.0010, 0.0010, false, false);
_("How strong is the 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);
int const num_items = 5;
_misc_mask_on_top.init ( _("Use the topmost selected object as a clipping path or mask"), "options.maskobject", "topmost", true);
_("Uncheck this to use the bottom selected object as the clipping path or mask"));
_misc_mask_remove.init ( _("Remove clipping path or mask after applying"), "options.maskobject", "remove", true);
_("After applying, remove the object used as the clipping path or mask from the drawing"));
}
{
this->show_all_children();
this->size_request(sreq);
return false;
}
{
{
return true;
}
return false;
}
{
// show new selection
if(iter)
{
if (_current_page)
_page_title.set_markup("<span size='large'><b>" + row[_page_list_columns._col_name] + "</b></span>");
_current_page->show();
{
}
this->show_all_children();
}
}
} // namespace Dialog
} // namespace UI
} // namespace Inkscape
/*
Local Variables:
mode:c++
c-file-style:"stroustrup"
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
indent-tabs-mode:nil
fill-column:99
End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :