summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarc Jeanmougin <marc@jeanmougin.fr>2017-07-28 22:05:28 +0000
committerMarc Jeanmougin <marc@jeanmougin.fr>2017-07-28 22:05:28 +0000
commit3eb67b103fe69a3b42ec16d085a2cb3a58a596b7 (patch)
tree986b33696b0a7f229589b85bd13e6fdb2cbd022a /src
parentfix typo, update CI (diff)
parentShow a control point for the center of a spiral (diff)
downloadinkscape-3eb67b103fe69a3b42ec16d085a2cb3a58a596b7.tar.gz
inkscape-3eb67b103fe69a3b42ec16d085a2cb3a58a596b7.zip
Merge gitlab.com:inkscape/inkscape
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt4
-rw-r--r--src/inkscape.cpp15
-rw-r--r--src/libcola/cola.cpp4
-rw-r--r--src/libnrtype/FontFactory.cpp5
-rw-r--r--src/menus-skeleton.h300
-rw-r--r--src/ui/CMakeLists.txt2
-rw-r--r--src/ui/dialog/document-properties.cpp58
-rw-r--r--src/ui/dialog/document-properties.h4
-rw-r--r--src/ui/interface.cpp5
-rw-r--r--src/ui/object-edit.cpp47
-rw-r--r--src/ui/widget/ink-select-one-action.cpp239
-rw-r--r--src/ui/widget/ink-select-one-action.h131
-rw-r--r--src/ui/widget/page-sizer.cpp6
-rw-r--r--src/ui/widget/page-sizer.h1
-rw-r--r--src/widgets/text-toolbar.cpp399
15 files changed, 646 insertions, 574 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index d10e4ec25..7437f12ae 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -487,14 +487,14 @@ if(WIN32)
set(FILE_NAME inkscape)
set(PROGRAM_NAME Inkscape)
- set(PROGRAM_DESCRIPTION "Vector graphics editor")
+ set(PROGRAM_DESCRIPTION "Inkscape vector graphics editor")
configure_file(inkscape.rc ${CMAKE_BINARY_DIR}/src/inkscape.rc)
configure_file(inkscape-manifest.xml ${CMAKE_BINARY_DIR}/src/inkscape-manifest.xml)
list(APPEND main_SRC ${CMAKE_BINARY_DIR}/src/inkscape.rc)
set(FILE_NAME inkview)
set(PROGRAM_NAME Inkview)
- set(PROGRAM_DESCRIPTION "Vector graphics viewer")
+ set(PROGRAM_DESCRIPTION "Inkview vector graphics viewer")
configure_file(inkscape.rc ${CMAKE_BINARY_DIR}/src/inkview.rc)
configure_file(inkscape-manifest.xml ${CMAKE_BINARY_DIR}/src/inkview-manifest.xml)
list(APPEND view_SRC ${CMAKE_BINARY_DIR}/src/inkview.rc)
diff --git a/src/inkscape.cpp b/src/inkscape.cpp
index 24a744bbd..8dfff3c63 100644
--- a/src/inkscape.cpp
+++ b/src/inkscape.cpp
@@ -746,24 +746,15 @@ Application::crash_handler (int /*signum*/)
*/
bool Application::load_menus()
{
- gchar *fn = Inkscape::IO::Resource::profile_path(MENUS_FILE);
+ using namespace Inkscape::IO::Resource;
+ Glib::ustring filename = get_filename(UIS, MENUS_FILE);
gchar *menus_xml = 0;
gsize len = 0;
- if ( g_file_get_contents(fn, &menus_xml, &len, NULL) ) {
- // load the menus_xml file
- _menus = sp_repr_read_mem(menus_xml, len, NULL);
-
- g_free(menus_xml);
- menus_xml = 0;
- }
- g_free(fn);
- fn = 0;
-
+ _menus = sp_repr_read_file(filename.c_str(), NULL);
if ( !_menus ) {
_menus = sp_repr_read_mem(menus_skeleton, MENUS_SKELETON_SIZE, NULL);
}
-
return (_menus != 0);
}
diff --git a/src/libcola/cola.cpp b/src/libcola/cola.cpp
index d553110b9..0009ef894 100644
--- a/src/libcola/cola.cpp
+++ b/src/libcola/cola.cpp
@@ -126,7 +126,7 @@ ConstrainedMajorizationLayout
Dij[i*n + j] = d;
if(i==j) continue;
double lij=0;
- if(d!=0 && !isinf(d)) {
+ if(d!=0 && !std::isinf(d)) {
lij=1./(d*d);
}
degree += lap2[i*n + j] = lij;
@@ -284,7 +284,7 @@ inline double ConstrainedMajorizationLayout
for (unsigned i = 1; i < n; i++) {
for (unsigned j = 0; j < i; j++) {
d = Dij[i*n+j];
- if(!isinf(d)&&d!=numeric_limits<double>::max()) {
+ if(!std::isinf(d)&&d!=numeric_limits<double>::max()) {
diff = d - euclidean_distance(i,j);
if(d>80&&diff<0) continue;
sum += diff*diff / (d*d);
diff --git a/src/libnrtype/FontFactory.cpp b/src/libnrtype/FontFactory.cpp
index fe0da45dc..5c6a96694 100644
--- a/src/libnrtype/FontFactory.cpp
+++ b/src/libnrtype/FontFactory.cpp
@@ -747,7 +747,10 @@ font_instance *font_factory::Face(PangoFontDescription *descr, bool canFail)
}
}
-#if HB_VERSION_ATLEAST(1,2,3)
+// TODO: Ideally, we should use the HB_VERSION_ATLEAST macro here,
+// but this was only released in harfbuzz >= 0.9.30
+// #if HB_VERSION_ATLEAST(1,2,3)
+#if HB_VERSION_MAJOR*10000 + HB_VERSION_MINOR*100 + HB_VERSION_MICRO >= 10203
// Find glyphs in OpenType substitution tables ('gsub').
// Note that pango's functions are just dummies. Must use harfbuzz.
diff --git a/src/menus-skeleton.h b/src/menus-skeleton.h
index ca337e6a7..4cafe85ac 100644
--- a/src/menus-skeleton.h
+++ b/src/menus-skeleton.h
@@ -16,308 +16,8 @@ static char const menus_skeleton[] =
" xmlns:inkscape=\"http://www.inkscape.org/namespaces/inkscape\">\n"
"\n"
" <submenu name=\"" N_("_File") "\">\n"
-" <verb verb-id=\"FileNew\" />\n"
-" <verb verb-id=\"FileTemplates\" />\n"
-" <verb verb-id=\"FileOpen\" />\n"
-" <recent-file-list/>\n"
-" <verb verb-id=\"FileRevert\" />\n"
-" <verb verb-id=\"FileSave\" />\n"
-" <verb verb-id=\"FileSaveAs\" />\n"
-" <verb verb-id=\"FileSaveACopy\" />\n"
-" <verb verb-id=\"FileSaveTemplate\" />\n"
-" <separator/>\n"
-" <verb verb-id=\"FileImport\" />\n"
-" <verb verb-id=\"DialogExport\" />\n"
-" <verb verb-id=\"FileImportFromOCAL\" />\n"
-//" <verb verb-id=\"FileExportToOCAL\" />\n"
-" <separator/>\n"
-" <verb verb-id=\"FilePrint\" />\n"
-" <separator/>\n"
-" <verb verb-id=\"FileVacuum\" />\n"
-" <separator/>\n"
-" <verb verb-id=\"DialogDocumentProperties\" />\n"
-//" <verb verb-id=\"DialogMetadata\" />\n"
-" <separator/>\n"
-" <verb verb-id=\"FileClose\" />\n"
" <verb verb-id=\"FileQuit\" />\n"
" </submenu>\n"
-" <submenu name=\"" N_("_Edit") "\">\n"
-" <verb verb-id=\"EditUndo\" />\n"
-" <verb verb-id=\"EditRedo\" />\n"
-" <verb verb-id=\"DialogUndoHistory\" />\n"
-" <separator/>\n"
-" <verb verb-id=\"EditCut\" />\n"
-" <verb verb-id=\"EditCopy\" />\n"
-" <verb verb-id=\"EditPaste\" />\n"
-" <verb verb-id=\"EditPasteInPlace\" />\n"
-" <verb verb-id=\"EditPasteStyle\" />\n"
-" <submenu name=\"" N_("Paste Si_ze") "\">\n"
-" <verb verb-id=\"EditPasteSize\" />\n"
-" <verb verb-id=\"EditPasteWidth\" />\n"
-" <verb verb-id=\"EditPasteHeight\" />\n"
-" <verb verb-id=\"EditPasteSizeSeparately\" />\n"
-" <verb verb-id=\"EditPasteWidthSeparately\" />\n"
-" <verb verb-id=\"EditPasteHeightSeparately\" />\n"
-" </submenu>\n"
-" <separator/>\n"
-" <verb verb-id=\"DialogFind\" />\n"
-" <separator/>\n"
-" <verb verb-id=\"EditDuplicate\" />\n"
-" <submenu name=\"" N_("Clo_ne") "\">\n"
-" <verb verb-id=\"EditClone\" />\n"
-" <verb verb-id=\"DialogClonetiler\" />\n"
-" <verb verb-id=\"EditUnlinkClone\" />\n"
-" <verb verb-id=\"EditUnlinkCloneRecursive\" />\n"
-" <verb verb-id=\"EditRelinkClone\" />\n"
-" <verb verb-id=\"EditCloneSelectOriginal\" />\n"
-" <verb verb-id=\"EditCloneOriginalPathLPE\" />\n"
-" </submenu>\n"
-" <verb verb-id=\"SelectionCreateBitmap\" />\n"
-" <separator/>\n"
-" <verb verb-id=\"EditDelete\" />\n"
-" <separator/>\n"
-" <verb verb-id=\"EditSelectAll\" />\n"
-" <verb verb-id=\"EditSelectAllInAllLayers\" />\n"
-" <submenu name=\"" N_("Select Sa_me") "\">\n"
-" <verb verb-id=\"EditSelectSameFillStroke\" />\n"
-" <verb verb-id=\"EditSelectSameFillColor\" />\n"
-" <verb verb-id=\"EditSelectSameStrokeColor\" />\n"
-" <verb verb-id=\"EditSelectSameStrokeStyle\" />\n"
-" <verb verb-id=\"EditSelectSameObjectType\" />\n"
-" </submenu>\n"
-" <verb verb-id=\"EditInvert\" />\n"
-" <verb verb-id=\"EditDeselect\" />\n"
-" <separator/>\n"
-" <verb verb-id=\"FitCanvasToSelectionOrDrawing\" />\n"
-" <separator/>\n"
-" <verb verb-id=\"EditGuidesAroundPage\" />\n"
-" <verb verb-id=\"EditGuidesToggleLock\" check=\"yes\" />\n"
-" <verb verb-id=\"EditRemoveAllGuides\" />\n"
-" <separator/>\n"
-" <verb verb-id=\"DialogXMLEditor\" />\n"
-" <separator/>\n"
-" <verb verb-id=\"DialogInput\" />\n"
-" <verb verb-id=\"DialogPreferences\" />\n"
-" </submenu>\n"
-" <submenu name=\"" N_("_View") "\">\n"
-" <submenu name=\"" N_("_Zoom") "\">\n"
-" <verb verb-id=\"ZoomIn\" />\n"
-" <verb verb-id=\"ZoomOut\" />\n"
-" <separator/>\n"
-" <verb verb-id=\"Zoom1:0\" />\n"
-" <verb verb-id=\"Zoom1:2\" />\n"
-" <verb verb-id=\"Zoom2:1\" />\n"
-" <separator/>\n"
-" <verb verb-id=\"ZoomSelection\" />\n"
-" <verb verb-id=\"ZoomDrawing\" />\n"
-" <verb verb-id=\"ZoomPage\" />\n"
-" <verb verb-id=\"ZoomPageWidth\" />\n"
-" <separator/>\n"
-" <verb verb-id=\"ZoomPrev\" />\n"
-" <verb verb-id=\"ZoomNext\" />\n"
-" </submenu>\n"
-" <submenu name=\"" N_("_Display mode") "\">\n"
-" <verb verb-id=\"ViewModeToggle\"/>\n"
-" <verb verb-id=\"ViewModeNormal\" radio=\"yes\" default=\"yes\"/>\n"
-" <verb verb-id=\"ViewModeNoFilters\" radio=\"yes\"/>\n"
-" <verb verb-id=\"ViewModeOutline\" radio=\"yes\"/>\n"
-// Better location in menu needs to be found
-//" <verb verb-id=\"ViewModePrintColorsPreview\" radio=\"yes\"/>\n"
-//" <verb verb-id=\"DialogPrintColorsPreview\" />\n"
-" </submenu>\n"
-" <submenu name=\"" N_("_Color display mode") "\">\n"
-" <verb verb-id=\"ViewColorModeToggle\"/>\n"
-" <verb verb-id=\"ViewColorModeNormal\" radio=\"yes\" default=\"yes\"/>\n"
-" <verb verb-id=\"ViewColorModeGrayscale\" radio=\"yes\"/>\n"
-// Better location in menu needs to be found
-//" <verb verb-id=\"ViewColorModePrintColorsPreview\" radio=\"yes\"/>\n"
-//" <verb verb-id=\"DialogPrintColorsPreview\" />\n"
-" </submenu>\n"
-" <separator/>\n"
-" <verb verb-id=\"ToggleGrid\" check=\"yes\" />\n"
-" <verb verb-id=\"ToggleGuides\" check=\"yes\" />\n"
-" <verb verb-id=\"ViewCmsToggle\" check=\"yes\" />\n"
-" <separator/>\n"
-" <submenu name=\"" N_("Sh_ow/Hide") "\">\n"
-" <objects-checkboxes/>\n"
-" </submenu>\n"
-" <verb verb-id=\"DialogsToggle\" />\n"
-" <separator/>\n"
-" <verb verb-id=\"DialogSwatches\" />\n"
-" <verb verb-id=\"DialogDebug\" />\n"
-" <separator/>\n"
-" <verb verb-id=\"PrevWindow\" />\n"
-" <verb verb-id=\"NextWindow\" />\n"
-" <separator/>\n"
-" <verb verb-id=\"ViewIconPreview\" />\n"
-" <verb verb-id=\"ViewNew\" />\n"
-" <separator/>\n"
-" <verb verb-id=\"FullScreen\" />\n"
-" <separator/>\n"
-" <task-checkboxes/>\n"
-// Not quite ready to be in the menus.
-// " <verb verb-id=\"FocusToggle\" />\n"
-" </submenu>\n"
-" <submenu name=\"" N_("_Layer") "\">\n"
-" <verb verb-id=\"LayerNew\" />\n"
-" <verb verb-id=\"LayerRename\" />\n"
-" <separator/>\n"
-" <verb verb-id=\"LayerToggleHide\" />\n"
-" <verb verb-id=\"LayerToggleLock\" />\n"
-" <separator/>\n"
-" <verb verb-id=\"LayerNext\" />\n"
-" <verb verb-id=\"LayerPrev\" />\n"
-" <separator/>\n"
-" <verb verb-id=\"LayerMoveToNext\" />\n"
-" <verb verb-id=\"LayerMoveToPrev\" />\n"
-" <verb verb-id=\"LayerMoveTo\" />\n"
-" <separator/>\n"
-" <verb verb-id=\"LayerRaise\" />\n"
-" <verb verb-id=\"LayerLower\" />\n"
-" <verb verb-id=\"LayerToTop\" />\n"
-" <verb verb-id=\"LayerToBottom\" />\n"
-" <separator/>\n"
-" <verb verb-id=\"LayerDuplicate\" />\n"
-" <verb verb-id=\"LayerDelete\" />\n"
-" <separator/>\n"
-" <verb verb-id=\"DialogLayers\" />\n"
-" </submenu>\n"
-" <submenu name=\"" N_("_Object") "\">\n"
-" <verb verb-id=\"DialogObjects\" />\n"
-" <verb verb-id=\"DialogTags\" />\n"
-" <verb verb-id=\"DialogStyle\" />\n"
-" <separator/>\n"
-" <verb verb-id=\"DialogFillStroke\" />\n"
-" <verb verb-id=\"DialogObjectProperties\" />\n"
-" <verb verb-id=\"DialogSymbols\" />\n"
-" <separator/>\n"
-" <verb verb-id=\"SelectionGroup\" />\n"
-" <verb verb-id=\"SelectionUnGroup\" />\n"
-" <verb verb-id=\"SelectionUnGroupPopSelection\" />\n"
-" <separator/>\n"
-" <submenu name=\"" N_("Cli_p") "\">\n"
-" <verb verb-id=\"ObjectSetClipPath\" />\n"
-" <verb verb-id=\"ObjectUnSetClipPath\" />\n"
-" </submenu>\n"
-" <submenu name=\"" N_("Mas_k") "\">\n"
-" <verb verb-id=\"ObjectSetMask\" />\n"
-" <verb verb-id=\"ObjectUnSetMask\" />\n"
-" </submenu>\n"
-" <submenu name=\"" N_("Patter_n") "\">\n"
-" <verb verb-id=\"ObjectsToPattern\" />\n"
-" <verb verb-id=\"ObjectsFromPattern\" />\n"
-" </submenu>\n"
-" <verb verb-id=\"ObjectsToMarker\" />\n"
-" <verb verb-id=\"ObjectsToGuides\" />\n"
-" <separator/>\n"
-" <verb verb-id=\"SelectionRaise\" />\n"
-" <verb verb-id=\"SelectionLower\" />\n"
-" <verb verb-id=\"SelectionToFront\" />\n"
-" <verb verb-id=\"SelectionToBack\" />\n"
-" <separator/>\n"
-" <verb verb-id=\"ObjectRotate90\" />\n"
-" <verb verb-id=\"ObjectRotate90CCW\" />\n"
-" <verb verb-id=\"ObjectFlipHorizontally\" />\n"
-" <verb verb-id=\"ObjectFlipVertically\" />\n"
-" <separator/>\n"
-" <verb verb-id=\"UnhideAll\" />\n"
-" <verb verb-id=\"UnlockAll\" />\n"
-" <separator/>\n"
-" <verb verb-id=\"DialogTransform\" />\n"
-" <verb verb-id=\"DialogAlignDistribute\" />\n"
-" <verb verb-id=\"DialogArrange\" />\n"
-" <verb verb-id=\"DialogPrototype\" />\n"
-" </submenu>\n"
-" <submenu name=\"" N_("_Path") "\">\n"
-" <verb verb-id=\"ObjectToPath\" />\n"
-" <verb verb-id=\"StrokeToPath\" />\n"
-
-#if HAVE_POTRACE
-" <verb verb-id=\"SelectionTrace\" />\n"
-#endif
-
-" <verb verb-id=\"SelectionPixelArt\" />\n"
-" <separator/>\n"
-" <verb verb-id=\"SelectionUnion\" show-icon=\"yes\" />\n"
-" <verb verb-id=\"SelectionDiff\" show-icon=\"yes\" />\n"
-" <verb verb-id=\"SelectionIntersect\" show-icon=\"yes\" />\n"
-" <verb verb-id=\"SelectionSymDiff\" show-icon=\"yes\"/>\n"
-" <verb verb-id=\"SelectionDivide\" show-icon=\"yes\"/>\n"
-" <verb verb-id=\"SelectionCutPath\" show-icon=\"yes\"/>\n"
-" <separator/>\n"
-" <verb verb-id=\"SelectionCombine\" show-icon=\"yes\"/>\n"
-" <verb verb-id=\"SelectionBreakApart\" show-icon=\"yes\"/>\n"
-" <separator/>\n"
-" <verb verb-id=\"SelectionInset\" show-icon=\"yes\"/>\n"
-" <verb verb-id=\"SelectionOffset\" show-icon=\"yes\"/>\n"
-" <verb verb-id=\"SelectionDynOffset\" show-icon=\"yes\"/>\n"
-" <verb verb-id=\"SelectionLinkedOffset\" show-icon=\"yes\"/>\n"
-" <separator/>\n"
-" <verb verb-id=\"SelectionSimplify\" />\n"
-" <verb verb-id=\"SelectionReverse\" />\n"
-" <separator/>\n"
-" <verb verb-id=\"DialogLivePathEffect\" />\n"
-" <verb verb-id=\"PasteLivePathEffect\" />\n"
-" <verb verb-id=\"RemoveLivePathEffect\" />\n"
-" </submenu>\n"
-" <submenu name=\"" N_("_Text") "\">\n"
-" <verb verb-id=\"DialogText\" />\n"
-" <verb verb-id=\"DialogSVGFonts\" />\n"
-" <verb verb-id=\"DialogGlyphs\" />\n"
-" <separator/>\n"
-" <verb verb-id=\"SelectionTextToPath\" />\n"
-" <verb verb-id=\"SelectionTextFromPath\" />\n"
-" <separator/>\n"
-" <verb verb-id=\"ObjectFlowText\" />\n"
-" <verb verb-id=\"ObjectUnFlowText\" />\n"
-" <verb verb-id=\"ObjectFlowtextToText\" />\n"
-" <separator/>\n"
-" <verb verb-id=\"SelectionTextRemoveKerns\" />\n"
-#ifdef HAVE_ASPELL
-" <separator/>\n"
-" <verb verb-id=\"DialogSpellcheck\" />\n"
-#endif
-" </submenu>\n"
-" <submenu name=\"" N_("Filter_s") "\">\n"
-" <filters-list/>\n"
-" <separator/>\n"
-" <verb verb-id=\"DialogFilterEffects\" />\n"
-" <verb verb-id=\"RemoveFilter\" />\n"
-" </submenu>\n"
-" <submenu name=\"" N_("Exte_nsions") "\">\n"
-" <verb verb-id=\"EffectLast\" />\n"
-" <verb verb-id=\"EffectLastPref\" />\n"
-" <separator/>\n"
-" <effects-list/>\n"
-" </submenu>\n"
-" <submenu name=\"" N_("_Help") "\">\n"
-" <verb verb-id=\"org.inkscape.help.manual\" />\n"
-" <verb verb-id=\"org.inkscape.help.keys\" />\n"
-" <verb verb-id=\"org.inkscape.help.askaquestion\" />\n"
-" <submenu name=\"" N_("Tutorials") "\">\n"
-" <verb verb-id=\"TutorialsBasic\" />\n"
-" <verb verb-id=\"TutorialsShapes\" />\n"
-" <verb verb-id=\"TutorialsAdvanced\" />\n"
-#if HAVE_POTRACE
-" <verb verb-id=\"TutorialsTracing\" />\n"
-#endif
-" <verb verb-id=\"TutorialsTracingPixelArt\" />\n"
-" <verb verb-id=\"TutorialsCalligraphy\" />\n"
-" <verb verb-id=\"TutorialsInterpolate\" />\n"
-" <verb verb-id=\"TutorialsDesign\" />\n"
-" <verb verb-id=\"TutorialsTips\" />\n"
-" </submenu>\n"
-//" <verb verb-id=\"org.inkscape.dialogs.extensioneditor\" />\n"
-" <verb verb-id=\"org.inkscape.help.commandline\" />\n"
-" <verb verb-id=\"org.inkscape.help.faq\" />\n"
-" <verb verb-id=\"org.inkscape.help.relnotes\" />\n"
-" <verb verb-id=\"org.inkscape.help.reportabug\" />\n"
-" <verb verb-id=\"org.inkscape.help.svgspec\" />\n"
-" <separator/>\n"
-" <verb verb-id=\"HelpAboutMemory\" />\n"
-" <verb verb-id=\"HelpAbout\" />\n"
-//" <verb verb-id=\"ShowLicense\" />\n"
-" </submenu>\n"
"</inkscape>\n";
#define MENUS_SKELETON_SIZE (sizeof(menus_skeleton) - 1)
diff --git a/src/ui/CMakeLists.txt b/src/ui/CMakeLists.txt
index 789378e0c..efdb279b4 100644
--- a/src/ui/CMakeLists.txt
+++ b/src/ui/CMakeLists.txt
@@ -147,6 +147,7 @@ set(ui_SRC
widget/licensor.cpp
widget/notebook-page.cpp
widget/object-composite-settings.cpp
+ widget/ink-select-one-action.cpp
widget/page-sizer.cpp
widget/panel.cpp
widget/point.cpp
@@ -339,6 +340,7 @@ set(ui_SRC
widget/licensor.h
widget/notebook-page.h
widget/object-composite-settings.h
+ widget/ink-select-one-action.h
widget/page-sizer.h
widget/panel.h
widget/point.h
diff --git a/src/ui/dialog/document-properties.cpp b/src/ui/dialog/document-properties.cpp
index 7d51653db..2765e63f4 100644
--- a/src/ui/dialog/document-properties.cpp
+++ b/src/ui/dialog/document-properties.cpp
@@ -207,7 +207,7 @@ DocumentProperties::~DocumentProperties()
* widget in columns 2-3; (non-0, 0) means label in columns 1-3; and
* (non-0, non-0) means two widgets in columns 2 and 3.
*/
-inline void attach_all(Gtk::Grid &table, Gtk::Widget *const arr[], unsigned const n, int start = 0, int docum_prop_flag = 0)
+inline void attach_all(Gtk::Grid &table, Gtk::Widget *const arr[], unsigned const n, int start = 0, int docum_prop_flag = 0, bool indent = false)
{
for (unsigned i = 0, r = start; i < n; i += 2) {
if (arr[i] && arr[i+1]) {
@@ -226,7 +226,7 @@ inline void attach_all(Gtk::Grid &table, Gtk::Widget *const arr[], unsigned cons
}
if (docum_prop_flag) {
// this sets the padding for subordinate widgets on the "Page" page
- if( i==(n-8) || i==(n-10) ) {
+ if( indent && (i==(n-6) || i==(n-4) || i==(n-2)) ) {
arr[i+1]->set_hexpand();
#if WITH_GTKMM_3_12
arr[i+1]->set_margin_start(20);
@@ -305,29 +305,47 @@ void DocumentProperties::build_page()
Gtk::Widget *const widget_array[] =
{
- label_gen, 0,
- 0, &_rum_deflt,
- //label_col, 0,
- //_rcp_bg._label, &_rcp_bg,
- 0, 0,
- label_for, 0,
- 0, &_page_sizer,
- 0, 0,
- label_bkg, 0,
- 0, &_rcb_checkerboard,
- _rcp_bg._label, &_rcp_bg,
- label_bdr, 0,
- 0, &_rcb_canb,
- 0, &_rcb_bord,
- 0, &_rcb_shad,
- _rcp_bord._label, &_rcp_bord,
- label_dsp, 0,
- 0, &_rcb_antialias,
+ label_gen, 0,
+ 0, &_rum_deflt,
+ //label_col, 0,
+ //_rcp_bg._label, &_rcp_bg,
+ 0, 0,
+ label_for, 0,
+ 0, &_page_sizer,
+ 0, 0,
+ &_rcb_doc_props_left, &_rcb_doc_props_right,
};
+ attach_all(_page_page->table(), widget_array, G_N_ELEMENTS(widget_array),0,1);
+ _rcp_bg_col.pack_start(*_rcp_bg._label, false, false, 2);
+ _rcp_bg_col.pack_start(_rcp_bg, false, false, 2);
+ Gtk::Widget *const widget_array_left[] =
+ {
+ label_bkg, 0,
+ 0, &_rcb_checkerboard,
+ 0, &_rcp_bg_col,
+ label_dsp, 0,
+ 0, &_rcb_antialias,
+ };
+
+ attach_all(_rcb_doc_props_left, widget_array_left, G_N_ELEMENTS(widget_array_left),0,1);
+ _rcp_bord_col.pack_start(*_rcp_bord._label, false, false, 2);
+ _rcp_bord_col.pack_start(_rcp_bord, false, false, 2);
+ Gtk::Widget *const widget_array_right[] =
+ {
+ label_bdr, 0,
+ 0, &_rcb_canb,
+ 0, &_rcb_bord,
+ 0, &_rcb_shad,
+ 0, &_rcp_bord_col,
+ };
+
+ attach_all(_rcb_doc_props_right, widget_array_right, G_N_ELEMENTS(widget_array_right),0,1, true);
+
std::list<Gtk::Widget*> _slaveList;
_slaveList.push_back(&_rcb_bord);
_slaveList.push_back(&_rcb_shad);
+ _slaveList.push_back(&_rcp_bord_col);
_rcb_canb.setSlaveWidgets(_slaveList);
attach_all(_page_page->table(), widget_array, G_N_ELEMENTS(widget_array),0,1);
diff --git a/src/ui/dialog/document-properties.h b/src/ui/dialog/document-properties.h
index 8d1c6b38a..fe0e1864e 100644
--- a/src/ui/dialog/document-properties.h
+++ b/src/ui/dialog/document-properties.h
@@ -117,6 +117,10 @@ protected:
UI::Widget::Registry _wr;
//---------------------------------------------------------------
+ Gtk::Grid _rcb_doc_props_left;
+ Gtk::Grid _rcb_doc_props_right;
+ Gtk::Box _rcp_bg_col;
+ Gtk::Box _rcp_bord_col;
UI::Widget::RegisteredCheckButton _rcb_antialias;
UI::Widget::RegisteredCheckButton _rcb_checkerboard;
UI::Widget::RegisteredCheckButton _rcb_canb;
diff --git a/src/ui/interface.cpp b/src/ui/interface.cpp
index a0ee5c72b..bbbd71ab8 100644
--- a/src/ui/interface.cpp
+++ b/src/ui/interface.cpp
@@ -481,7 +481,12 @@ static GtkWidget *sp_ui_menu_append_item_from_verb(GtkMenu *men
GtkWidget *label = gtk_accel_label_new(action->name);
gtk_label_set_markup_with_mnemonic( GTK_LABEL(label), action->name);
gtk_label_set_use_underline(GTK_LABEL(label), true);
+
+#if GTK_CHECK_VERSION(3,16,0)
gtk_label_set_xalign(GTK_LABEL(label), 0.0);
+#else
+ gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
+#endif
GtkAccelGroup *accel_group = sp_shortcut_get_accel_group();
gtk_menu_set_accel_group(menu, accel_group);
diff --git a/src/ui/object-edit.cpp b/src/ui/object-edit.cpp
index 81f0b92c0..a2b6a2de0 100644
--- a/src/ui/object-edit.cpp
+++ b/src/ui/object-edit.cpp
@@ -1293,6 +1293,12 @@ public:
virtual void knot_set(Geom::Point const &p, Geom::Point const &origin, unsigned int state);
};
+class SpiralKnotHolderEntityCenter : public KnotHolderEntity {
+public:
+ virtual Geom::Point knot_get() const;
+ virtual void knot_set(Geom::Point const &p, Geom::Point const &origin, unsigned int state);
+};
+
/*
* set attributes via inner (t=t0) knot point:
@@ -1425,6 +1431,20 @@ SpiralKnotHolderEntityOuter::knot_set(Geom::Point const &p, Geom::Point const &/
spiral->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG);
}
+void
+SpiralKnotHolderEntityCenter::knot_set(Geom::Point const &p, Geom::Point const &/*origin*/, unsigned int state)
+{
+ SPSpiral *spiral = dynamic_cast<SPSpiral *>(item);
+ g_assert(spiral != NULL);
+
+ Geom::Point const s = snap_knot_position(p, state);
+
+ spiral->cx = s[Geom::X];
+ spiral->cy = s[Geom::Y];
+
+ spiral->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG);
+}
+
Geom::Point
SpiralKnotHolderEntityInner::knot_get() const
{
@@ -1443,6 +1463,15 @@ SpiralKnotHolderEntityOuter::knot_get() const
return spiral->getXY(1.0);
}
+Geom::Point
+SpiralKnotHolderEntityCenter::knot_get() const
+{
+ SPSpiral const *spiral = dynamic_cast<SPSpiral const *>(item);
+ g_assert(spiral != NULL);
+
+ return Geom::Point(spiral->cx, spiral->cy);
+}
+
void
SpiralKnotHolderEntityInner::knot_click(unsigned int state)
{
@@ -1461,9 +1490,26 @@ SpiralKnotHolderEntityInner::knot_click(unsigned int state)
SpiralKnotHolder::SpiralKnotHolder(SPDesktop *desktop, SPItem *item, SPKnotHolderReleasedFunc relhandler) :
KnotHolder(desktop, item, relhandler)
{
+ SpiralKnotHolderEntityCenter *entity_center = new SpiralKnotHolderEntityCenter();
SpiralKnotHolderEntityInner *entity_inner = new SpiralKnotHolderEntityInner();
SpiralKnotHolderEntityOuter *entity_outer = new SpiralKnotHolderEntityOuter();
+ // NOTE: entity_central and entity_inner can overlap.
+ //
+ // In that case it would be a problem if the center control point was ON
+ // TOP because it would steal the mouse focus and the user would loose the
+ // ability to access the inner control point using only the mouse.
+ //
+ // However if the inner control point is ON TOP, taking focus, the
+ // situation is a lot better: the user can still move the inner control
+ // point with the mouse to regain access to the center control point.
+ //
+ // So, create entity_inner AFTER entity_center; this ensures that
+ // entity_inner gets rendered ON TOP.
+ entity_center->create(desktop, item, this, Inkscape::CTRL_TYPE_POINT,
+ _("Drag to move the spiral"),
+ SP_KNOT_SHAPE_CROSS);
+
entity_inner->create(desktop, item, this, Inkscape::CTRL_TYPE_SHAPER,
_("Roll/unroll the spiral from <b>inside</b>; with <b>Ctrl</b> to snap angle; "
"with <b>Alt</b> to converge/diverge"));
@@ -1472,6 +1518,7 @@ SpiralKnotHolder::SpiralKnotHolder(SPDesktop *desktop, SPItem *item, SPKnotHolde
_("Roll/unroll the spiral from <b>outside</b>; with <b>Ctrl</b> to snap angle; "
"with <b>Shift</b> to scale/rotate; with <b>Alt</b> to lock radius"));
+ entity.push_back(entity_center);
entity.push_back(entity_inner);
entity.push_back(entity_outer);
diff --git a/src/ui/widget/ink-select-one-action.cpp b/src/ui/widget/ink-select-one-action.cpp
new file mode 100644
index 000000000..40bafecc2
--- /dev/null
+++ b/src/ui/widget/ink-select-one-action.cpp
@@ -0,0 +1,239 @@
+/*
+ * Authors:
+ * Tavmjong Bah <tavmjong@free.fr>
+ *
+ * Copyright (C) 2017 Tavmjong Bah
+ *
+ * Released under GNU GPL, read the file 'COPYING' for more information
+ */
+
+
+/** \file
+ An action (menu/toolbar item) that allows selecting one choice out of many.
+
+ The choices may be displayed as:
+
+ 1. A group of items in a toolbar with labels and/or icons.
+ 2. As a drop-down menu with a labels and/or icons.
+*/
+
+#include "ink-select-one-action.h"
+
+#include <iostream>
+#include <gtkmm/toolitem.h>
+#include <gtkmm/menuitem.h>
+#include <gtkmm/radioaction.h>
+#include <gtkmm/radiomenuitem.h>
+#include <gtkmm/combobox.h>
+#include <gtkmm/menu.h>
+#include <gtkmm/box.h>
+#include <gtkmm/label.h>
+#include <gtkmm/image.h>
+
+InkSelectOneAction* InkSelectOneAction::create(const Glib::ustring &name,
+ const Glib::ustring &label,
+ const Glib::ustring &tooltip,
+ const Glib::ustring &stock_id,
+ Glib::RefPtr<Gtk::ListStore> store ) {
+
+ return new InkSelectOneAction(name, label, tooltip, stock_id, store);
+}
+
+InkSelectOneAction::InkSelectOneAction (const Glib::ustring &name,
+ const Glib::ustring &label,
+ const Glib::ustring &tooltip,
+ const Glib::ustring &stock_id,
+ Glib::RefPtr<Gtk::ListStore> store ) :
+ Gtk::Action(name, stock_id, label, tooltip),
+ _name( name ),
+ _label( label ),
+ _tooltip( tooltip ),
+ _stock_id( stock_id ),
+ _store (store),
+ _use_radio (true),
+ _use_label (true),
+ _use_icon (true),
+ _icon_size ( Gtk::ICON_SIZE_LARGE_TOOLBAR ),
+ _combobox (nullptr),
+ _radioaction (nullptr),
+ _menuitem (nullptr)
+{
+}
+
+void InkSelectOneAction::set_active (gint active) {
+
+ if (_active != active) {
+
+ _active = active;
+
+ if (_combobox) {
+ _combobox->set_active (active);
+ }
+
+ if (_radioaction) {
+ _radioaction->set_current_value (active);
+ }
+
+ if (active < _radiomenuitems.size()) {
+ _radiomenuitems[ active ]->set_active();
+ }
+ }
+}
+
+Gtk::Widget* InkSelectOneAction::create_menu_item_vfunc() {
+
+ if (_menuitem == nullptr) {
+
+ _menuitem = Gtk::manage (new Gtk::MenuItem);
+ Gtk::Menu *menu = Gtk::manage (new Gtk::Menu);
+
+ Gtk::RadioButton::Group group;
+ int index = 0;
+ auto children = _store->children();
+ for (auto iter = children.begin(); iter != children.end(); ++iter) {
+ Gtk::TreeModel::Row row = *iter;
+
+ InkSelectOneActionColumns columns;
+ Glib::ustring label = row[columns.col_label ];
+ Glib::ustring icon = row[columns.col_icon ];
+ Glib::ustring tooltip = row[columns.col_tooltip ];
+ bool sensitive = row[columns.col_sensitive ];
+
+ Gtk::RadioMenuItem* button = Gtk::manage(new Gtk::RadioMenuItem(group));
+ button->set_label (label);
+ button->set_tooltip_text( tooltip );
+ button->set_sensitive( sensitive );
+
+ button->signal_toggled().connect( sigc::bind<0>(
+ sigc::mem_fun(*this, &InkSelectOneAction::on_toggled_radiomenu), index++)
+ );
+
+ menu->add (*button);
+
+ _radiomenuitems.push_back( button );
+ }
+
+ if ( _active < _radiomenuitems.size()) {
+ _radiomenuitems[ _active ]->set_active();
+ }
+
+ _menuitem->set_submenu (*menu);
+ _menuitem->show_all();
+ }
+
+ return _menuitem;
+}
+
+
+Gtk::Widget* InkSelectOneAction::create_tool_item_vfunc() {
+ // Either a group of radio actions or a combobox with labels and/or icons.
+
+ Gtk::ToolItem *tool_item = new Gtk::ToolItem;
+
+ if (_use_radio) {
+ // Create radio actions (note: these are not radio buttons).
+
+ Gtk::Box* box = Gtk::manage(new Gtk::Box());
+ tool_item->add (*box);
+
+ Gtk::RadioAction::Group group;
+ int index = 0;
+ auto children = _store->children();
+ for (auto iter = children.begin(); iter != children.end(); ++iter) {
+ Gtk::TreeModel::Row row = *iter;
+
+ InkSelectOneActionColumns columns;
+ Glib::ustring label = row[columns.col_label ];
+ Glib::ustring icon = row[columns.col_icon ];
+ Glib::ustring tooltip = row[columns.col_tooltip ];
+ bool sensitive = row[columns.col_sensitive];
+ Glib::RefPtr<Gtk::RadioAction> action;
+ if (_use_icon) {
+ action =
+ Gtk::RadioAction::create_with_icon_name (group, "Anonymous", icon, label, tooltip);
+ } else {
+ action =
+ Gtk::RadioAction::create (group, "Anonymous", label, tooltip);
+ }
+ action->set_property( "value", index++ ); // To identify uniquely each radioaction.
+ action->set_sensitive( sensitive );
+
+ // Save first action for use in setting/getting active value.
+ if (!_radioaction) {
+ _radioaction = action;
+ }
+
+ Gtk::ToolItem* item = action->create_tool_item();
+ box->add (*item);
+ }
+
+ _radioaction->signal_changed().connect( sigc::mem_fun(*this, &InkSelectOneAction::on_changed_radioaction));
+
+ } else {
+ // Create combobox
+
+ _combobox = Gtk::manage (new Gtk::ComboBox());
+ _combobox->set_model(_store);
+
+ InkSelectOneActionColumns columns;
+ if (_use_icon ) {
+ Gtk::CellRendererPixbuf *renderer = new Gtk::CellRendererPixbuf;
+ renderer->set_property ("stock_size", Gtk::ICON_SIZE_LARGE_TOOLBAR);
+ _combobox->pack_start (*renderer, false);
+ _combobox->add_attribute (*renderer, "icon_name", columns.col_icon );
+ }
+
+ if (_use_label) {
+ _combobox->pack_start(columns.col_label);
+ }
+
+ std::vector<Gtk::CellRenderer*> cells = _combobox->get_cells();
+ for (auto iter = cells.begin(); iter!= cells.end(); ++iter) {
+ _combobox->add_attribute (**iter, "sensitive", columns.col_sensitive);
+ }
+
+ _combobox->set_active (_active);
+
+ _combobox->signal_changed().connect(
+ sigc::mem_fun(*this, &InkSelectOneAction::on_changed_combobox));
+
+ tool_item->add (*_combobox);
+ }
+
+ tool_item->show_all();
+
+ return tool_item;
+}
+
+void InkSelectOneAction::on_changed_combobox() {
+
+ set_active( _combobox->get_active_row_number() );
+ _changed.emit (_active);
+}
+
+void InkSelectOneAction::on_changed_radioaction(const Glib::RefPtr<Gtk::RadioAction>& current) {
+
+ set_active( current->get_current_value() );
+ _changed.emit (_active);
+}
+
+void InkSelectOneAction::on_toggled_radiomenu(int n) {
+
+ // toggled emitted twice, first for button toggled off, second for button toggled on.
+ // We want to react only to the button turned on.
+ if ( n < _radiomenuitems.size() &&_radiomenuitems[ n ]->get_active()) {
+ set_active ( n );
+ _changed.emit (_active);
+ }
+}
+
+/*
+ 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:fileencoding=utf-8:textwidth=99 :
diff --git a/src/ui/widget/ink-select-one-action.h b/src/ui/widget/ink-select-one-action.h
new file mode 100644
index 000000000..194ca8027
--- /dev/null
+++ b/src/ui/widget/ink-select-one-action.h
@@ -0,0 +1,131 @@
+#ifndef SEEN_INK_SELECT_ONE_ACTION
+#define SEEN_INK_SELECT_ONE_ACTION
+
+/*
+ * Authors:
+ * Tavmjong Bah <tavmjong@free.fr>
+ *
+ * Copyright (C) 2017 Tavmjong Bah
+ *
+ * Released under GNU GPL, read the file 'COPYING' for more information
+ */
+
+/**
+ An action (menu/toolbar item) that allows selecting one choice out of many.
+
+ The choices may be displayed as:
+
+ 1. A group of items in a toolbar with labels and/or icons.
+ 2. As a drop-down menu with a labels and/or icons.
+*/
+
+#include <gtkmm/action.h>
+#include <gtkmm/liststore.h>
+#include <sigc++/sigc++.h>
+#include <vector>
+
+namespace Gtk {
+class ComboBox;
+class RadioAction;
+class MenuItem;
+class RadioMenuItem;
+}
+
+class InkSelectOneActionColumns : public Gtk::TreeModel::ColumnRecord {
+
+public:
+ InkSelectOneActionColumns() {
+ add (col_label);
+ add (col_icon);
+ add (col_tooltip);
+ add (col_sensitive);
+ }
+ Gtk::TreeModelColumn<Glib::ustring> col_label;
+ Gtk::TreeModelColumn<Glib::ustring> col_icon;
+ Gtk::TreeModelColumn<Glib::ustring> col_tooltip;
+ Gtk::TreeModelColumn<bool> col_sensitive;
+};
+
+
+class InkSelectOneAction : public Gtk::Action {
+
+public:
+
+ static InkSelectOneAction* create(const Glib::ustring &name,
+ const Glib::ustring &label,
+ const Glib::ustring &tooltip,
+ const Glib::ustring &stock_id,
+ Glib::RefPtr<Gtk::ListStore> store );
+
+ /* Style of action */
+ void use_radio( bool use_radio ) { _use_radio = use_radio; }
+ void use_label( bool use_label ) { _use_label = use_label; }
+ void use_icon( bool use_icon ) { _use_icon = use_icon; }
+
+ gint get_active() { return _active; }
+ void set_active( gint active );
+ void set_icon_size( Gtk::BuiltinIconSize size ) { _icon_size = size; }
+
+ Glib::RefPtr<Gtk::ListStore> get_store() { return _store; }
+
+ sigc::signal<void, int> signal_changed() { return _changed; }
+
+protected:
+
+ virtual Gtk::Widget* create_menu_item_vfunc();
+ virtual Gtk::Widget* create_tool_item_vfunc();
+
+ /* Signals */
+ sigc::signal<void, int> _changed;
+
+private:
+
+ Glib::ustring _name;
+ Glib::ustring _label;
+ Glib::ustring _tooltip;
+ Glib::ustring _stock_id;
+ Glib::RefPtr<Gtk::ListStore> _store;
+
+ gint _active; /* Active menu item/button */
+
+ /* Style */
+ bool _use_radio; // Applies to tool item only
+ bool _use_label;
+ bool _use_icon; // Applies to menu item only
+ Gtk::BuiltinIconSize _icon_size;
+
+ /* Combobox in tool */
+ Gtk::ComboBox* _combobox;
+
+ /* Need to track one action to get active action. */
+ Glib::RefPtr<Gtk::RadioAction> _radioaction;
+
+ Gtk::MenuItem* _menuitem;
+ std::vector<Gtk::RadioMenuItem*> _radiomenuitems;
+
+ /* Internal Callbacks */
+ void on_changed_combobox();
+ void on_changed_radioaction(const Glib::RefPtr<Gtk::RadioAction>& current);
+ void on_toggled_radiomenu(int n);
+
+ InkSelectOneAction (const Glib::ustring &name,
+ const Glib::ustring &label,
+ const Glib::ustring &tooltip,
+ const Glib::ustring &stock_id,
+ Glib::RefPtr<Gtk::ListStore> store );
+
+};
+
+
+#endif /* SEEN_INK_SELECT_ONE_ACTION */
+
+/*
+ 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:fileencoding=utf-8:textwidth=99 :
diff --git a/src/ui/widget/page-sizer.cpp b/src/ui/widget/page-sizer.cpp
index bb88536d5..3ec6a2b9f 100644
--- a/src/ui/widget/page-sizer.cpp
+++ b/src/ui/widget/page-sizer.cpp
@@ -225,7 +225,7 @@ PageSizer::PageSizer(Registry & _wr)
_marginBottom( _("Botto_m:"), _("Bottom margin"), "fit-margin-bottom", _wr),
_lockMarginUpdate(false),
_scaleX(_("Scale _x:"), _("Scale X"), "scale-x", _wr),
- _scaleY(_("Scale _y:"), _("Scale Y"), "scale-y", _wr),
+ _scaleY(_("Scale _y:"), _("While SVG allows non-uniform scaling it is recommended to use only uniform scaling in Inkscape. To set a non-uniform scaling, set the 'viewBox' directly."), "scale-y", _wr),
_lockScaleUpdate(false),
_viewboxX(_("X:"), _("X"), "viewbox-x", _wr),
_viewboxY(_("Y:"), _("Y"), "viewbox-y", _wr),
@@ -416,13 +416,9 @@ PageSizer::PageSizer(Registry & _wr)
_scaleTable.attach(_scaleY, 1, 0, 1, 1);
_scaleTable.attach(_scaleLabel, 2, 0, 1, 1);
- _scaleTable.attach(_scaleWarning, 0, 1, 2, 1);
_viewboxExpander.set_hexpand();
_viewboxExpander.set_vexpand();
_scaleTable.attach(_viewboxExpander, 0, 2, 2, 1);
-
- _scaleWarning.set_label(_("While SVG allows non-uniform scaling it is recommended to use only uniform scaling in Inkscape. To set a non-uniform scaling, set the 'viewBox' directly."));
- _scaleWarning.set_line_wrap( true );
_viewboxExpander.set_use_underline();
_viewboxExpander.set_label(_("_Viewbox..."));
diff --git a/src/ui/widget/page-sizer.h b/src/ui/widget/page-sizer.h
index d0655fb0e..f84f96782 100644
--- a/src/ui/widget/page-sizer.h
+++ b/src/ui/widget/page-sizer.h
@@ -238,7 +238,6 @@ protected:
Gtk::Grid _scaleTable;
Gtk::Label _scaleLabel;
- Gtk::Label _scaleWarning;
RegisteredScalar _scaleX;
RegisteredScalar _scaleY;
bool _lockScaleUpdate;
diff --git a/src/widgets/text-toolbar.cpp b/src/widgets/text-toolbar.cpp
index 272125631..0c0e75ad0 100644
--- a/src/widgets/text-toolbar.cpp
+++ b/src/widgets/text-toolbar.cpp
@@ -37,7 +37,6 @@
#include "document-undo.h"
#include "document.h"
#include "widgets/ege-adjustment-action.h"
-#include "widgets/ege-select-one-action.h"
#include "ink-radio-action.h"
#include "ink-toggle-action.h"
#include "widgets/ink-comboboxentry-action.h"
@@ -54,6 +53,7 @@
#include "ui/icon-names.h"
#include "ui/tools/text-tool.h"
#include "ui/widget/unit-tracker.h"
+#include "ui/widget/ink-select-one-action.h"
#include "verbs.h"
using Inkscape::DocumentUndo;
@@ -435,7 +435,7 @@ static void sp_text_script_changed( InkToggleAction* act, GObject *tbl )
g_object_set_data( tbl, "freeze", GINT_TO_POINTER(FALSE) );
}
-static void sp_text_align_mode_changed( EgeSelectOneAction *act, GObject *tbl )
+static void sp_text_align_mode_changed( GObject *tbl, int mode )
{
// quit if run by the _changed callbacks
if (g_object_get_data(G_OBJECT(tbl), "freeze")) {
@@ -443,8 +443,6 @@ static void sp_text_align_mode_changed( EgeSelectOneAction *act, GObject *tbl )
}
g_object_set_data( tbl, "freeze", GINT_TO_POINTER(TRUE) );
- int mode = ege_select_one_action_get_active( act );
-
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
prefs->setInt("/tools/text/align_mode", mode);
@@ -1033,7 +1031,7 @@ static void sp_text_rotation_value_changed( GtkAdjustment *adj, GObject *tbl )
g_object_set_data( tbl, "freeze", GINT_TO_POINTER(FALSE) );
}
-static void sp_writing_mode_changed( EgeSelectOneAction *act, GObject *tbl )
+static void sp_writing_mode_changed( GObject* tbl, int mode )
{
// quit if run by the _changed callbacks
if (g_object_get_data(G_OBJECT(tbl), "freeze")) {
@@ -1041,8 +1039,6 @@ static void sp_writing_mode_changed( EgeSelectOneAction *act, GObject *tbl )
}
g_object_set_data( tbl, "freeze", GINT_TO_POINTER(TRUE) );
- int mode = ege_select_one_action_get_active( act );
-
SPCSSAttr *css = sp_repr_css_attr_new ();
switch (mode)
{
@@ -1058,7 +1054,7 @@ static void sp_writing_mode_changed( EgeSelectOneAction *act, GObject *tbl )
break;
}
- case 2:
+ case 2:
{
sp_repr_css_set_property (css, "writing-mode", "vertical-lr");
break;
@@ -1087,7 +1083,7 @@ static void sp_writing_mode_changed( EgeSelectOneAction *act, GObject *tbl )
g_object_set_data( tbl, "freeze", GINT_TO_POINTER(FALSE) );
}
-static void sp_text_orientation_changed( EgeSelectOneAction *act, GObject *tbl )
+static void sp_text_orientation_changed( GObject* tbl, int mode )
{
// quit if run by the _changed callbacks
if (g_object_get_data(G_OBJECT(tbl), "freeze")) {
@@ -1095,8 +1091,6 @@ static void sp_text_orientation_changed( EgeSelectOneAction *act, GObject *tbl )
}
g_object_set_data( tbl, "freeze", GINT_TO_POINTER(TRUE) );
- int mode = ege_select_one_action_get_active( act );
-
SPCSSAttr *css = sp_repr_css_attr_new ();
switch (mode)
{
@@ -1141,7 +1135,7 @@ static void sp_text_orientation_changed( EgeSelectOneAction *act, GObject *tbl )
g_object_set_data( tbl, "freeze", GINT_TO_POINTER(FALSE) );
}
-static void sp_text_direction_changed( EgeSelectOneAction *act, GObject *tbl )
+static void sp_text_direction_changed( GObject *tbl, int mode )
{
// quit if run by the _changed callbacks
if (g_object_get_data(G_OBJECT(tbl), "freeze")) {
@@ -1149,7 +1143,6 @@ static void sp_text_direction_changed( EgeSelectOneAction *act, GObject *tbl )
}
g_object_set_data( tbl, "freeze", GINT_TO_POINTER(TRUE) );
- int mode = ege_select_one_action_get_active( act );
SPCSSAttr *css = sp_repr_css_attr_new ();
switch (mode)
{
@@ -1396,24 +1389,18 @@ static void sp_text_toolbox_selection_changed(Inkscape::Selection */*selection*/
// Alignment
- EgeSelectOneAction* textAlignAction = EGE_SELECT_ONE_ACTION( g_object_get_data( tbl, "TextAlignAction" ) );
+ InkSelectOneAction* textAlignAction =
+ static_cast<InkSelectOneAction*>( g_object_get_data( tbl, "TextAlignAction" ) );
// Note: SVG 1.1 doesn't include text-align, SVG 1.2 Tiny doesn't include text-align="justify"
// text-align="justify" was a draft SVG 1.2 item (along with flowed text).
// Only flowed text can be left and right justified at the same time.
// Disable button if we don't have flowed text.
- // The GtkTreeModel class doesn't have a set function so we can't
- // simply add an ege_select_one_action_set_sensitive method!
- // We must set values directly with the GtkListStore and then
- // ask that the GtkAction update the sensitive parameters.
- GtkListStore * model = GTK_LIST_STORE( ege_select_one_action_get_model( textAlignAction ) );
- GtkTreePath * path = gtk_tree_path_new_from_string("3"); // Justify entry
- GtkTreeIter iter;
- gtk_tree_model_get_iter( GTK_TREE_MODEL (model), &iter, path );
- gtk_list_store_set( model, &iter, /* column */ 3, isFlow, -1 );
- ege_select_one_action_update_sensitive( textAlignAction );
- // ege_select_one_action_set_sensitive( textAlignAction, 3, isFlow );
+ Glib::RefPtr<Gtk::ListStore> store = textAlignAction->get_store();
+ Gtk::TreeModel::Row row = *(store->get_iter("3")); // Justify entry
+ InkSelectOneActionColumns columns;
+ row[columns.col_sensitive] = isFlow;
int activeButton = 0;
if (query.text_align.computed == SP_CSS_TEXT_ALIGN_JUSTIFY)
@@ -1425,8 +1412,7 @@ static void sp_text_toolbox_selection_changed(Inkscape::Selection */*selection*/
if (query.text_anchor.computed == SP_CSS_TEXT_ANCHOR_MIDDLE) activeButton = 1;
if (query.text_anchor.computed == SP_CSS_TEXT_ANCHOR_END) activeButton = 2;
}
- ege_select_one_action_set_active( textAlignAction, activeButton );
-
+ textAlignAction->set_active( activeButton );
// Line height (spacing) and line height unit
double height;
@@ -1520,9 +1506,9 @@ static void sp_text_toolbox_selection_changed(Inkscape::Selection */*selection*/
if (query.writing_mode.computed == SP_CSS_WRITING_MODE_TB_RL) activeButton2 = 1;
if (query.writing_mode.computed == SP_CSS_WRITING_MODE_TB_LR) activeButton2 = 2;
- EgeSelectOneAction* writingModeAction =
- EGE_SELECT_ONE_ACTION( g_object_get_data( tbl, "TextWritingModeAction" ) );
- ege_select_one_action_set_active( writingModeAction, activeButton2 );
+ InkSelectOneAction* writingModeAction =
+ static_cast<InkSelectOneAction*>( g_object_get_data( tbl, "TextWritingModeAction" ) );
+ writingModeAction->set_active( activeButton2 );
// Orientation
int activeButton3 = 0;
@@ -1530,35 +1516,20 @@ static void sp_text_toolbox_selection_changed(Inkscape::Selection */*selection*/
if (query.text_orientation.computed == SP_CSS_TEXT_ORIENTATION_UPRIGHT ) activeButton3 = 1;
if (query.text_orientation.computed == SP_CSS_TEXT_ORIENTATION_SIDEWAYS) activeButton3 = 2;
- EgeSelectOneAction* textOrientationAction =
- EGE_SELECT_ONE_ACTION( g_object_get_data( tbl, "TextOrientationAction" ) );
- ege_select_one_action_set_active( textOrientationAction, activeButton3 );
-
- // Disable text orientation for horizontal text.. See above for why this nonsense
- model = GTK_LIST_STORE( ege_select_one_action_get_model( textOrientationAction ) );
-
- path = gtk_tree_path_new_from_string("0");
- gtk_tree_model_get_iter( GTK_TREE_MODEL (model), &iter, path );
- gtk_list_store_set( model, &iter, /* column */ 3, activeButton2 != 0, -1 );
-
- path = gtk_tree_path_new_from_string("1");
- gtk_tree_model_get_iter( GTK_TREE_MODEL (model), &iter, path );
- gtk_list_store_set( model, &iter, /* column */ 3, activeButton2 != 0, -1 );
+ InkSelectOneAction* textOrientationAction =
+ static_cast<InkSelectOneAction*>( g_object_get_data( tbl, "TextOrientationAction" ) );
+ textOrientationAction->set_active( activeButton3 );
- path = gtk_tree_path_new_from_string("2");
- gtk_tree_model_get_iter( GTK_TREE_MODEL (model), &iter, path );
- gtk_list_store_set( model, &iter, /* column */ 3, activeButton2 != 0, -1 );
-
- ege_select_one_action_update_sensitive( textOrientationAction );
+ // Disable text orientation for horizontal text...
+ textOrientationAction->set_sensitive( activeButton2 != 0 );
// Direction
int activeButton4 = 0;
if (query.direction.computed == SP_CSS_DIRECTION_LTR ) activeButton4 = 0;
if (query.direction.computed == SP_CSS_DIRECTION_RTL ) activeButton4 = 1;
- EgeSelectOneAction* textDirectionAction =
- EGE_SELECT_ONE_ACTION( g_object_get_data( tbl, "TextDirectionAction" ) );
- ege_select_one_action_set_active( textDirectionAction, activeButton4 );
-
+ InkSelectOneAction* textDirectionAction =
+ static_cast<InkSelectOneAction*>( g_object_get_data( tbl, "TextDirectionAction" ) );
+ textDirectionAction->set_active( activeButton4 );
}
#ifdef DEBUG_TEXT
@@ -1832,209 +1803,175 @@ void sp_text_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GObje
/* Alignment */
{
- GtkListStore* model = gtk_list_store_new( 4, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN );
-
- GtkTreeIter iter;
+ InkSelectOneActionColumns columns;
+
+ Glib::RefPtr<Gtk::ListStore> store = Gtk::ListStore::create(columns);
+
+ Gtk::TreeModel::Row row;
+
+ row = *(store->append());
+ row[columns.col_label ] = _("Align left");
+ row[columns.col_tooltip ] = _("Align left");
+ row[columns.col_icon ] = INKSCAPE_ICON("format-justify-left");
+ row[columns.col_sensitive] = true;
+
+ row = *(store->append());
+ row[columns.col_label ] = _("Align center");
+ row[columns.col_tooltip ] = _("Align center");
+ row[columns.col_icon ] = INKSCAPE_ICON("format-justify-center");
+ row[columns.col_sensitive] = true;
+
+ row = *(store->append());
+ row[columns.col_label ] = _("Align right");
+ row[columns.col_tooltip ] = _("Align right");
+ row[columns.col_icon ] = INKSCAPE_ICON("format-justify-right");
+ row[columns.col_sensitive] = true;
+
+ row = *(store->append());
+ row[columns.col_label ] = _("Justify");
+ row[columns.col_tooltip ] = _("Justify (only flowed text)");
+ row[columns.col_icon ] = INKSCAPE_ICON("format-justify-fill");
+ row[columns.col_sensitive] = false;
+
+ InkSelectOneAction* act =
+ InkSelectOneAction::create( "TextAlignAction", // Name
+ _("Alignment"), // Label
+ _("Text alignment"), // Tooltip
+ "Not Used", // Icon
+ store ); // Tree store
+ act->use_radio( false );
+ act->use_label( false );
+ gint mode = prefs->getInt("/tools/text/align_mode", 0);
+ act->set_active( mode );
- gtk_list_store_append( model, &iter );
- gtk_list_store_set( model, &iter,
- 0, _("Align left"),
- 1, _("Align left"),
- 2, INKSCAPE_ICON("format-justify-left"),
- 3, true,
- -1 );
-
- gtk_list_store_append( model, &iter );
- gtk_list_store_set( model, &iter,
- 0, _("Align center"),
- 1, _("Align center"),
- 2, INKSCAPE_ICON("format-justify-center"),
- 3, true,
- -1 );
-
- gtk_list_store_append( model, &iter );
- gtk_list_store_set( model, &iter,
- 0, _("Align right"),
- 1, _("Align right"),
- 2, INKSCAPE_ICON("format-justify-right"),
- 3, true,
- -1 );
-
- gtk_list_store_append( model, &iter );
- gtk_list_store_set( model, &iter,
- 0, _("Justify"),
- 1, _("Justify (only flowed text)"),
- 2, INKSCAPE_ICON("format-justify-fill"),
- 3, false,
- -1 );
-
- EgeSelectOneAction* act = ege_select_one_action_new( "TextAlignAction", // Name
- _("Alignment"), // Label
- _("Text alignment"), // Tooltip
- NULL, // Icon name
- GTK_TREE_MODEL(model) ); // Model
- g_object_set( act, "short_label", "NotUsed", NULL );
- gtk_action_group_add_action( mainActions, GTK_ACTION(act) );
+ gtk_action_group_add_action( mainActions, GTK_ACTION( act->gobj() ));
g_object_set_data( holder, "TextAlignAction", act );
- ege_select_one_action_set_appearance( act, "full" );
- ege_select_one_action_set_radio_action_type( act, INK_RADIO_ACTION_TYPE );
- g_object_set( G_OBJECT(act), "icon-property", "iconId", NULL );
- ege_select_one_action_set_icon_column( act, 2 );
- ege_select_one_action_set_icon_size( act, secondarySize );
- ege_select_one_action_set_tooltip_column( act, 1 );
- ege_select_one_action_set_sensitive_column( act, 3 );
- gint mode = prefs->getInt("/tools/text/align_mode", 0);
- ege_select_one_action_set_active( act, mode );
- g_signal_connect_after( G_OBJECT(act), "changed", G_CALLBACK(sp_text_align_mode_changed), holder );
+ act->signal_changed().connect(sigc::bind<0>(sigc::ptr_fun(&sp_text_align_mode_changed), holder));
}
/* Writing mode (Horizontal, Vertical-LR, Vertical-RL) */
{
- GtkListStore* model = gtk_list_store_new( 3, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING );
-
- GtkTreeIter iter;
+ InkSelectOneActionColumns columns;
+
+ Glib::RefPtr<Gtk::ListStore> store = Gtk::ListStore::create(columns);
+
+ Gtk::TreeModel::Row row;
+
+ row = *(store->append());
+ row[columns.col_label ] = _("Horizontal");
+ row[columns.col_tooltip ] = _("Horizontal text");
+ row[columns.col_icon ] = INKSCAPE_ICON("format-text-direction-horizontal");
+ row[columns.col_sensitive] = true;
+
+ row = *(store->append());
+ row[columns.col_label ] = _("Vertical — RL");
+ row[columns.col_tooltip ] = _("Vertical text — lines: right to left");
+ row[columns.col_icon ] = INKSCAPE_ICON("format-text-direction-vertical");
+ row[columns.col_sensitive] = true;
+
+ row = *(store->append());
+ row[columns.col_label ] = _("Vertical — LR");
+ row[columns.col_tooltip ] = _("Vertical text — lines: left to right");
+ row[columns.col_icon ] = INKSCAPE_ICON("format-text-direction-vertical-lr");
+ row[columns.col_sensitive] = true;
+
+ InkSelectOneAction* act =
+ InkSelectOneAction::create( "TextWritingModeAction", // Name
+ _("Writing mode"), // Label
+ _("Block progression"), // Tooltip
+ "Not Used", // Icon
+ store ); // Tree store
+ act->use_radio( false );
+ act->use_label( false );
+ gint mode = prefs->getInt("/tools/text/writing_mode", 0);
+ act->set_active( mode );
- gtk_list_store_append( model, &iter );
- gtk_list_store_set( model, &iter,
- 0, _("Horizontal"),
- 1, _("Horizontal text"),
- 2, INKSCAPE_ICON("format-text-direction-horizontal"),
- -1 );
-
- gtk_list_store_append( model, &iter );
- gtk_list_store_set( model, &iter,
- 0, _("Vertical — RL"),
- 1, _("Vertical text — lines: right to left"),
- 2, INKSCAPE_ICON("format-text-direction-vertical"),
- -1 );
-
- gtk_list_store_append( model, &iter );
- gtk_list_store_set( model, &iter,
- 0, _("Vertical — LR"),
- 1, _("Vertical text — lines: left to right"), // Mongolian!
- 2, INKSCAPE_ICON("format-text-direction-vertical-lr"),
- -1 );
-
- EgeSelectOneAction* act = ege_select_one_action_new( "TextWritingModeAction", // Name
- _("Writing mode"), // Label
- _("Block progression"), // Tooltip
- NULL, // Icon name
- GTK_TREE_MODEL(model) ); // Model
-
- g_object_set( act, "short_label", "NotUsed", NULL );
- gtk_action_group_add_action( mainActions, GTK_ACTION(act) );
+ gtk_action_group_add_action( mainActions, GTK_ACTION( act->gobj() ));
g_object_set_data( holder, "TextWritingModeAction", act );
- ege_select_one_action_set_appearance( act, "full" );
- ege_select_one_action_set_radio_action_type( act, INK_RADIO_ACTION_TYPE );
- g_object_set( G_OBJECT(act), "icon-property", "iconId", NULL );
- ege_select_one_action_set_icon_column( act, 2 );
- ege_select_one_action_set_icon_size( act, secondarySize );
- ege_select_one_action_set_tooltip_column( act, 1 );
-
- gint mode = prefs->getInt("/tools/text/writing_mode", 0);
- ege_select_one_action_set_active( act, mode );
- g_signal_connect_after( G_OBJECT(act), "changed", G_CALLBACK(sp_writing_mode_changed), holder );
+ act->signal_changed().connect(sigc::bind<0>(sigc::ptr_fun(&sp_writing_mode_changed), holder));
}
/* Text (glyph) orientation (Auto (mixed), Upright, Sideways) */
{
- GtkListStore* model = gtk_list_store_new( 4, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN );
-
- GtkTreeIter iter;
+ InkSelectOneActionColumns columns;
+
+ Glib::RefPtr<Gtk::ListStore> store = Gtk::ListStore::create(columns);
+
+ Gtk::TreeModel::Row row;
+
+ row = *(store->append());
+ row[columns.col_label ] = _("Auto");
+ row[columns.col_tooltip ] = _("Auto glyph orientation");
+ row[columns.col_icon ] = INKSCAPE_ICON("text-orientation-auto");
+ row[columns.col_sensitive] = true;
+
+ row = *(store->append());
+ row[columns.col_label ] = _("Upright");
+ row[columns.col_tooltip ] = _("Upright glyph orientation");
+ row[columns.col_icon ] = INKSCAPE_ICON("text-orientation-upright");
+ row[columns.col_sensitive] = true;
+
+ row = *(store->append());
+ row[columns.col_label ] = _("Sideways");
+ row[columns.col_tooltip ] = _("Sideways glyph orientation");
+ row[columns.col_icon ] = INKSCAPE_ICON("text-orientation-sideways");
+ row[columns.col_sensitive] = true;
+
+ InkSelectOneAction* act =
+ InkSelectOneAction::create( "TextOrientationAction", // Name
+ _("Text orientation"), // Label
+ _("Text (glyph) orientation in vertical text."), // Tooltip
+ "Not Used", // Icon
+ store ); // List store
+ act->use_radio( false );
+ act->use_label( false );
+ gint mode = prefs->getInt("/tools/text/text_orientation", 0);
+ act->set_active( mode );
- gtk_list_store_append( model, &iter );
- gtk_list_store_set( model, &iter,
- 0, _("Auto"),
- 1, _("Auto glyph orientation"),
- 2, INKSCAPE_ICON("text-orientation-auto"),
- 3, true,
- -1 );
-
- gtk_list_store_append( model, &iter );
- gtk_list_store_set( model, &iter,
- 0, _("Upright"),
- 1, _("Upright glyph orientation"),
- 2, INKSCAPE_ICON("text-orientation-upright"),
- 3, true,
- -1 );
-
- gtk_list_store_append( model, &iter );
- gtk_list_store_set( model, &iter,
- 0, _("Sideways"),
- 1, _("Sideways glyph orientation"),
- 2, INKSCAPE_ICON("text-orientation-sideways"),
- 3, true,
- -1 );
-
- EgeSelectOneAction* act = ege_select_one_action_new( "TextOrientationAction", // Name
- _("Text orientation"), // Label
- _("Text (glyph) orientation in vertical text."), // Tooltip
- NULL, // Icon name
- GTK_TREE_MODEL(model) ); // Model
-
- g_object_set( act, "short_label", "NotUsed", NULL );
- gtk_action_group_add_action( mainActions, GTK_ACTION(act) );
+ gtk_action_group_add_action( mainActions, GTK_ACTION( act->gobj() ));
g_object_set_data( holder, "TextOrientationAction", act );
- ege_select_one_action_set_appearance( act, "full" );
- ege_select_one_action_set_radio_action_type( act, INK_RADIO_ACTION_TYPE );
- g_object_set( G_OBJECT(act), "icon-property", "iconId", NULL );
- ege_select_one_action_set_icon_column( act, 2 );
- ege_select_one_action_set_icon_size( act, secondarySize );
- ege_select_one_action_set_tooltip_column( act, 1 );
- ege_select_one_action_set_sensitive_column( act, 3 );
-
- gint mode = prefs->getInt("/tools/text/text_orientation", 0);
- ege_select_one_action_set_active( act, mode );
- g_signal_connect_after( G_OBJECT(act), "changed", G_CALLBACK(sp_text_orientation_changed), holder );
+ act->signal_changed().connect(sigc::bind<0>(sigc::ptr_fun(&sp_text_orientation_changed), holder));
}
// Text direction (predominant direction of horizontal text).
{
- GtkListStore* model = gtk_list_store_new( 4, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN );
-
- GtkTreeIter iter;
+ InkSelectOneActionColumns columns;
+
+ Glib::RefPtr<Gtk::ListStore> store = Gtk::ListStore::create(columns);
+
+ Gtk::TreeModel::Row row;
+
+ row = *(store->append());
+ row[columns.col_label ] = _("LTR");
+ row[columns.col_tooltip ] = _("Left to right text");
+ row[columns.col_icon ] = INKSCAPE_ICON("format-text-direction-horizontal");
+ row[columns.col_sensitive] = true;
+
+ row = *(store->append());
+ row[columns.col_label ] = _("RTL");
+ row[columns.col_tooltip ] = _("Right to left text");
+ row[columns.col_icon ] = INKSCAPE_ICON("format-text-direction-r2l");
+ row[columns.col_sensitive] = true;
+
+ InkSelectOneAction* act =
+ InkSelectOneAction::create( "TextDirectionAction", // Name
+ _("Text direction"), // Label
+ _("Text direction for normally horizontal text."), // Tooltip
+ "Not Used", // Icon
+ store ); // List store
+ act->use_radio( false );
+ act->use_label( false );
+ gint mode = prefs->getInt("/tools/text/text_direction", 0);
+ act->set_active( mode );
- gtk_list_store_append( model, &iter );
- gtk_list_store_set( model, &iter,
- 0, _("LTR"),
- 1, _("Left to right text"),
- 2, INKSCAPE_ICON("format-text-direction-horizontal"),
- 3, true,
- -1 );
-
- gtk_list_store_append( model, &iter );
- gtk_list_store_set( model, &iter,
- 0, _("RTL"),
- 1, _("Right to left text"),
- 2, INKSCAPE_ICON("format-text-direction-r2l"),
- 3, true,
- -1 );
-
- EgeSelectOneAction* act = ege_select_one_action_new( "TextDirectionAction", // Name
- _("Text direction"), // Label
- _("Text direction for normally horizontal text."), // Tooltip
- NULL, // Icon name
- GTK_TREE_MODEL(model) ); // Model
-
- g_object_set( act, "short_label", "NotUsed", NULL );
- gtk_action_group_add_action( mainActions, GTK_ACTION(act) );
+ gtk_action_group_add_action( mainActions, GTK_ACTION( act->gobj() ));
g_object_set_data( holder, "TextDirectionAction", act );
- ege_select_one_action_set_appearance( act, "full" );
- ege_select_one_action_set_radio_action_type( act, INK_RADIO_ACTION_TYPE );
- g_object_set( G_OBJECT(act), "icon-property", "iconId", NULL );
- ege_select_one_action_set_icon_column( act, 2 );
- ege_select_one_action_set_icon_size( act, secondarySize );
- ege_select_one_action_set_tooltip_column( act, 1 );
- ege_select_one_action_set_sensitive_column( act, 3 );
-
- gint mode = prefs->getInt("/tools/text/text_direction", 0);
- ege_select_one_action_set_active( act, mode );
- g_signal_connect_after( G_OBJECT(act), "changed", G_CALLBACK(sp_text_direction_changed), holder );
+ act->signal_changed().connect(sigc::bind<0>(sigc::ptr_fun(&sp_text_direction_changed), holder));
}
/* Line height unit tracker */