diff options
| author | Jabier Arraiza <jabier.arraiza@marker.es> | 2019-06-10 14:14:58 +0000 |
|---|---|---|
| committer | Jabier Arraiza <jabier.arraiza@marker.es> | 2019-06-10 14:15:25 +0000 |
| commit | f958a8f1d4e5ac324207aaaeb0c81a84b0646d1a (patch) | |
| tree | ba5b070b2cfdc98e59b0fe7d54176ea8eb1b41bf | |
| parent | Fix typo bug found by PeterK (diff) | |
| download | inkscape-f958a8f1d4e5ac324207aaaeb0c81a84b0646d1a.tar.gz inkscape-f958a8f1d4e5ac324207aaaeb0c81a84b0646d1a.zip | |
Move from XMLDialog to another paned dialog
23 files changed, 334 insertions, 204 deletions
diff --git a/po/POTFILES.src.in b/po/POTFILES.src.in index 4829de828..10fc21cc3 100644 --- a/po/POTFILES.src.in +++ b/po/POTFILES.src.in @@ -278,7 +278,7 @@ ../src/ui/dialog/print-colors-preview-dialog.cpp ../src/ui/dialog/print.cpp ../src/ui/dialog/save-template-dialog.cpp -../src/ui/dialog/selectordialog.cpp +../src/ui/dialog/selectorsdialog.cpp ../src/ui/dialog/spellcheck.cpp ../src/ui/dialog/styledialog.cpp ../src/ui/dialog/svg-fonts-dialog.cpp diff --git a/share/icons/Tango/scalable/actions/dialog-selectors.svg b/share/icons/Tango/scalable/actions/dialog-selectors.svg new file mode 100644 index 000000000..390534e7e --- /dev/null +++ b/share/icons/Tango/scalable/actions/dialog-selectors.svg @@ -0,0 +1,26 @@ +<?xml version='1.0' encoding='UTF-8'?> +<!-- Created with Inkscape (http://www.inkscape.org/) and export_objects.py --> +<svg xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" version="1.1" id="svg1" width="16" height="16" viewBox="0 0 16 16"> +<sodipodi:namedview + objecttolerance="10" + gridtolerance="10" + guidetolerance="10" + id="namedview" + showgrid="true" + inkscape:zoom="27.166187" + inkscape:cx="7.4837792" + inkscape:cy="8.9906751" + inkscape:window-x="0" + inkscape:window-y="27"> + <inkscape:grid type="xygrid" id="grid"/> + </sodipodi:namedview> + <g inkscape:groupmode="layer" + id="layercompo" + inkscape:label="dialogselector"> + <path + id="rect22048" + d="M 0,0 H 16 V 16 H 0 Z" + style="opacity:0;fill:none" /> +<path id="rect1045" d="m 14.259386,6.8086608 h -1.59722 V 6.3184655 q 0,-0.3431367 -0.06127,-0.4370908 -0.06128,-0.093954 -0.204248,-0.093954 -0.155229,0 -0.236928,0.1266338 -0.07761,0.1266338 -0.07761,0.3839863 0,0.3308818 0.08987,0.4983652 0.08578,0.1674834 0.48611,0.4044112 1.147874,0.6821885 1.446076,1.1192793 0.298202,0.4370908 0.298202,1.4093116 0,0.7066979 -0.167483,1.0416649 -0.163398,0.334967 -0.637254,0.563725 -0.473855,0.224672 -1.102939,0.224672 -0.690359,0 -1.180554,-0.261437 Q 10.828027,11.036595 10.676884,10.632184 10.52574,10.227773 10.52574,9.4843104 v -0.433006 h 1.59722 v 0.8047373 q 0,0.3717313 0.06536,0.4779403 0.06944,0.106209 0.241012,0.106209 0.171569,0 0.253268,-0.134804 0.08578,-0.134803 0.08578,-0.4003257 0,-0.5841494 -0.159313,-0.7638877 Q 12.445663,8.9614353 11.804324,8.5406843 11.162985,8.1158483 10.954652,7.9238552 10.746319,7.731862 10.607431,7.3928102 10.472627,7.0537585 10.472627,6.5267985 q 0,-0.7598027 0.191993,-1.1111094 0.196078,-0.3513066 0.629084,-0.5473848 0.433006,-0.2001631 1.04575,-0.2001631 0.669934,0 1.139704,0.216503 0.473856,0.2165029 0.624999,0.5473848 0.155229,0.3267968 0.155229,1.1151943 z m -4.3300588,0 H 8.3321074 V 6.3184655 q 0,-0.3431367 -0.061274,-0.4370908 -0.061274,-0.093954 -0.204248,-0.093954 -0.1552286,0 -0.2369278,0.1266338 -0.077614,0.1266338 -0.077614,0.3839863 0,0.3308818 0.089869,0.4983652 0.085784,0.1674834 0.4861104,0.4044112 1.147874,0.6821885 1.4460762,1.1192793 0.2982028,0.4370908 0.2982028,1.4093116 0,0.7066979 -0.1674841,1.0416649 Q 9.741419,11.10604 9.2675635,11.334798 8.793708,11.55947 8.164624,11.55947 q -0.6903584,0 -1.1805537,-0.261437 Q 6.4979599,11.036595 6.3468164,10.632184 6.1956728,10.227773 6.1956728,9.4843103 V 9.0513044 h 1.5972198 v 0.8047373 q 0,0.3717313 0.065359,0.4779403 0.069444,0.106209 0.2410127,0.106209 0.1715684,0 0.2532676,-0.134804 0.085784,-0.134803 0.085784,-0.4003257 0,-0.5841494 -0.1593135,-0.7638877 Q 8.1156045,8.9614353 7.4742656,8.5406843 6.8329267,8.1158483 6.6245937,7.9238552 6.4162607,7.731862 6.277372,7.3928102 6.1425683,7.0537585 6.1425683,6.5267985 q 0,-0.7598027 0.1919932,-1.1111094 0.1960781,-0.3513066 0.629084,-0.5473848 0.4330058,-0.2001631 1.04575,-0.2001631 0.6699336,0 1.1397041,0.216503 0.4738555,0.2165029 0.6249991,0.5473848 0.1552285,0.3267968 0.1552285,1.1151943 z M 5.6605428,7.6910124 H 3.9407742 v -1.151959 q 0,-0.5024502 -0.057189,-0.624999 -0.053104,-0.1266338 -0.2410127,-0.1266338 -0.212418,0 -0.2696074,0.1511435 -0.057189,0.1511436 -0.057189,0.6535938 v 3.0718907 q 0,0.4820254 0.057189,0.6290844 0.057189,0.147058 0.2573525,0.147058 0.1919932,0 0.2491826,-0.147058 0.061274,-0.147059 0.061274,-0.6903588 V 8.7735271 h 1.7197686 v 0.2573525 q 0,1.0253254 -0.1470586,1.4542464 -0.1429736,0.428921 -0.6413388,0.751633 -0.4942803,0.322711 -1.2214034,0.322711 -0.7557178,0 -1.2459131,-0.273692 Q 1.9146336,11.012086 1.7553201,10.53006 1.5960066,10.04395 1.5960066,9.0717292 V 7.1395427 q 0,-0.7148682 0.049019,-1.0702598 Q 1.6940457,5.7098063 1.9350584,5.3789245 2.180156,5.0480426 2.6090769,4.8601344 3.0420828,4.6681412 3.6017225,4.6681412 q 0.7598027,0 1.254083,0.2941172 0.4942803,0.2941172 0.6495088,0.735293 0.1552285,0.4370909 0.1552285,1.364377 z" style="opacity:1" /> +</g> +</svg> diff --git a/share/icons/hicolor/scalable/actions/dialog-selectors.svg b/share/icons/hicolor/scalable/actions/dialog-selectors.svg new file mode 100644 index 000000000..390534e7e --- /dev/null +++ b/share/icons/hicolor/scalable/actions/dialog-selectors.svg @@ -0,0 +1,26 @@ +<?xml version='1.0' encoding='UTF-8'?> +<!-- Created with Inkscape (http://www.inkscape.org/) and export_objects.py --> +<svg xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" version="1.1" id="svg1" width="16" height="16" viewBox="0 0 16 16"> +<sodipodi:namedview + objecttolerance="10" + gridtolerance="10" + guidetolerance="10" + id="namedview" + showgrid="true" + inkscape:zoom="27.166187" + inkscape:cx="7.4837792" + inkscape:cy="8.9906751" + inkscape:window-x="0" + inkscape:window-y="27"> + <inkscape:grid type="xygrid" id="grid"/> + </sodipodi:namedview> + <g inkscape:groupmode="layer" + id="layercompo" + inkscape:label="dialogselector"> + <path + id="rect22048" + d="M 0,0 H 16 V 16 H 0 Z" + style="opacity:0;fill:none" /> +<path id="rect1045" d="m 14.259386,6.8086608 h -1.59722 V 6.3184655 q 0,-0.3431367 -0.06127,-0.4370908 -0.06128,-0.093954 -0.204248,-0.093954 -0.155229,0 -0.236928,0.1266338 -0.07761,0.1266338 -0.07761,0.3839863 0,0.3308818 0.08987,0.4983652 0.08578,0.1674834 0.48611,0.4044112 1.147874,0.6821885 1.446076,1.1192793 0.298202,0.4370908 0.298202,1.4093116 0,0.7066979 -0.167483,1.0416649 -0.163398,0.334967 -0.637254,0.563725 -0.473855,0.224672 -1.102939,0.224672 -0.690359,0 -1.180554,-0.261437 Q 10.828027,11.036595 10.676884,10.632184 10.52574,10.227773 10.52574,9.4843104 v -0.433006 h 1.59722 v 0.8047373 q 0,0.3717313 0.06536,0.4779403 0.06944,0.106209 0.241012,0.106209 0.171569,0 0.253268,-0.134804 0.08578,-0.134803 0.08578,-0.4003257 0,-0.5841494 -0.159313,-0.7638877 Q 12.445663,8.9614353 11.804324,8.5406843 11.162985,8.1158483 10.954652,7.9238552 10.746319,7.731862 10.607431,7.3928102 10.472627,7.0537585 10.472627,6.5267985 q 0,-0.7598027 0.191993,-1.1111094 0.196078,-0.3513066 0.629084,-0.5473848 0.433006,-0.2001631 1.04575,-0.2001631 0.669934,0 1.139704,0.216503 0.473856,0.2165029 0.624999,0.5473848 0.155229,0.3267968 0.155229,1.1151943 z m -4.3300588,0 H 8.3321074 V 6.3184655 q 0,-0.3431367 -0.061274,-0.4370908 -0.061274,-0.093954 -0.204248,-0.093954 -0.1552286,0 -0.2369278,0.1266338 -0.077614,0.1266338 -0.077614,0.3839863 0,0.3308818 0.089869,0.4983652 0.085784,0.1674834 0.4861104,0.4044112 1.147874,0.6821885 1.4460762,1.1192793 0.2982028,0.4370908 0.2982028,1.4093116 0,0.7066979 -0.1674841,1.0416649 Q 9.741419,11.10604 9.2675635,11.334798 8.793708,11.55947 8.164624,11.55947 q -0.6903584,0 -1.1805537,-0.261437 Q 6.4979599,11.036595 6.3468164,10.632184 6.1956728,10.227773 6.1956728,9.4843103 V 9.0513044 h 1.5972198 v 0.8047373 q 0,0.3717313 0.065359,0.4779403 0.069444,0.106209 0.2410127,0.106209 0.1715684,0 0.2532676,-0.134804 0.085784,-0.134803 0.085784,-0.4003257 0,-0.5841494 -0.1593135,-0.7638877 Q 8.1156045,8.9614353 7.4742656,8.5406843 6.8329267,8.1158483 6.6245937,7.9238552 6.4162607,7.731862 6.277372,7.3928102 6.1425683,7.0537585 6.1425683,6.5267985 q 0,-0.7598027 0.1919932,-1.1111094 0.1960781,-0.3513066 0.629084,-0.5473848 0.4330058,-0.2001631 1.04575,-0.2001631 0.6699336,0 1.1397041,0.216503 0.4738555,0.2165029 0.6249991,0.5473848 0.1552285,0.3267968 0.1552285,1.1151943 z M 5.6605428,7.6910124 H 3.9407742 v -1.151959 q 0,-0.5024502 -0.057189,-0.624999 -0.053104,-0.1266338 -0.2410127,-0.1266338 -0.212418,0 -0.2696074,0.1511435 -0.057189,0.1511436 -0.057189,0.6535938 v 3.0718907 q 0,0.4820254 0.057189,0.6290844 0.057189,0.147058 0.2573525,0.147058 0.1919932,0 0.2491826,-0.147058 0.061274,-0.147059 0.061274,-0.6903588 V 8.7735271 h 1.7197686 v 0.2573525 q 0,1.0253254 -0.1470586,1.4542464 -0.1429736,0.428921 -0.6413388,0.751633 -0.4942803,0.322711 -1.2214034,0.322711 -0.7557178,0 -1.2459131,-0.273692 Q 1.9146336,11.012086 1.7553201,10.53006 1.5960066,10.04395 1.5960066,9.0717292 V 7.1395427 q 0,-0.7148682 0.049019,-1.0702598 Q 1.6940457,5.7098063 1.9350584,5.3789245 2.180156,5.0480426 2.6090769,4.8601344 3.0420828,4.6681412 3.6017225,4.6681412 q 0.7598027,0 1.254083,0.2941172 0.4942803,0.2941172 0.6495088,0.735293 0.1552285,0.4370909 0.1552285,1.364377 z" style="opacity:1" /> +</g> +</svg> diff --git a/share/icons/hicolor/symbolic/actions/dialog-selectors-symbolic.svg b/share/icons/hicolor/symbolic/actions/dialog-selectors-symbolic.svg new file mode 100644 index 000000000..390534e7e --- /dev/null +++ b/share/icons/hicolor/symbolic/actions/dialog-selectors-symbolic.svg @@ -0,0 +1,26 @@ +<?xml version='1.0' encoding='UTF-8'?> +<!-- Created with Inkscape (http://www.inkscape.org/) and export_objects.py --> +<svg xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" version="1.1" id="svg1" width="16" height="16" viewBox="0 0 16 16"> +<sodipodi:namedview + objecttolerance="10" + gridtolerance="10" + guidetolerance="10" + id="namedview" + showgrid="true" + inkscape:zoom="27.166187" + inkscape:cx="7.4837792" + inkscape:cy="8.9906751" + inkscape:window-x="0" + inkscape:window-y="27"> + <inkscape:grid type="xygrid" id="grid"/> + </sodipodi:namedview> + <g inkscape:groupmode="layer" + id="layercompo" + inkscape:label="dialogselector"> + <path + id="rect22048" + d="M 0,0 H 16 V 16 H 0 Z" + style="opacity:0;fill:none" /> +<path id="rect1045" d="m 14.259386,6.8086608 h -1.59722 V 6.3184655 q 0,-0.3431367 -0.06127,-0.4370908 -0.06128,-0.093954 -0.204248,-0.093954 -0.155229,0 -0.236928,0.1266338 -0.07761,0.1266338 -0.07761,0.3839863 0,0.3308818 0.08987,0.4983652 0.08578,0.1674834 0.48611,0.4044112 1.147874,0.6821885 1.446076,1.1192793 0.298202,0.4370908 0.298202,1.4093116 0,0.7066979 -0.167483,1.0416649 -0.163398,0.334967 -0.637254,0.563725 -0.473855,0.224672 -1.102939,0.224672 -0.690359,0 -1.180554,-0.261437 Q 10.828027,11.036595 10.676884,10.632184 10.52574,10.227773 10.52574,9.4843104 v -0.433006 h 1.59722 v 0.8047373 q 0,0.3717313 0.06536,0.4779403 0.06944,0.106209 0.241012,0.106209 0.171569,0 0.253268,-0.134804 0.08578,-0.134803 0.08578,-0.4003257 0,-0.5841494 -0.159313,-0.7638877 Q 12.445663,8.9614353 11.804324,8.5406843 11.162985,8.1158483 10.954652,7.9238552 10.746319,7.731862 10.607431,7.3928102 10.472627,7.0537585 10.472627,6.5267985 q 0,-0.7598027 0.191993,-1.1111094 0.196078,-0.3513066 0.629084,-0.5473848 0.433006,-0.2001631 1.04575,-0.2001631 0.669934,0 1.139704,0.216503 0.473856,0.2165029 0.624999,0.5473848 0.155229,0.3267968 0.155229,1.1151943 z m -4.3300588,0 H 8.3321074 V 6.3184655 q 0,-0.3431367 -0.061274,-0.4370908 -0.061274,-0.093954 -0.204248,-0.093954 -0.1552286,0 -0.2369278,0.1266338 -0.077614,0.1266338 -0.077614,0.3839863 0,0.3308818 0.089869,0.4983652 0.085784,0.1674834 0.4861104,0.4044112 1.147874,0.6821885 1.4460762,1.1192793 0.2982028,0.4370908 0.2982028,1.4093116 0,0.7066979 -0.1674841,1.0416649 Q 9.741419,11.10604 9.2675635,11.334798 8.793708,11.55947 8.164624,11.55947 q -0.6903584,0 -1.1805537,-0.261437 Q 6.4979599,11.036595 6.3468164,10.632184 6.1956728,10.227773 6.1956728,9.4843103 V 9.0513044 h 1.5972198 v 0.8047373 q 0,0.3717313 0.065359,0.4779403 0.069444,0.106209 0.2410127,0.106209 0.1715684,0 0.2532676,-0.134804 0.085784,-0.134803 0.085784,-0.4003257 0,-0.5841494 -0.1593135,-0.7638877 Q 8.1156045,8.9614353 7.4742656,8.5406843 6.8329267,8.1158483 6.6245937,7.9238552 6.4162607,7.731862 6.277372,7.3928102 6.1425683,7.0537585 6.1425683,6.5267985 q 0,-0.7598027 0.1919932,-1.1111094 0.1960781,-0.3513066 0.629084,-0.5473848 0.4330058,-0.2001631 1.04575,-0.2001631 0.6699336,0 1.1397041,0.216503 0.4738555,0.2165029 0.6249991,0.5473848 0.1552285,0.3267968 0.1552285,1.1151943 z M 5.6605428,7.6910124 H 3.9407742 v -1.151959 q 0,-0.5024502 -0.057189,-0.624999 -0.053104,-0.1266338 -0.2410127,-0.1266338 -0.212418,0 -0.2696074,0.1511435 -0.057189,0.1511436 -0.057189,0.6535938 v 3.0718907 q 0,0.4820254 0.057189,0.6290844 0.057189,0.147058 0.2573525,0.147058 0.1919932,0 0.2491826,-0.147058 0.061274,-0.147059 0.061274,-0.6903588 V 8.7735271 h 1.7197686 v 0.2573525 q 0,1.0253254 -0.1470586,1.4542464 -0.1429736,0.428921 -0.6413388,0.751633 -0.4942803,0.322711 -1.2214034,0.322711 -0.7557178,0 -1.2459131,-0.273692 Q 1.9146336,11.012086 1.7553201,10.53006 1.5960066,10.04395 1.5960066,9.0717292 V 7.1395427 q 0,-0.7148682 0.049019,-1.0702598 Q 1.6940457,5.7098063 1.9350584,5.3789245 2.180156,5.0480426 2.6090769,4.8601344 3.0420828,4.6681412 3.6017225,4.6681412 q 0.7598027,0 1.254083,0.2941172 0.4942803,0.2941172 0.6495088,0.735293 0.1552285,0.4370909 0.1552285,1.364377 z" style="opacity:1" /> +</g> +</svg> diff --git a/share/keys/carbon.xml b/share/keys/carbon.xml index 4ae4b69ea..bfd3f39da 100644 --- a/share/keys/carbon.xml +++ b/share/keys/carbon.xml @@ -567,6 +567,9 @@ and tooltips. Only one binding for each action may have this attribute. <bind key="x" modifiers="Cmd,Shift" action="DialogXMLEditor" display="true" /> <bind key="X" modifiers="Cmd,Shift" action="DialogXMLEditor" /> + <bind key="s" modifiers="Cmd,Alt" action="DialogSelectors" display="true" /> + <bind key="S" modifiers="Cmd,Alt" action="DialogSelectors" /> + <bind key="d" modifiers="Cmd,Shift" action="DialogDocumentProperties" display="true" /> <bind key="D" modifiers="Cmd,Shift" action="DialogDocumentProperties" /> diff --git a/share/keys/inkscape.xml b/share/keys/inkscape.xml index 6a24e5bcd..4d9bbb5ba 100644 --- a/share/keys/inkscape.xml +++ b/share/keys/inkscape.xml @@ -627,6 +627,9 @@ override) the bindings in the main default.xml. <bind key="x" modifiers="Primary,Shift" action="DialogXMLEditor" display="true" /> <bind key="X" modifiers="Primary,Shift" action="DialogXMLEditor" /> + <bind key="s" modifiers="Primary,Alt" action="DialogSelectors" display="true" /> + <bind key="S" modifiers="Primary,Alt" action="DialogSelectors" /> + <bind key="d" modifiers="Primary,Shift" action="DialogDocumentProperties" display="true" /> <bind key="D" modifiers="Primary,Shift" action="DialogDocumentProperties" /> diff --git a/share/keys/macromedia-freehand-mx.xml b/share/keys/macromedia-freehand-mx.xml index f989e2889..613d2c8c4 100644 --- a/share/keys/macromedia-freehand-mx.xml +++ b/share/keys/macromedia-freehand-mx.xml @@ -378,6 +378,7 @@ File, Edit, View, Modify, Text, Xtras, Window, Help. <!-- Nothing even remotely equivalent --> <bind action="DialogXMLEditor" /> + <bind action="DialogSelectors" /> <!-- Equivalent exists but no key binding --> <bind action="DialogDocumentProperties" /> diff --git a/share/keys/right-handed-illustration.xml b/share/keys/right-handed-illustration.xml index a68aaa428..5addf5352 100644 --- a/share/keys/right-handed-illustration.xml +++ b/share/keys/right-handed-illustration.xml @@ -501,6 +501,9 @@ Future improvements: <bind key="x" modifiers="Ctrl,Shift" action="DialogXMLEditor" display="true"/> <bind key="X" modifiers="Ctrl,Shift" action="DialogXMLEditor" /> + <bind key="s" modifiers="Ctrl,Alt" action="DialogSelectors" display="true"/> + <bind key="S" modifiers="Ctrl,Alt" action="DialogSelectors" /> + <bind key="d" modifiers="Ctrl,Shift" action="DialogDocumentProperties" display="true"/> <bind key="D" modifiers="Ctrl,Shift" action="DialogDocumentProperties" /> diff --git a/share/keys/xara.xml b/share/keys/xara.xml index c58139ff5..506605a68 100644 --- a/share/keys/xara.xml +++ b/share/keys/xara.xml @@ -505,6 +505,9 @@ Hom/end keys-select minimum or maximum feather values <bind key="x" modifiers="Ctrl,Shift" action="DialogXMLEditor" display="true"/> <bind key="X" modifiers="Ctrl,Shift" action="DialogXMLEditor" /> + <bind key="s" modifiers="Ctrl,Alt" action="DialogSelectors" display="true"/> + <bind key="S" modifiers="Ctrl,Alt" action="DialogSelectors" /> + <bind action="DialogDocumentProperties" display="true"/> <bind key="L" modifiers="Ctrl,Shift" action="DialogAlignDistribute" display="true"/> diff --git a/share/ui/menus.xml b/share/ui/menus.xml index e6e7e28ea..a9a7f1594 100644 --- a/share/ui/menus.xml +++ b/share/ui/menus.xml @@ -82,6 +82,7 @@ <verb verb-id="EditRemoveAllGuides" /> <separator/> <verb verb-id="DialogXMLEditor" /> + <verb verb-id="DialogSelectors" /> <separator/> <verb verb-id="DialogInput" /> <verb verb-id="DialogPreferences" /> diff --git a/share/ui/style.css b/share/ui/style.css index 516219491..d70fad17c 100644 --- a/share/ui/style.css +++ b/share/ui/style.css @@ -316,12 +316,29 @@ #LPEDialogSelector .searchbar #LPESelectorEffectFavShowImage { color: @theme_fg_color; } - - #XMLFlow .stylesheettoggler image { + + #SelectorsAndStyleDialog{ + min-height:200px; + min-width:250px; + } + + #SelectorsAndStyleDialog button{ + padding:4px; + min-height:16px; + margin:2px; + } + + #SelectorsAndStyleDialog .directiontoggler image, + #SelectorsAndStyleDialog .stylesheettoggler image { color: transparent; } + + #SelectorsAndStyleDialog .directiontoggler, + #SelectorsAndStyleDialog .stylesheettoggler { + margin:2px; + } - #XMLFlow .toggle { + #SelectorsAndStyleDialog .toggle { min-width: 18px; padding-left: 6px; padding-right: 6px; diff --git a/share/ui/toolbar-commands.ui b/share/ui/toolbar-commands.ui index f060e8e9d..36fd51682 100644 --- a/share/ui/toolbar-commands.ui +++ b/share/ui/toolbar-commands.ui @@ -31,6 +31,7 @@ <toolitem action='DialogText' /> <toolitem action='DialogLayers' /> <toolitem action='DialogXMLEditor' /> + <toolitem action='DialogSelectors' /> <toolitem action='DialogAlignDistribute' /> <separator /> <toolitem action='DialogDocumentProperties' /> diff --git a/src/desktop.cpp b/src/desktop.cpp index ab8d70601..9f7da4d6e 100644 --- a/src/desktop.cpp +++ b/src/desktop.cpp @@ -2024,6 +2024,7 @@ SPDesktop::show_dialogs() mapVerbPreference.insert(std::make_pair ("Symbols", "/dialogs/symbols") ); mapVerbPreference.insert(std::make_pair ("ObjectsPanel", "/dialogs/objects") ); mapVerbPreference.insert(std::make_pair ("Prototype", "/dialogs/prototype") ); + mapVerbPreference.insert(std::make_pair ("Selectors", "/dialogs/selectors") ); for (std::map<Glib::ustring, Glib::ustring>::const_iterator iter = mapVerbPreference.begin(); iter != mapVerbPreference.end(); ++iter) { diff --git a/src/ui/CMakeLists.txt b/src/ui/CMakeLists.txt index 64e21df8b..c72f4c695 100644 --- a/src/ui/CMakeLists.txt +++ b/src/ui/CMakeLists.txt @@ -134,7 +134,7 @@ set(ui_SRC dialog/print-colors-preview-dialog.cpp dialog/print.cpp dialog/prototype.cpp - dialog/selectordialog.cpp + dialog/selectorsdialog.cpp dialog/spellcheck.cpp dialog/styledialog.cpp dialog/svg-fonts-dialog.cpp @@ -301,7 +301,7 @@ set(ui_SRC dialog/print-colors-preview-dialog.h dialog/print.h dialog/prototype.h - dialog/selectordialog.h + dialog/selectorsdialog.h dialog/spellcheck.h dialog/styledialog.h dialog/svg-fonts-dialog.h diff --git a/src/ui/dialog/dialog-manager.cpp b/src/ui/dialog/dialog-manager.cpp index 00bcedd62..98e5cff98 100644 --- a/src/ui/dialog/dialog-manager.cpp +++ b/src/ui/dialog/dialog-manager.cpp @@ -55,9 +55,8 @@ #include "ui/dialog/clonetiler.h" #include "ui/dialog/svg-fonts-dialog.h" #include "ui/dialog/objects.h" -#include "ui/dialog/selectordialog.h" +#include "ui/dialog/selectorsdialog.h" #include "ui/dialog/styledialog.h" - namespace Inkscape { namespace UI { namespace Dialog { @@ -126,7 +125,7 @@ DialogManager::DialogManager() { registerFactory("TileDialog", &create<ArrangeDialog, FloatingBehavior>); registerFactory("Symbols", &create<SymbolsDialog, FloatingBehavior>); registerFactory("StyleDialog", &create<StyleDialog, FloatingBehavior>); - registerFactory("SelectorDialog", &create<SelectorDialog, FloatingBehavior>); + registerFactory("Selectors", &create<SelectorsDialog, FloatingBehavior>); #if HAVE_POTRACE registerFactory("Trace", &create<TraceDialog, FloatingBehavior>); @@ -167,8 +166,7 @@ DialogManager::DialogManager() { registerFactory("Swatches", &create<SwatchesPanel, DockBehavior>); registerFactory("TileDialog", &create<ArrangeDialog, DockBehavior>); registerFactory("Symbols", &create<SymbolsDialog, DockBehavior>); - registerFactory("StyleDialog", &create<StyleDialog, DockBehavior>); - registerFactory("SelectorDialog", &create<SelectorDialog, DockBehavior>); + registerFactory("Selectors", &create<SelectorsDialog, DockBehavior>); #if HAVE_POTRACE registerFactory("Trace", &create<TraceDialog, DockBehavior>); diff --git a/src/ui/dialog/selectordialog.cpp b/src/ui/dialog/selectorsdialog.cpp index cca029e2b..0d772384e 100644 --- a/src/ui/dialog/selectordialog.cpp +++ b/src/ui/dialog/selectorsdialog.cpp @@ -12,7 +12,7 @@ * Released under GNU GPL v2+, read the file 'COPYING' for more information. */ -#include "selectordialog.h" +#include "selectorsdialog.h" #include "verbs.h" #include "selection.h" #include "attribute-rel-svg.h" @@ -32,8 +32,8 @@ #include <regex> #include <utility> -//#define DEBUG_SELECTORDIALOG -//#define G_LOG_DOMAIN "SELECTORDIALOG" +//#define DEBUG_SELECTORSDIALOG +//#define G_LOG_DOMAIN "SELECTORSDIALOG" using Inkscape::DocumentUndo; using Inkscape::Util::List; @@ -56,52 +56,52 @@ namespace UI { namespace Dialog { // Keeps a watch on style element -class SelectorDialog::NodeObserver : public Inkscape::XML::NodeObserver { +class SelectorsDialog::NodeObserver : public Inkscape::XML::NodeObserver { public: - NodeObserver(SelectorDialog *selectordialog) - : _selectordialog(selectordialog) + NodeObserver(SelectorsDialog *selectorsdialog) + : _selectorsdialog(selectorsdialog) { - g_debug("SelectorDialog::NodeObserver: Constructor"); + g_debug("SelectorsDialog::NodeObserver: Constructor"); }; void notifyContentChanged(Inkscape::XML::Node &node, Inkscape::Util::ptr_shared old_content, Inkscape::Util::ptr_shared new_content) override; - SelectorDialog *_selectordialog; + SelectorsDialog *_selectorsdialog; }; void -SelectorDialog::NodeObserver::notifyContentChanged( +SelectorsDialog::NodeObserver::notifyContentChanged( Inkscape::XML::Node &/*node*/, Inkscape::Util::ptr_shared /*old_content*/, Inkscape::Util::ptr_shared /*new_content*/ ) { - g_debug("SelectorDialog::NodeObserver::notifyContentChanged"); - _selectordialog->_updating = false; - _selectordialog->_readStyleElement(); - _selectordialog->_selectRow(); + g_debug("SelectorsDialog::NodeObserver::notifyContentChanged"); + _selectorsdialog->_updating = false; + _selectorsdialog->_readStyleElement(); + _selectorsdialog->_selectRow(); } // Keeps a watch for new/removed/changed nodes // (Must update objects that selectors match.) -class SelectorDialog::NodeWatcher : public Inkscape::XML::NodeObserver { +class SelectorsDialog::NodeWatcher : public Inkscape::XML::NodeObserver { public: - NodeWatcher(SelectorDialog *selectordialog, Inkscape::XML::Node *repr) - : _selectordialog(selectordialog) + NodeWatcher(SelectorsDialog *selectorsdialog, Inkscape::XML::Node *repr) + : _selectorsdialog(selectorsdialog) , _repr(repr) { - g_debug("SelectorDialog::NodeWatcher: Constructor"); + g_debug("SelectorsDialog::NodeWatcher: Constructor"); }; void notifyChildAdded( Inkscape::XML::Node &/*node*/, Inkscape::XML::Node &child, Inkscape::XML::Node */*prev*/ ) override { - if (_selectordialog && _repr) { - _selectordialog->_nodeAdded(child); + if (_selectorsdialog && _repr) { + _selectorsdialog->_nodeAdded(child); } } @@ -109,8 +109,8 @@ public: Inkscape::XML::Node &child, Inkscape::XML::Node */*prev*/ ) override { - if (_selectordialog && _repr) { - _selectordialog->_nodeRemoved(child); + if (_selectorsdialog && _repr) { + _selectorsdialog->_nodeRemoved(child); } } @@ -118,7 +118,7 @@ public: GQuark qname, Util::ptr_shared /*old_value*/, Util::ptr_shared /*new_value*/ ) override { - if (_selectordialog && _repr) { + if (_selectorsdialog && _repr) { // For the moment only care about attributes that are directly used in selectors. const gchar * cname = g_quark_to_string (qname ); @@ -128,19 +128,19 @@ public: } if ( name == "id" || name == "class" ) { - _selectordialog->_nodeChanged(node); + _selectorsdialog->_nodeChanged(node); } } } - SelectorDialog *_selectordialog; + SelectorsDialog *_selectorsdialog; Inkscape::XML::Node * _repr; // Need to track if document changes. }; void -SelectorDialog::_nodeAdded( Inkscape::XML::Node &node ) { +SelectorsDialog::_nodeAdded( Inkscape::XML::Node &node ) { - SelectorDialog::NodeWatcher *w = new SelectorDialog::NodeWatcher (this, &node); + SelectorsDialog::NodeWatcher *w = new SelectorsDialog::NodeWatcher (this, &node); node.addObserver (*w); _nodeWatchers.push_back(w); @@ -149,7 +149,7 @@ SelectorDialog::_nodeAdded( Inkscape::XML::Node &node ) { } void -SelectorDialog::_nodeRemoved( Inkscape::XML::Node &repr ) { +SelectorsDialog::_nodeRemoved( Inkscape::XML::Node &repr ) { for (auto it = _nodeWatchers.begin(); it != _nodeWatchers.end(); ++it) { if ( (*it)->_repr == &repr ) { @@ -164,13 +164,13 @@ SelectorDialog::_nodeRemoved( Inkscape::XML::Node &repr ) { } void -SelectorDialog::_nodeChanged( Inkscape::XML::Node &object ) { +SelectorsDialog::_nodeChanged( Inkscape::XML::Node &object ) { _readStyleElement(); _selectRow(); } -SelectorDialog::TreeStore::TreeStore() +SelectorsDialog::TreeStore::TreeStore() = default; @@ -178,21 +178,21 @@ SelectorDialog::TreeStore::TreeStore() * Allow dragging only selectors. */ bool -SelectorDialog::TreeStore::row_draggable_vfunc(const Gtk::TreeModel::Path& path) const +SelectorsDialog::TreeStore::row_draggable_vfunc(const Gtk::TreeModel::Path& path) const { - g_debug("SelectorDialog::TreeStore::row_draggable_vfunc"); + g_debug("SelectorsDialog::TreeStore::row_draggable_vfunc"); - auto unconstThis = const_cast<SelectorDialog::TreeStore*>(this); + auto unconstThis = const_cast<SelectorsDialog::TreeStore*>(this); const_iterator iter = unconstThis->get_iter(path); if (iter) { Gtk::TreeModel::Row row = *iter; - bool is_draggable = row[_selectordialog->_mColumns._colType] == SELECTOR; + bool is_draggable = row[_selectorsdialog->_mColumns._colType] == SELECTOR; return is_draggable; } return Gtk::TreeStore::row_draggable_vfunc(path); } -void SelectorDialog::fixCSSSelectors(Glib::ustring &selector) +void SelectorsDialog::fixCSSSelectors(Glib::ustring &selector) { REMOVE_SPACES(selector); Glib::ustring my_selector = selector + " {"; // Parsing fails sometimes without '{'. Fix me @@ -254,10 +254,10 @@ void SelectorDialog::fixCSSSelectors(Glib::ustring &selector) * Allow dropping only in between other selectors. */ bool -SelectorDialog::TreeStore::row_drop_possible_vfunc(const Gtk::TreeModel::Path& dest, +SelectorsDialog::TreeStore::row_drop_possible_vfunc(const Gtk::TreeModel::Path& dest, const Gtk::SelectionData& selection_data) const { - g_debug("SelectorDialog::TreeStore::row_drop_possible_vfunc"); + g_debug("SelectorsDialog::TreeStore::row_drop_possible_vfunc"); Gtk::TreeModel::Path dest_parent = dest; dest_parent.up(); @@ -267,22 +267,22 @@ SelectorDialog::TreeStore::row_drop_possible_vfunc(const Gtk::TreeModel::Path& d // This is only here to handle updating style element after a drag and drop. void -SelectorDialog::TreeStore::on_row_deleted(const TreeModel::Path& path) +SelectorsDialog::TreeStore::on_row_deleted(const TreeModel::Path& path) { - if (_selectordialog->_updating) return; // Don't write if we deleted row (other than from DND) + if (_selectorsdialog->_updating) return; // Don't write if we deleted row (other than from DND) g_debug("on_row_deleted"); - _selectordialog->_writeStyleElement(); + _selectorsdialog->_writeStyleElement(); } -Glib::RefPtr<SelectorDialog::TreeStore> SelectorDialog::TreeStore::create(SelectorDialog *selectordialog) +Glib::RefPtr<SelectorsDialog::TreeStore> SelectorsDialog::TreeStore::create(SelectorsDialog *selectorsdialog) { - SelectorDialog::TreeStore * store = new SelectorDialog::TreeStore(); - store->_selectordialog = selectordialog; - store->set_column_types( store->_selectordialog->_mColumns ); - return Glib::RefPtr<SelectorDialog::TreeStore>( store ); + SelectorsDialog::TreeStore * store = new SelectorsDialog::TreeStore(); + store->_selectorsdialog = selectorsdialog; + store->set_column_types( store->_selectorsdialog->_mColumns ); + return Glib::RefPtr<SelectorsDialog::TreeStore>( store ); } /** @@ -291,20 +291,18 @@ Glib::RefPtr<SelectorDialog::TreeStore> SelectorDialog::TreeStore::create(Select * adds selectors to treeview. _delSelector deletes the selector from the dialog. * Any addition/deletion of the selectors updates XML style element accordingly. */ -SelectorDialog::SelectorDialog() : - UI::Widget::Panel("/dialogs/style", SP_VERB_DIALOG_STYLE), +SelectorsDialog::SelectorsDialog() : + UI::Widget::Panel("/dialogs/selectors", SP_VERB_DIALOG_SELECTORS), _updating(false), _textNode(nullptr), _desktopTracker() { - g_debug("SelectorDialog::SelectorDialog"); - + g_debug("SelectorsDialog::SelectorsDialog"); // Tree Inkscape::UI::Widget::IconRenderer * addRenderer = manage( new Inkscape::UI::Widget::IconRenderer() ); addRenderer->add_icon("edit-delete"); addRenderer->add_icon("list-add"); - _store = TreeStore::create(this); _treeView.set_model(_store); @@ -319,51 +317,31 @@ SelectorDialog::SelectorDialog() : _treeView.append_column("CSS Selector", _mColumns._colSelector); _treeView.set_expander_column(*(_treeView.get_column(1))); - // Pack widgets - _paned.set_orientation(Gtk::ORIENTATION_VERTICAL); - _paned.pack1(_mainBox, Gtk::SHRINK); - _mainBox.set_orientation(Gtk::ORIENTATION_VERTICAL); - _mainBox.pack_start(_scrolledWindow, Gtk::PACK_EXPAND_WIDGET); - _scrolledWindow.add(_treeView); - _scrolledWindow.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC); - create = manage( new Gtk::Button() ); - _styleButton(*create, "list-add", "Add a new CSS Selector"); - create->signal_clicked().connect(sigc::mem_fun(*this, &SelectorDialog::_addSelector)); - - del = manage( new Gtk::Button() ); - _styleButton(*del, "list-remove", "Remove a CSS Selector"); - del->signal_clicked().connect(sigc::mem_fun(*this, &SelectorDialog::_delSelector)); - del->hide(); - _mainBox.pack_end(_buttonBox, Gtk::PACK_SHRINK); - - _buttonBox.pack_start(*create, Gtk::PACK_SHRINK); - _buttonBox.pack_start(*del, Gtk::PACK_SHRINK); - _getContents()->pack_start(_paned, Gtk::PACK_EXPAND_WIDGET); - - // Signal handlers _treeView.signal_button_release_event().connect( // Needs to be release, not press. - sigc::mem_fun(*this, &SelectorDialog::_handleButtonEvent), + sigc::mem_fun(*this, &SelectorsDialog::_handleButtonEvent), false); _treeView.signal_button_release_event().connect_notify( - sigc::mem_fun(*this, &SelectorDialog::_buttonEventsSelectObjs), + sigc::mem_fun(*this, &SelectorsDialog::_buttonEventsSelectObjs), false); - _treeView.signal_row_expanded().connect(sigc::mem_fun(*this, &SelectorDialog::_rowExpand)); + _treeView.signal_row_expanded().connect(sigc::mem_fun(*this, &SelectorsDialog::_rowExpand)); + + _treeView.signal_row_collapsed().connect(sigc::mem_fun(*this, &SelectorsDialog::_rowCollapse)); - _treeView.signal_row_collapsed().connect(sigc::mem_fun(*this, &SelectorDialog::_rowCollapse)); + _showWidgets(); // Document & Desktop _desktop_changed_connection = _desktopTracker.connectDesktopChanged( - sigc::mem_fun(*this, &SelectorDialog::_handleDesktopChanged) ); + sigc::mem_fun(*this, &SelectorsDialog::_handleDesktopChanged) ); _desktopTracker.connect(GTK_WIDGET(gobj())); _document_replaced_connection = getDesktop()->connectDocumentReplaced( - sigc::mem_fun(this, &SelectorDialog::_handleDocumentReplaced)); + sigc::mem_fun(this, &SelectorsDialog::_handleDocumentReplaced)); _selection_changed_connection = getDesktop()->getSelection()->connectChanged( - sigc::hide(sigc::mem_fun(this, &SelectorDialog::_handleSelectionChanged))); + sigc::hide(sigc::mem_fun(this, &SelectorsDialog::_handleSelectionChanged))); // Add watchers _updateWatchers(); @@ -373,18 +351,60 @@ SelectorDialog::SelectorDialog() : _selectRow(); if (!_store->children().empty()) { - del->show(); + _del.show(); } + show_all(); +} +void +SelectorsDialog::_showWidgets() +{ + // Pack widgets + Inkscape::Preferences *prefs = Inkscape::Preferences::get(); + bool dir = prefs->getBool("/dialogs/selectors/updown", true); + _paned.set_orientation(dir ? Gtk::ORIENTATION_VERTICAL : Gtk::ORIENTATION_HORIZONTAL); + _selectors_box.set_orientation(Gtk::ORIENTATION_VERTICAL); + _selectors_box.set_name("SelectorsDialog"); + _selectors_box.pack_start(_scrolled_window_selectors, Gtk::PACK_EXPAND_WIDGET); + _scrolled_window_selectors.add(_treeView); + _scrolled_window_selectors.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC); + Gtk::Label *dirogglerlabel = Gtk::manage(new Gtk::Label(_("Paned vertical"))); + _direction.property_active().signal_changed().connect(sigc::mem_fun(*this, &SelectorsDialog::_toggleDirection)); + _direction.get_style_context()->add_class("directiontoggler"); + _styleButton(_create, "list-add", "Add a new CSS Selector"); + _create.signal_clicked().connect(sigc::mem_fun(*this, &SelectorsDialog::_addSelector)); + _styleButton(_del, "list-remove", "Remove a CSS Selector"); + _button_box.pack_start(_create, Gtk::PACK_SHRINK); + _button_box.pack_start(_del, Gtk::PACK_SHRINK); + _button_box.pack_start(_direction, Gtk::PACK_SHRINK); + _button_box.pack_start(*dirogglerlabel, Gtk::PACK_SHRINK); + _selectors_box.pack_end(_button_box, Gtk::PACK_SHRINK); + _del.signal_clicked().connect(sigc::mem_fun(*this, &SelectorsDialog::_delSelector)); + _del.hide(); + _style_dialog = new StyleDialog; + _selectors_box.set_name("StyleDialog"); + _paned.pack1(*_style_dialog, Gtk::SHRINK); + _paned.pack2(_selectors_box, true, true); + _paned.set_position(-1); + _getContents()->pack_start(_paned, Gtk::PACK_EXPAND_WIDGET); + set_name("SelectorsAndStyleDialog"); } +void +SelectorsDialog::_toggleDirection() +{ + Inkscape::Preferences *prefs = Inkscape::Preferences::get(); + bool dir = !prefs->getBool("/dialogs/selectors/updown", true); + prefs->setBool("/dialogs/selectors/updown", dir); + _paned.set_orientation(dir ? Gtk::ORIENTATION_VERTICAL : Gtk::ORIENTATION_HORIZONTAL); +} /** * Class destructor */ -SelectorDialog::~SelectorDialog() +SelectorsDialog::~SelectorsDialog() { - g_debug("SelectorDialog::~SelectorDialog"); + g_debug("SelectorsDialog::~SelectorsDialog"); _desktop_changed_connection.disconnect(); _document_replaced_connection.disconnect(); _selection_changed_connection.disconnect(); @@ -396,7 +416,7 @@ SelectorDialog::~SelectorDialog() * Returns the style element's text node. If there is no style element, one is created. * Ditto for text node. */ -Inkscape::XML::Node* SelectorDialog::_getStyleTextNode() +Inkscape::XML::Node* SelectorsDialog::_getStyleTextNode() { Inkscape::XML::Node *styleNode = nullptr; @@ -416,7 +436,7 @@ Inkscape::XML::Node* SelectorDialog::_getStyleTextNode() if (textNode == nullptr) { // Style element found but does not contain text node! - std::cerr << "SelectorDialog::_getStyleTextNode(): No text node!" << std::endl; + std::cerr << "SelectorsDialog::_getStyleTextNode(): No text node!" << std::endl; textNode = SP_ACTIVE_DOCUMENT->getReprDoc()->createTextNode(""); styleNode->appendChild(textNode); Inkscape::GC::release(textNode); @@ -449,16 +469,16 @@ Inkscape::XML::Node* SelectorDialog::_getStyleTextNode() /** * Fill the Gtk::TreeStore from the svg:style element. */ -void SelectorDialog::_readStyleElement() +void SelectorsDialog::_readStyleElement() { - g_debug("SelectorDialog::_readStyleElement: updating %s", (_updating ? "true" : "false")); + g_debug("SelectorsDialog::_readStyleElement: updating %s", (_updating ? "true" : "false")); if (_updating) return; // Don't read if we wrote style element. _updating = true; Inkscape::XML::Node * textNode = _getStyleTextNode(); if (textNode == nullptr) { - std::cerr << "SelectorDialog::_readStyleElement: No text node!" << std::endl; + std::cerr << "SelectorsDialog::_readStyleElement: No text node!" << std::endl; } // Get content from style text node. @@ -527,7 +547,7 @@ void SelectorDialog::_readStyleElement() if ((i+1) < tokens.size()) { properties = tokens[i+1]; } else { - std::cerr << "SelectorDialog::_readStyleElement: Missing values " + std::cerr << "SelectorsDialog::_readStyleElement: Missing values " "for last selector!" << std::endl; } REMOVE_SPACES(properties); @@ -565,23 +585,23 @@ void SelectorDialog::_readStyleElement() } } -void SelectorDialog::_rowExpand(const Gtk::TreeModel::iterator &iter, const Gtk::TreeModel::Path &path) +void SelectorsDialog::_rowExpand(const Gtk::TreeModel::iterator &iter, const Gtk::TreeModel::Path &path) { - g_debug("SelectorDialog::_row_expand()"); + g_debug("SelectorsDialog::_row_expand()"); Gtk::TreeModel::Row row = *iter; row[_mColumns._colExpand] = true; } -void SelectorDialog::_rowCollapse(const Gtk::TreeModel::iterator &iter, const Gtk::TreeModel::Path &path) +void SelectorsDialog::_rowCollapse(const Gtk::TreeModel::iterator &iter, const Gtk::TreeModel::Path &path) { - g_debug("SelectorDialog::_row_collapse()"); + g_debug("SelectorsDialog::_row_collapse()"); Gtk::TreeModel::Row row = *iter; row[_mColumns._colExpand] = false; } /** * Update the content of the style element as selectors (or objects) are added/removed. */ -void SelectorDialog::_writeStyleElement() +void SelectorsDialog::_writeStyleElement() { if (_updating) { return; @@ -608,15 +628,15 @@ void SelectorDialog::_writeStyleElement() DocumentUndo::done(SP_ACTIVE_DOCUMENT, SP_VERB_DIALOG_STYLE, _("Edited style element.")); _updating = false; - g_debug("SelectorDialog::_writeStyleElement(): | %s |", styleContent.c_str()); + g_debug("SelectorsDialog::_writeStyleElement(): | %s |", styleContent.c_str()); } -void SelectorDialog::_addWatcherRecursive(Inkscape::XML::Node *node) { +void SelectorsDialog::_addWatcherRecursive(Inkscape::XML::Node *node) { - g_debug("SelectorDialog::_addWatcherRecursive()"); + g_debug("SelectorsDialog::_addWatcherRecursive()"); - SelectorDialog::NodeWatcher *w = new SelectorDialog::NodeWatcher(this, node); + SelectorsDialog::NodeWatcher *w = new SelectorsDialog::NodeWatcher(this, node); node->addObserver(*w); _nodeWatchers.push_back(w); @@ -628,13 +648,13 @@ void SelectorDialog::_addWatcherRecursive(Inkscape::XML::Node *node) { /** * Update the watchers on objects. */ -void SelectorDialog::_updateWatchers() +void SelectorsDialog::_updateWatchers() { _updating = true; // Remove old document watchers while (!_nodeWatchers.empty()) { - SelectorDialog::NodeWatcher *w = _nodeWatchers.back(); + SelectorsDialog::NodeWatcher *w = _nodeWatchers.back(); w->_repr->removeObserver(*w); _nodeWatchers.pop_back(); delete w; @@ -644,7 +664,7 @@ void SelectorDialog::_updateWatchers() Inkscape::XML::Node *root = SP_ACTIVE_DOCUMENT->getReprRoot(); _addWatcherRecursive(root); - g_debug("SelectorDialog::_updateWatchers(): %d", (int)_nodeWatchers.size()); + g_debug("SelectorsDialog::_updateWatchers(): %d", (int)_nodeWatchers.size()); _updating = false; } @@ -721,9 +741,9 @@ Glib::ustring sp_get_selector_classes(Glib::ustring selector) //, SelectorType s * @param row * Add selected objects on the desktop to the selector corresponding to 'row'. */ -void SelectorDialog::_addToSelector(Gtk::TreeModel::Row row) +void SelectorsDialog::_addToSelector(Gtk::TreeModel::Row row) { - g_debug("SelectorDialog::_addToSelector: Entrance"); + g_debug("SelectorsDialog::_addToSelector: Entrance"); if (*row) { // Store list of selected elements on desktop (not to be confused with selector). _updating = true; @@ -785,9 +805,9 @@ void SelectorDialog::_addToSelector(Gtk::TreeModel::Row row) * @param row * Remove the object corresponding to 'row' from the parent selector. */ -void SelectorDialog::_removeFromSelector(Gtk::TreeModel::Row row) +void SelectorsDialog::_removeFromSelector(Gtk::TreeModel::Row row) { - g_debug("SelectorDialog::_removeFromSelector: Entrance"); + g_debug("SelectorsDialog::_removeFromSelector: Entrance"); if (*row) { _updating = true; Glib::ustring objectLabel = row[_mColumns._colSelector]; @@ -837,7 +857,7 @@ void SelectorDialog::_removeFromSelector(Gtk::TreeModel::Row row) * @return This function returns a comma separated list of ids for objects in input vector. * It is used in creating an 'id' selector. It relies on objects having 'id's. */ -Glib::ustring SelectorDialog::_getIdList(std::vector<SPObject*> sel) +Glib::ustring SelectorsDialog::_getIdList(std::vector<SPObject*> sel) { Glib::ustring str; for (auto& obj: sel) { @@ -855,9 +875,9 @@ Glib::ustring SelectorDialog::_getIdList(std::vector<SPObject*> sel) * @return objVec: a vector of pointers to SPObject's the selector matches. * Return a vector of all objects that selector matches. */ -std::vector<SPObject *> SelectorDialog::_getObjVec(Glib::ustring selector) { +std::vector<SPObject *> SelectorsDialog::_getObjVec(Glib::ustring selector) { - g_debug("SelectorDialog::_getObjVec: | %s |", selector.c_str()); + g_debug("SelectorsDialog::_getObjVec: | %s |", selector.c_str()); std::vector<SPObject *> objVec; std::vector<Glib::ustring> tokensplus = Glib::Regex::split_simple("[,]+", selector); for (auto tok : tokensplus) { @@ -887,7 +907,7 @@ std::vector<SPObject *> SelectorDialog::_getObjVec(Glib::ustring selector) { * @param class: class to insert * Insert a class name into objects' 'class' attribute. */ -void SelectorDialog::_insertClass(const std::vector<SPObject *> &objVec, const Glib::ustring &className) +void SelectorsDialog::_insertClass(const std::vector<SPObject *> &objVec, const Glib::ustring &className) { for (auto& obj: objVec) { _insertClass(obj, className); @@ -899,7 +919,7 @@ void SelectorDialog::_insertClass(const std::vector<SPObject *> &objVec, const G * @param class: class to insert * Insert a class name into objects' 'class' attribute. */ -void SelectorDialog::_insertClass(SPObject *obj, const Glib::ustring &className) +void SelectorsDialog::_insertClass(SPObject *obj, const Glib::ustring &className) { Glib::ustring classAttr = Glib::ustring(""); if (obj->getRepr()->attribute("class")) { @@ -928,7 +948,7 @@ void SelectorDialog::_insertClass(SPObject *obj, const Glib::ustring &className) * @param class: class to insert * Insert a class name into objects' 'class' attribute. */ -void SelectorDialog::_removeClass(const std::vector<SPObject *> &objVec, const Glib::ustring &className, bool all) +void SelectorsDialog::_removeClass(const std::vector<SPObject *> &objVec, const Glib::ustring &className, bool all) { for (auto &obj : objVec) { _removeClass(obj, className, all); @@ -940,7 +960,7 @@ void SelectorDialog::_removeClass(const std::vector<SPObject *> &objVec, const G * @param class: class to insert * Insert a class name into objects' 'class' attribute. */ -void SelectorDialog::_removeClass(SPObject *obj, const Glib::ustring &className, bool all) // without "." +void SelectorsDialog::_removeClass(SPObject *obj, const Glib::ustring &className, bool all) // without "." { if (obj->getRepr()->attribute("class")) { std::vector<Glib::ustring> tokens = Glib::Regex::split_simple("[.]+", className); @@ -974,9 +994,9 @@ void SelectorDialog::_removeClass(SPObject *obj, const Glib::ustring &className, * This function selects objects in the drawing corresponding to the selector * selected in the treeview. */ -void SelectorDialog::_selectObjects(int eventX, int eventY) +void SelectorsDialog::_selectObjects(int eventX, int eventY) { - g_debug("SelectorDialog::_selectObjects: %d, %d", eventX, eventY); + g_debug("SelectorsDialog::_selectObjects: %d, %d", eventX, eventY); getDesktop()->selection->clear(); Gtk::TreeViewColumn *col = _treeView.get_column(1); Gtk::TreeModel::Path path; @@ -990,7 +1010,7 @@ void SelectorDialog::_selectObjects(int eventX, int eventY) Gtk::TreeModel::Row row = *iter; Gtk::TreeModel::Children children = row.children(); if (children.empty() || children.size() == 1) { - del->show(); + _del.show(); } std::vector<SPObject *> objVec = row[_mColumns._colObj]; @@ -1007,9 +1027,9 @@ void SelectorDialog::_selectObjects(int eventX, int eventY) * with an 'id' selector containing a list of the id's of selected objects * or with a 'class' selector if no objects are selected. */ -void SelectorDialog::_addSelector() +void SelectorsDialog::_addSelector() { - g_debug("SelectorDialog::_addSelector: Entrance"); + g_debug("SelectorsDialog::_addSelector: Entrance"); // Store list of selected elements on desktop (not to be confused with selector). Inkscape::Selection* selection = getDesktop()->getSelection(); @@ -1023,7 +1043,7 @@ void SelectorDialog::_addSelector() Gtk::Entry *textEditPtr = manage ( new Gtk::Entry() ); textEditPtr->signal_activate().connect( - sigc::bind<Gtk::Dialog *>(sigc::mem_fun(*this, &SelectorDialog::_closeDialog), textDialogPtr)); + sigc::bind<Gtk::Dialog *>(sigc::mem_fun(*this, &SelectorsDialog::_closeDialog), textDialogPtr)); textDialogPtr->get_content_area()->pack_start(*textEditPtr, Gtk::PACK_SHRINK); Gtk::Label *textLabelPtr = manage(new Gtk::Label(_("Invalid CSS selector."))); @@ -1070,7 +1090,7 @@ void SelectorDialog::_addSelector() * set to ".Class1" */ selectorValue = textEditPtr->get_text(); - del->show(); + _del.show(); fixCSSSelectors(selectorValue); if (selectorValue.empty()) { textLabelPtr->show(); @@ -1124,15 +1144,15 @@ void SelectorDialog::_addSelector() _writeStyleElement(); } -void SelectorDialog::_closeDialog(Gtk::Dialog *textDialogPtr) { textDialogPtr->response(Gtk::RESPONSE_OK); } +void SelectorsDialog::_closeDialog(Gtk::Dialog *textDialogPtr) { textDialogPtr->response(Gtk::RESPONSE_OK); } /** * This function deletes selector when '-' at the bottom is clicked. * Note: If deleting a class selector, class attributes are NOT changed. */ -void SelectorDialog::_delSelector() +void SelectorsDialog::_delSelector() { - g_debug("SelectorDialog::_delSelector"); + g_debug("SelectorsDialog::_delSelector"); Glib::RefPtr<Gtk::TreeSelection> refTreeSelection = _treeView.get_selection(); _treeView.get_selection()->set_mode(Gtk::SELECTION_SINGLE); @@ -1146,7 +1166,7 @@ void SelectorDialog::_delSelector() _store->erase(iter); _updating = false; _writeStyleElement(); - del->hide(); + _del.hide(); } } @@ -1158,9 +1178,9 @@ void SelectorDialog::_delSelector() * any) are added as children of the selector in the treeview. In the latter case, the object * corresponding to the row is removed from the selector. */ -bool SelectorDialog::_handleButtonEvent(GdkEventButton *event) +bool SelectorsDialog::_handleButtonEvent(GdkEventButton *event) { - g_debug("SelectorDialog::_handleButtonEvent: Entrance"); + g_debug("SelectorsDialog::_handleButtonEvent: Entrance"); if (event->type == GDK_BUTTON_RELEASE && event->button == 1) { Gtk::TreeViewColumn *col = nullptr; Gtk::TreeModel::Path path; @@ -1219,14 +1239,14 @@ private: * document in a new window.) */ void -SelectorDialog::_handleDocumentReplaced(SPDesktop *desktop, SPDocument * /* document */) +SelectorsDialog::_handleDocumentReplaced(SPDesktop *desktop, SPDocument * /* document */) { - g_debug("SelectorDialog::handleDocumentReplaced()"); + g_debug("SelectorsDialog::handleDocumentReplaced()"); _selection_changed_connection.disconnect(); _selection_changed_connection = desktop->getSelection()->connectChanged( - sigc::hide(sigc::mem_fun(this, &SelectorDialog::_handleSelectionChanged))); + sigc::hide(sigc::mem_fun(this, &SelectorsDialog::_handleSelectionChanged))); _updateWatchers(); _readStyleElement(); @@ -1238,8 +1258,8 @@ SelectorDialog::_handleDocumentReplaced(SPDesktop *desktop, SPDocument * /* docu * When a dialog is floating, it is connected to the active desktop. */ void -SelectorDialog::_handleDesktopChanged(SPDesktop* desktop) { - g_debug("SelectorDialog::handleDesktopReplaced()"); +SelectorsDialog::_handleDesktopChanged(SPDesktop* desktop) { + g_debug("SelectorsDialog::handleDesktopReplaced()"); if (getDesktop() == desktop) { // This will happen after construction of dialog. We've already @@ -1253,9 +1273,9 @@ SelectorDialog::_handleDesktopChanged(SPDesktop* desktop) { setDesktop( desktop ); _selection_changed_connection = desktop->getSelection()->connectChanged( - sigc::hide(sigc::mem_fun(this, &SelectorDialog::_handleSelectionChanged))); + sigc::hide(sigc::mem_fun(this, &SelectorsDialog::_handleSelectionChanged))); _document_replaced_connection = desktop->connectDocumentReplaced( - sigc::mem_fun(this, &SelectorDialog::_handleDocumentReplaced)); + sigc::mem_fun(this, &SelectorsDialog::_handleDocumentReplaced)); _updateWatchers(); _readStyleElement(); @@ -1267,8 +1287,8 @@ SelectorDialog::_handleDesktopChanged(SPDesktop* desktop) { * Handle a change in which objects are selected in a document. */ void -SelectorDialog::_handleSelectionChanged() { - g_debug("SelectorDialog::_handleSelectionChanged()"); +SelectorsDialog::_handleSelectionChanged() { + g_debug("SelectorsDialog::_handleSelectionChanged()"); _treeView.get_selection()->set_mode(Gtk::SELECTION_MULTIPLE); _selectRow(); } @@ -1280,12 +1300,12 @@ SelectorDialog::_handleSelectionChanged() { * on a selector selects the matching objects on the desktop. A double click will * in addition open the CSS dialog. */ -void SelectorDialog::_buttonEventsSelectObjs(GdkEventButton* event ) +void SelectorsDialog::_buttonEventsSelectObjs(GdkEventButton* event ) { - g_debug("SelectorDialog::_buttonEventsSelectObjs"); + g_debug("SelectorsDialog::_buttonEventsSelectObjs"); _treeView.get_selection()->set_mode(Gtk::SELECTION_SINGLE); _updating = true; - del->show(); + _del.show(); if (event->type == GDK_BUTTON_RELEASE && event->button == 1) { int x = static_cast<int>(event->x); int y = static_cast<int>(event->y); @@ -1299,22 +1319,22 @@ void SelectorDialog::_buttonEventsSelectObjs(GdkEventButton* event ) * This function selects the row in treeview corresponding to an object selected * in the drawing. If more than one row matches, the first is chosen. */ -void SelectorDialog::_selectRow() +void SelectorsDialog::_selectRow() { - g_debug("SelectorDialog::_selectRow: updating: %s", (_updating ? "true" : "false")); - del->hide(); + g_debug("SelectorsDialog::_selectRow: updating: %s", (_updating ? "true" : "false")); + _del.hide(); std::vector<Gtk::TreeModel::Path> selectedrows = _treeView.get_selection()->get_selected_rows(); if (selectedrows.size() == 1) { Gtk::TreeModel::Row row = *_store->get_iter(selectedrows[0]); if (!row->parent() && row->children().size() < 2) { - del->show(); + _del.show(); } } else if (selectedrows.size() == 0) { - del->show(); + _del.show(); } if (_updating || !getDesktop()) return; // Avoid updating if we have set row via dialog. if (SP_ACTIVE_DESKTOP != getDesktop()) { - std::cerr << "SelectorDialog::_selectRow: SP_ACTIVE_DESKTOP != getDesktop()" << std::endl; + std::cerr << "SelectorsDialog::_selectRow: SP_ACTIVE_DESKTOP != getDesktop()" << std::endl; return; } @@ -1349,7 +1369,7 @@ void SelectorDialog::_selectRow() * @param tooltip * Set the style of '+' and '-' buttons at the bottom of dialog. */ -void SelectorDialog::_styleButton(Gtk::Button& btn, char const* iconName, +void SelectorsDialog::_styleButton(Gtk::Button& btn, char const* iconName, char const* tooltip) { GtkWidget *child = sp_get_icon_image(iconName, GTK_ICON_SIZE_SMALL_TOOLBAR); diff --git a/src/ui/dialog/selectordialog.h b/src/ui/dialog/selectorsdialog.h index a3bae04a1..9a1a4b497 100644 --- a/src/ui/dialog/selectordialog.h +++ b/src/ui/dialog/selectorsdialog.h @@ -12,19 +12,22 @@ * Released under GNU GPL v2+, read the file 'COPYING' for more information. */ -#ifndef SELECTORDIALOG_H -#define SELECTORDIALOG_H +#ifndef SELECTORSDIALOG_H +#define SELECTORSDIALOG_H #include <gtkmm/dialog.h> #include <gtkmm/paned.h> #include <gtkmm/scrolledwindow.h> +#include <gtkmm/switch.h> #include <gtkmm/treemodelfilter.h> #include <gtkmm/treeselection.h> #include <gtkmm/treestore.h> #include <gtkmm/treeview.h> #include <ui/widget/panel.h> - +#include "ui/dialog/dialog-manager.h" +#include "ui/dialog/styledialog.h" #include "ui/dialog/desktop-tracker.h" +#include "ui/widget/panel.h" #include "xml/helper-observer.h" @@ -33,7 +36,7 @@ namespace UI { namespace Dialog { /** - * @brief The SelectorDialog class + * @brief The SelectorsDialog class * A list of CSS selectors will show up in this dialog. This dialog allows one to * add and delete selectors. Elements can be added to and removed from the selectors * in the dialog. Selection of any selector row selects the matching objects in @@ -43,17 +46,17 @@ namespace Dialog { * 1. The text node of the style element. * 2. The Gtk::TreeModel. */ -class SelectorDialog : public Widget::Panel { +class SelectorsDialog : public Widget::Panel { public: - ~SelectorDialog() override; + ~SelectorsDialog() override; // No default constructor, noncopyable, nonassignable - SelectorDialog(); - SelectorDialog(SelectorDialog const &d) = delete; - SelectorDialog operator=(SelectorDialog const &d) = delete; + SelectorsDialog(); + SelectorsDialog(SelectorsDialog const &d) = delete; + SelectorsDialog operator=(SelectorsDialog const &d) = delete; - static SelectorDialog &getInstance() { return *new SelectorDialog(); } - private: + static SelectorsDialog &getInstance() { return *new SelectorsDialog(); } +private: // Monitor <style> element for changes. class NodeObserver; @@ -61,7 +64,7 @@ public: class NodeWatcher; enum SelectorType { CLASS, ID, TAG }; void fixCSSSelectors(Glib::ustring &selector); - std::vector<SelectorDialog::NodeWatcher*> _nodeWatchers; + std::vector<SelectorsDialog::NodeWatcher*> _nodeWatchers; void _nodeAdded( Inkscape::XML::Node &repr ); void _nodeRemoved( Inkscape::XML::Node &repr ); void _nodeChanged( Inkscape::XML::Node &repr ); @@ -101,10 +104,10 @@ public: void on_row_deleted(const TreeModel::Path& path) override; public: - static Glib::RefPtr<SelectorDialog::TreeStore> create(SelectorDialog *styledialog); + static Glib::RefPtr<SelectorsDialog::TreeStore> create(SelectorsDialog *styledialog); private: - SelectorDialog *_selectordialog; + SelectorsDialog *_selectorsdialog; }; // TreeView @@ -113,12 +116,15 @@ public: Gtk::TreeView _treeView; // Widgets Gtk::Paned _paned; - Gtk::Box _mainBox; - Gtk::Box _buttonBox; - Gtk::ScrolledWindow _scrolledWindow; - Gtk::Button* del; - Gtk::Button* create; - + Gtk::Switch _direction; + Gtk::Box _button_box; + Gtk::Box _selectors_box; + Gtk::ScrolledWindow _scrolled_window_style; + Gtk::ScrolledWindow _scrolled_window_selectors; + + Gtk::Button _del; + Gtk::Button _create; + StyleDialog *_style_dialog; // Reading and writing the style element. Inkscape::XML::Node *_getStyleTextNode(); void _readStyleElement(); @@ -137,7 +143,8 @@ public: void _insertClass(SPObject *obj, const Glib::ustring &className); void _removeClass(const std::vector<SPObject *> &objVec, const Glib::ustring &className, bool all = false); void _removeClass(SPObject *obj, const Glib::ustring &className, bool all = false); - + void _toggleDirection(); + void _showWidgets(); void _selectObjects(int, int); // Variables @@ -175,7 +182,7 @@ public: } // namespace UI } // namespace Inkscape -#endif // SELECTORDIALOG_H +#endif // SELECTORSDIALOG_H /* Local Variables: diff --git a/src/ui/dialog/styledialog.cpp b/src/ui/dialog/styledialog.cpp index 2e43838b2..4ce8da925 100644 --- a/src/ui/dialog/styledialog.cpp +++ b/src/ui/dialog/styledialog.cpp @@ -200,8 +200,9 @@ StyleDialog::StyleDialog() Gtk::Box *alltoggler = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_HORIZONTAL)); Gtk::Label *infotoggler = Gtk::manage(new Gtk::Label(_("Edit Full Stylesheet"))); _all_css = Gtk::manage(new Gtk::Switch()); - _all_css->set_margin_right(5); - _all_css->set_margin_top(2); + _scroolpos = 0; + vadj = _scrolledWindow.get_vadjustment(); + vadj->signal_changed().connect(sigc::mem_fun(*this, &StyleDialog::_vscrool)); _all_css->property_active().signal_changed().connect(sigc::mem_fun(*this, &StyleDialog::_reload)); alltoggler->pack_start(*_all_css, false, false, 0); alltoggler->pack_start(*infotoggler, false, false, 0); @@ -228,6 +229,12 @@ StyleDialog::StyleDialog() _readStyleElement(); } +void +StyleDialog::_vscrool() +{ + _scroolpos = vadj->get_value(); +} + /** * Class destructor */ @@ -340,7 +347,6 @@ void StyleDialog::_readStyleElement() if (_updating) return; // Don't read if we wrote style element. _updating = true; - Inkscape::XML::Node *textNode = _getStyleTextNode(); if (textNode == nullptr) { std::cerr << "StyleDialog::_readStyleElement: No text node!" << std::endl; @@ -945,6 +951,7 @@ bool StyleDialog::_addRow(GdkEventButton *evt, Glib::RefPtr<Gtk::TreeStore> stor Glib::ustring selector, gint pos) { if (evt->type == GDK_BUTTON_RELEASE && evt->button == 1) { + vadj->set_value(_scroolpos); Gtk::TreeIter iter = store->append(); Gtk::TreeModel::Path path = (Gtk::TreeModel::Path)iter; Gtk::TreeModel::Row row = *(iter); @@ -1013,6 +1020,7 @@ void StyleDialog::_setAutocompletion(Gtk::Entry *entry, Glib::ustring name) void StyleDialog::_startValueEdit(Gtk::CellEditable* cell, const Glib::ustring& path, Glib::RefPtr<Gtk::TreeStore> store) { + vadj->set_value(_scroolpos); Gtk::TreeModel::Row row = *store->get_iter(path); if (row) { Gtk::Entry *entry = dynamic_cast<Gtk::Entry *>(cell); @@ -1069,6 +1077,7 @@ StyleDialog::_startValueEdit(Gtk::CellEditable* cell, const Glib::ustring& path, void StyleDialog::_startNameEdit(Gtk::CellEditable *cell, const Glib::ustring &path) { + vadj->set_value(_scroolpos); Glib::RefPtr<Gtk::ListStore> completionModel = Gtk::ListStore::create(_mCSSData); Glib::RefPtr<Gtk::EntryCompletion> entry_completion = Gtk::EntryCompletion::create(); entry_completion->set_model(completionModel); @@ -1118,6 +1127,7 @@ void StyleDialog::_nameEdited(const Glib::ustring &path, const Glib::ustring &na } else { css_tree->set_cursor(pathel, *(css_tree->get_column(col)), true); grab_focus(); + vadj->set_value(_scroolpos); } } } diff --git a/src/ui/dialog/styledialog.h b/src/ui/dialog/styledialog.h index 1053a6639..6e9aa4a72 100644 --- a/src/ui/dialog/styledialog.h +++ b/src/ui/dialog/styledialog.h @@ -17,6 +17,7 @@ #include "style-enums.h" #include <glibmm/regex.h> +#include <gtkmm/adjustment.h> #include <gtkmm/builder.h> #include <gtkmm/celleditable.h> #include <gtkmm/cellrenderercombo.h> @@ -110,6 +111,7 @@ class StyleDialog : public Widget::Panel { // Widgets Gtk::ScrolledWindow _scrolledWindow; + Glib::RefPtr< Gtk::Adjustment > vadj; Gtk::Box _mainBox; Gtk::Box _styleBox; Gtk::Switch *_all_css; @@ -133,6 +135,8 @@ class StyleDialog : public Widget::Panel { void _setAutocompletion(Gtk::Entry *entry, Glib::ustring name); bool _on_foreach_iter(const Gtk::TreeModel::iterator &iter); void _reload(); + void _vscrool(); + double _scroolpos; // Update watchers void _addWatcherRecursive(Inkscape::XML::Node *node); diff --git a/src/ui/dialog/xml-tree.cpp b/src/ui/dialog/xml-tree.cpp index 0a3cabef2..a4cc34335 100644 --- a/src/ui/dialog/xml-tree.cpp +++ b/src/ui/dialog/xml-tree.cpp @@ -193,14 +193,6 @@ XmlTree::XmlTree() : raise_node_button.signal_clicked().connect(sigc::mem_fun(*this, &XmlTree::cmd_raise_node)); lower_node_button.signal_clicked().connect(sigc::mem_fun(*this, &XmlTree::cmd_lower_node)); - styles = new StyleDialog; - styles_box.pack_start(*styles); - flowbox_content->insert(&styles_box, _("_Styles"), FLOWBOX_PAGE_STYLES, false, 200); - - selectors = new SelectorDialog; - selectors_box.pack_start(*selectors); - flowbox_content->insert(&selectors_box, _("S_electors"), FLOWBOX_PAGE_SELECTORS, false, 200); - desktopChangeConn = deskTrack.connectDesktopChanged( sigc::mem_fun(*this, &XmlTree::set_tree_desktop) ); deskTrack.connect(GTK_WIDGET(gobj())); @@ -356,12 +348,8 @@ void XmlTree::propagate_tree_select(Inkscape::XML::Node *repr) repr->type() == Inkscape::XML::COMMENT_NODE)) { attributes->setRepr(repr); - // styles->setRepr(repr); - // selectors->setRepr(repr); } else { attributes->setRepr(nullptr); - // styles->setRepr(nullptr); - // selectors->setRepr(nullptr); } } diff --git a/src/ui/dialog/xml-tree.h b/src/ui/dialog/xml-tree.h index e829a3c75..bd602366e 100644 --- a/src/ui/dialog/xml-tree.h +++ b/src/ui/dialog/xml-tree.h @@ -29,8 +29,6 @@ #include "ui/dialog/attrdialog.h" #include "ui/dialog/desktop-tracker.h" -#include "ui/dialog/selectordialog.h" -#include "ui/dialog/styledialog.h" class SPDesktop; @@ -185,8 +183,6 @@ private: enum { FLOWBOX_PAGE_NODES, FLOWBOX_PAGE_ATTRS, - FLOWBOX_PAGE_STYLES, - FLOWBOX_PAGE_SELECTORS, }; /** @@ -216,8 +212,6 @@ private: SPXMLViewTree *tree; //SPXMLViewAttrList *attributes; AttrDialog *attributes; - StyleDialog *styles; - SelectorDialog *selectors; /* XML Node Creation pop-up window */ Gtk::Entry *name_entry; @@ -225,8 +219,6 @@ private: Gtk::VBox node_box; Gtk::VBox attr_box; - Gtk::VBox selectors_box; - Gtk::VBox styles_box; Gtk::HBox status_box; Gtk::Label status; Gtk::Toolbar tree_toolbar; diff --git a/src/verbs.cpp b/src/verbs.cpp index 51322f971..92d97aa8e 100644 --- a/src/verbs.cpp +++ b/src/verbs.cpp @@ -2183,6 +2183,9 @@ void DialogVerb::perform(SPAction *action, void *data) case SP_VERB_DIALOG_XML_EDITOR: dt->_dlg_mgr->showDialog("XmlTree"); break; + case SP_VERB_DIALOG_SELECTORS: + dt->_dlg_mgr->showDialog("Selectors"); + break; case SP_VERB_DIALOG_FIND: dt->_dlg_mgr->showDialog("Find"); break; @@ -2239,11 +2242,7 @@ void DialogVerb::perform(SPAction *action, void *data) break; case SP_VERB_DIALOG_STYLE: dt->_dlg_mgr->showDialog("StyleDialog"); - break; - case SP_VERB_DIALOG_CSS: - dt->_dlg_mgr->showDialog("CssDialog"); break; - default: break; } @@ -3108,6 +3107,8 @@ Verb *Verb::_base_verbs[] = { INKSCAPE_ICON("dialog-text-and-font")), new DialogVerb(SP_VERB_DIALOG_XML_EDITOR, "DialogXMLEditor", N_("_XML Editor..."), N_("View and edit the XML tree of the document"), INKSCAPE_ICON("dialog-xml-editor")), + new DialogVerb(SP_VERB_DIALOG_SELECTORS, "DialogSelectors", N_("_Selectors & CSS..."), N_("View and edit selections and CSS styles"), INKSCAPE_ICON("dialog-selectors")), + new DialogVerb(SP_VERB_DIALOG_FIND, "DialogFind", N_("_Find/Replace..."), N_("Find objects in document"), INKSCAPE_ICON("edit-find")), new DialogVerb(SP_VERB_DIALOG_SPELLCHECK, "DialogSpellcheck", N_("Check Spellin_g..."), @@ -3134,7 +3135,6 @@ Verb *Verb::_base_verbs[] = { new DialogVerb(SP_VERB_DIALOG_OBJECTS, "DialogObjects", N_("Object_s..."), N_("View Objects"), INKSCAPE_ICON("dialog-layers")), new DialogVerb(SP_VERB_DIALOG_STYLE, "DialogStyle", N_("Style Dialog..."), N_("View Style Dialog"), nullptr), - new DialogVerb(SP_VERB_DIALOG_CSS, "DialogCss", N_("Css Dialog..."), N_("View Css Dialog"), nullptr), new DialogVerb(SP_VERB_DIALOG_LIVE_PATH_EFFECT, "DialogLivePathEffect", N_("Path E_ffects..."), N_("Manage, edit, and apply path effects"), INKSCAPE_ICON("dialog-path-effects")), new DialogVerb(SP_VERB_DIALOG_FILTER_EFFECTS, "DialogFilterEffects", N_("Filter _Editor..."), diff --git a/src/verbs.h b/src/verbs.h index 3715bab80..ab78bec13 100644 --- a/src/verbs.h +++ b/src/verbs.h @@ -334,7 +334,7 @@ enum { SP_VERB_DIALOG_LAYERS, SP_VERB_DIALOG_OBJECTS, SP_VERB_DIALOG_STYLE, - SP_VERB_DIALOG_CSS, + SP_VERB_DIALOG_SELECTORS, SP_VERB_DIALOG_LIVE_PATH_EFFECT, SP_VERB_DIALOG_FILTER_EFFECTS, SP_VERB_DIALOG_SVG_FONTS, |
