Commit f958a8f1 authored by Jabier Arraiza's avatar Jabier Arraiza

Move from XMLDialog to another paned dialog

parent c07d8d79
......@@ -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
......
<?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>
<?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>
<?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>
......@@ -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" />
......
......@@ -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" />
......
......@@ -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" />
......
......@@ -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" />
......
......@@ -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"/>
......
......@@ -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" />
......
......@@ -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;
......
......@@ -31,6 +31,7 @@
<toolitem action='DialogText' />
<toolitem action='DialogLayers' />
<toolitem action='DialogXMLEditor' />
<toolitem action='DialogSelectors' />
<toolitem action='DialogAlignDistribute' />
<separator />
<toolitem action='DialogDocumentProperties' />
......
......@@ -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) {
......
......@@ -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
......
......@@ -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>);
......
......@@ -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:
......
......@@ -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);
}
}
}
......
......@@ -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);
......
......@@ -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);
}
}
......
......@@ -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;
......
......@@ -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..."),
......
......@@ -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,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment