Commit 04c9ada
Move progress indicator to tab bar
Changed files (35)
modifiedbirdfont/GtkWindow.valamodifiedgraphics/tools_and_buttons.svgmodifiedicons/next_tab.pngmodifiedicons/previous_tab.pngmodifiedicons/tab1_left.pngmodifiedicons/tab1_right.pngmodifiedicons/tab2_left.pngmodifiedicons/tab2_right.pngmodifiedicons/tab3_left.pngmodifiedicons/tab3_right.pngdeletedicons/tabbar_background.pngmodifiedicons/window_icon.pngmodifiedlibbirdfont/BirdFont.valamodifiedlibbirdfont/BirdFontFile.valamodifiedlibbirdfont/CharDatabaseParser.valamodifiedlibbirdfont/GlyphBackgroundImage.valamodifiedlibbirdfont/GlyphRange.valamodifiedlibbirdfont/MenuTab.valamodifiedlibbirdfont/OpenFontFormat/CodePageBits.valamodifiedlibbirdfont/OpenFontFormat/FontData.valamodifiedlibbirdfont/OpenFontFormat/GlyfTable.valamodifiedlibbirdfont/OpenFontFormat/GposTable.valamodifiedlibbirdfont/OpenFontFormat/KernTable.valamodifiedlibbirdfont/OpenFontFormat/OpenFontFormatReader.valamodifiedlibbirdfont/OpenFontFormat/OpenFontFormatWriter.valamodifiedlibbirdfont/OpenFontFormat/PostTable.valamodifiedlibbirdfont/OpenFontFormat/load_font.cmodifiedlibbirdfont/OverView.valamodifiedlibbirdfont/Path.valamodifiedlibbirdfont/PreviewTools.valamodifiedlibbirdfont/ProgressBar.valamodifiedlibbirdfont/SvgFontFormatWriter.valamodifiedlibbirdfont/SvgParser.valamodifiedlibbirdfont/TabBar.valamodifiedlibbirdfont/TooltipArea.vala
Diff
@@ -901,7 +901,11 @@ class TabbarCanvas : DrawingArea { get_allocation (out alloc); queue_draw_area (0, 0, alloc.width, alloc.height); });- ++ tabbar.redraw.connect ((x, y, w, h) => {+ queue_draw_area (x, y, w, h);+ });+ set_size_request (20, 33); } @@ -22,6 +22,17 @@ <defs id="defs3788"> <linearGradient+ id="linearGradient4729">+ <stop+ style="stop-color:#a3a3a3;stop-opacity:1;"+ offset="0"+ id="stop4731" />+ <stop+ style="stop-color:#e7e7e7;stop-opacity:1;"+ offset="1"+ id="stop4733" />+ </linearGradient>+ <linearGradient inkscape:collect="always" id="linearGradient3575"> <stop@@ -508,6 +519,127 @@ id="linearGradient4175" xlink:href="#linearGradient3761-1-3-0" inkscape:collect="always" />+ <radialGradient+ inkscape:collect="always"+ xlink:href="#linearGradient4729"+ id="radialGradient4735"+ cx="292.20178"+ cy="132.02145"+ fx="292.20178"+ fy="132.02145"+ r="3.106405"+ gradientTransform="matrix(7.3911908,-0.03318318,0.03931299,8.7562147,-1871.0812,-1038.0186)"+ gradientUnits="userSpaceOnUse" />+ <radialGradient+ inkscape:collect="always"+ xlink:href="#linearGradient4729-7"+ id="radialGradient4735-4"+ cx="292.20178"+ cy="132.02145"+ fx="292.20178"+ fy="132.02145"+ r="3.106405"+ gradientTransform="matrix(7.3911908,-0.03318318,0.03931299,8.7562147,-1871.6726,-1005.9745)"+ gradientUnits="userSpaceOnUse" />+ <linearGradient+ id="linearGradient4729-7">+ <stop+ style="stop-color:#a3a3a3;stop-opacity:1;"+ offset="0"+ id="stop4731-7" />+ <stop+ style="stop-color:#e7e7e7;stop-opacity:1;"+ offset="1"+ id="stop4733-5" />+ </linearGradient>+ <radialGradient+ r="3.106405"+ fy="132.02145"+ fx="292.20178"+ cy="132.02145"+ cx="292.20178"+ gradientTransform="matrix(-7.3911908,-0.03318318,-0.03931299,8.7562147,2439.5473,-1037.8515)"+ gradientUnits="userSpaceOnUse"+ id="radialGradient4756"+ xlink:href="#linearGradient4729-7"+ inkscape:collect="always" />+ <linearGradient+ id="linearGradient4729-7-1">+ <stop+ style="stop-color:#a3a3a3;stop-opacity:1;"+ offset="0"+ id="stop4731-7-7" />+ <stop+ style="stop-color:#e7e7e7;stop-opacity:1;"+ offset="1"+ id="stop4733-5-4" />+ </linearGradient>+ <radialGradient+ inkscape:collect="always"+ xlink:href="#linearGradient4729-4"+ id="radialGradient4735-1"+ cx="292.20178"+ cy="132.02145"+ fx="292.20178"+ fy="132.02145"+ r="3.106405"+ gradientTransform="matrix(7.3911908,-0.03318318,0.03931299,8.7562147,-1871.6726,-1005.9745)"+ gradientUnits="userSpaceOnUse" />+ <linearGradient+ id="linearGradient4729-4">+ <stop+ style="stop-color:#acacac;stop-opacity:1;"+ offset="0"+ id="stop4731-2" />+ <stop+ style="stop-color:#f3f3f3;stop-opacity:1;"+ offset="1"+ id="stop4733-9" />+ </linearGradient>+ <radialGradient+ r="3.106405"+ fy="132.02145"+ fx="292.20178"+ cy="132.02145"+ cx="292.20178"+ gradientTransform="matrix(7.3911908,-0.03318318,0.03931299,8.7562147,-1870.7666,-1004.3992)"+ gradientUnits="userSpaceOnUse"+ id="radialGradient4803"+ xlink:href="#linearGradient4729-4"+ inkscape:collect="always" />+ <radialGradient+ r="3.106405"+ fy="132.02145"+ fx="292.20178"+ cy="132.02145"+ cx="292.20178"+ gradientTransform="matrix(7.3911908,-0.03318318,0.03931299,8.7562147,-1871.1011,-973.95692)"+ gradientUnits="userSpaceOnUse"+ id="radialGradient4803-6"+ xlink:href="#linearGradient4729-4-9"+ inkscape:collect="always" />+ <linearGradient+ id="linearGradient4729-4-9">+ <stop+ style="stop-color:#acacac;stop-opacity:1;"+ offset="0"+ id="stop4731-2-2" />+ <stop+ style="stop-color:#f3f3f3;stop-opacity:1;"+ offset="1"+ id="stop4733-9-2" />+ </linearGradient>+ <radialGradient+ r="3.106405"+ fy="132.02145"+ fx="292.20178"+ cy="132.02145"+ cx="292.20178"+ gradientTransform="matrix(-7.3911908,-0.03318318,-0.03931299,8.7562147,2439.1722,-1004.3156)"+ gradientUnits="userSpaceOnUse"+ id="radialGradient4857"+ xlink:href="#linearGradient4729-4-9"+ inkscape:collect="always" /> </defs> <sodipodi:namedview id="base"@@ -516,9 +648,9 @@ borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2"- inkscape:zoom="10.139082"- inkscape:cx="202.54523"- inkscape:cy="708.83752"+ inkscape:zoom="4.7795181"+ inkscape:cx="165.77656"+ inkscape:cy="765.14379" inkscape:current-layer="layer1" inkscape:document-units="px" showgrid="false"@@ -584,7 +716,7 @@ id="tspan3028" x="-0.14558615" y="-11.092395"- style="font-style:normal;font-variant:normal;font-weight:500;font-stretch:normal;font-family:URW Palladio L;-inkscape-font-specification:URW Palladio L Medium">Export at 320dpi and not to 72dpi, do not mogrify -resize 23.125% </tspan></text>+ style="font-style:normal;font-variant:normal;font-weight:500;font-stretch:normal;font-family:URW Palladio L;-inkscape-font-specification:URW Palladio L Medium">Export at 320dpi (not to 72dpi), do not mogrify -resize 23.125% </tspan></text> <g id="g3163" transform="translate(-2.5268478,-4.5571)"@@ -2032,41 +2164,214 @@ style="fill:none;stroke:#e6e6e6;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> </g> <g- id="g3799"- inkscape:export-filename="/home/johan/birdfont/icons/track.png"+ transform="matrix(0.81212303,-0.01830868,0.01830868,0.81212303,317.88007,47.377159)"+ id="A-7"+ style="fill:#b6b6b6;fill-opacity:0.9041096"+ inkscape:export-filename="/home/johan/birdfont/icons/progress_wheel.png" inkscape:export-xdpi="319" inkscape:export-ydpi="319"> <path- sodipodi:nodetypes="zcczcscz"- inkscape:export-ydpi="319.89001"- inkscape:export-xdpi="319.89001"- inkscape:export-filename="/home/johan/birdfont/icons/track.png" inkscape:connector-curvature="0"- id="path3617"- d="m 197.66197,52.57551 c 0.85553,2.191047 4.9245,9.369166 4.9245,9.369166 1.13323,-0.111314 2.02494,-0.38761 2.77792,-1.111168 0,0 -2.27634,-7.933034 -3.42269,-9.995514 -1.14635,-2.06248 -2.27205,-2.782916 -2.27205,-2.782916 0,0 -0.8337,-0.292969 -1.68551,0.06911 -0.72362,0.30759 -1.2313,1.042059 -1.2313,1.042059 0,0 0.0536,1.218217 0.90913,3.409263 z"- style="fill:#e6e6e6;stroke:#858585;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />- <path- inkscape:export-ydpi="319.89001"- inkscape:export-xdpi="319.89001"- inkscape:export-filename="/home/johan/birdfont/icons/track.png"- inkscape:connector-curvature="0"- id="path3623"- d="m 194.88239,63.475848 c 2.26624,-4.567729 6.53453,3.336107 9.74418,1.026228 0.72121,-0.519032 0.65487,-0.262366 0.47533,-0.94071"- style="fill:none;stroke:#000000;stroke-width:0.59260023px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />+ style="fill:#b6b6b6;fill-opacity:0.9041096;stroke-width:0px"+ d="m 0.07210424,58.273402 q 0.60800818,-1.715764 2.18775636,-3.153686 1.5797481,-1.437921 3.3680684,-2.125791 1.7883203,-0.68787 3.8495525,-0.635299 2.0612325,0.05257 3.8121625,0.830706 1.750931,0.778137 3.171269,2.272821 1.420339,1.494684 2.108209,3.283004 0.687869,1.788321 0.635299,3.849553 -0.05257,2.061232 -0.830707,3.812163 -0.778136,1.75093 -2.27282,3.171269 -1.494684,1.420338 -3.283005,2.108208 -1.78832,0.687869 -3.8495521,0.635299 -2.0612322,-0.05257 -3.8121629,-0.830707 -1.7509307,-0.778136 -3.1712691,-2.27282 -1.42033829,-1.494684 -2.10820798,-3.283004 0.92852503,-0.445359 0.4571553,-0.261095 -0.47136973,0.184264 -0.47610788,0.158654 0.94747761,-0.342918 1.89495526,-0.685835 0.9474776,-0.342917 1.8949552,-0.685835 0.4165903,0.945444 1.2639562,1.902098 0.8473658,0.956654 1.8950433,1.422256 1.0476775,0.465601 2.2810253,0.497057 1.2333474,0.03146 2.3033974,-0.380134 1.07005,-0.41159 1.964401,-1.261456 0.894351,-0.849866 1.359953,-1.897544 0.465601,-1.047677 0.497057,-2.281025 0.03145,-1.233348 -0.380135,-2.303398 -0.41159,-1.070049 -1.261456,-1.964401 -0.849866,-0.894351 -1.897543,-1.359952 -1.047678,-0.465602 -2.2810254,-0.497057 -1.2333478,-0.03146 -2.3033975,0.380134 -1.0700497,0.41159 -1.9644009,1.261456 -0.8943512,0.849866 -1.3599525,1.897543 C 2.8414593,59.475789 0.99522259,58.674198 0.07210424,58.273402 z"+ id="path_A-5" />+ </g>+ <path+ sodipodi:nodetypes="ccccccc"+ inkscape:connector-curvature="0"+ id="path4560"+ d="m 298.50556,176.99054 c -0.47451,-0.0133 -0.17678,-0.37966 -0.17678,-0.62868 -2.19013,0 -1.5206,-2.82661 -1.5206,-4.39749 l 0,-12.48559 c 0,-2.87773 -1.62382,-5.02988 -4.51543,-5.02988 l 0.17678,22.51955 z"+ style="fill:#ffffff;fill-opacity:1;stroke:none"+ inkscape:export-filename="/home/johan/birdfont/icons/tab3_right.png"+ inkscape:export-xdpi="319"+ inkscape:export-ydpi="319" />+ <path+ sodipodi:nodetypes="cccsc"+ inkscape:connector-curvature="0"+ id="path4558"+ d="m 292.29449,154.6709 c 2.89161,0 4.33991,2.40805 4.33991,5.28578 l 0.0857,15.42017 c 0,0.40233 0.33562,0.79574 0.43631,0.86682 0.34536,0.24381 0.57069,0.25557 1.14385,0.25961"+ style="fill:none;stroke:#afafaf;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"+ inkscape:export-filename="/home/johan/birdfont/icons/tab3_right.png"+ inkscape:export-xdpi="319"+ inkscape:export-ydpi="319" />+ <path+ style="fill:none;stroke:#858585;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"+ d="m 292.29275,154.4489 c 2.89161,0 4.51543,2.15215 4.51543,5.02988 l 0,15.58238 c 0,1.03097 0.61149,1.41999 1.5206,1.44552"+ id="path4556"+ inkscape:connector-curvature="0"+ sodipodi:nodetypes="cccc"+ inkscape:export-filename="/home/johan/birdfont/icons/tab3_right.png"+ inkscape:export-xdpi="319"+ inkscape:export-ydpi="319" />+ <path+ sodipodi:nodetypes="ccccccc"+ inkscape:connector-curvature="0"+ id="path4560-1"+ d="m 270.27386,176.85169 c 0.47451,-0.0133 0.17678,-0.37966 0.17678,-0.62868 2.19013,0 1.5206,-2.82661 1.5206,-4.39749 l 0,-12.48559 c 0,-2.87773 1.62382,-5.02988 4.51543,-5.02988 l -0.17678,22.51955 z"+ style="fill:#ffffff;fill-opacity:1;stroke:none"+ inkscape:export-filename="/home/johan/birdfont/icons/tab3_left.png"+ inkscape:export-xdpi="318.48999"+ inkscape:export-ydpi="318.48999" />+ <path+ sodipodi:nodetypes="cccsc"+ inkscape:connector-curvature="0"+ id="path4558-3"+ d="m 276.48493,154.53205 c -2.89161,0 -4.33991,2.40805 -4.33991,5.28578 l -0.0857,15.42017 c 0,0.40233 -0.33562,0.79574 -0.43631,0.86682 -0.34536,0.24381 -0.57069,0.25557 -1.14385,0.25961"+ style="fill:none;stroke:#afafaf;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"+ inkscape:export-filename="/home/johan/birdfont/icons/tab3_left.png"+ inkscape:export-xdpi="318.48999"+ inkscape:export-ydpi="318.48999" />+ <path+ style="fill:none;stroke:#858585;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"+ d="m 276.48667,154.31005 c -2.89161,0 -4.51543,2.15215 -4.51543,5.02988 l 0,15.58238 c 0,1.03097 -0.61149,1.41999 -1.5206,1.44552"+ id="path4556-9"+ inkscape:connector-curvature="0"+ sodipodi:nodetypes="cccc"+ inkscape:export-filename="/home/johan/birdfont/icons/tab3_left.png"+ inkscape:export-xdpi="318.48999"+ inkscape:export-ydpi="318.48999" />+ <path+ sodipodi:nodetypes="ccccccc"+ inkscape:connector-curvature="0"+ id="path4560-4"+ d="m 299.86651,108.62041 c -0.47451,-0.0133 -0.17678,-0.37966 -0.17678,-0.62868 -2.19013,0 -1.5206,-2.82661 -1.5206,-4.39749 l 0,-12.485577 c 0,-2.87773 -1.62382,-5.02988 -4.51543,-5.02988 l 0.17678,22.519537 z"+ style="fill:url(#radialGradient4735);fill-opacity:1;stroke:none"+ inkscape:export-filename="/home/johan/birdfont/icons/tab1_right.png"+ inkscape:export-xdpi="319"+ inkscape:export-ydpi="319" />+ <path+ sodipodi:nodetypes="cccsc"+ inkscape:connector-curvature="0"+ id="path4558-8"+ d="m 293.65544,86.300783 c 2.89161,0 4.33991,2.40805 4.33991,5.28578 l 0.0857,15.420157 c 0,0.40233 0.33562,0.79574 0.43631,0.86682 0.34536,0.24381 0.57069,0.25557 1.14385,0.25961"+ style="fill:none;stroke:#afafaf;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"+ inkscape:export-filename="/home/johan/birdfont/icons/tab1_right.png"+ inkscape:export-xdpi="319"+ inkscape:export-ydpi="319" />+ <path+ style="fill:none;stroke:#858585;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"+ d="m 293.6537,86.078783 c 2.89161,0 4.51543,2.15215 4.51543,5.02988 l 0,15.582367 c 0,1.03097 0.61149,1.41999 1.5206,1.44552 l -5.86287,0"+ id="path4556-2"+ inkscape:connector-curvature="0"+ sodipodi:nodetypes="cccc"+ inkscape:export-filename="/home/johan/birdfont/icons/tab1_right.png"+ inkscape:export-xdpi="319"+ inkscape:export-ydpi="319" />+ <path+ sodipodi:nodetypes="ccccccc"+ inkscape:connector-curvature="0"+ id="path4560-4-2"+ d="m 268.59951,108.78754 c 0.47451,-0.0133 0.17678,-0.37966 0.17678,-0.62868 2.19013,0 1.5206,-2.82661 1.5206,-4.39749 l 0,-12.485577 c 0,-2.87773 1.62382,-5.02988 4.51543,-5.02988 l -0.17678,22.519537 z"+ style="fill:url(#radialGradient4756);fill-opacity:1;stroke:none"+ inkscape:export-filename="/home/johan/birdfont/icons/tab1_left.png"+ inkscape:export-xdpi="319"+ inkscape:export-ydpi="319" />+ <path+ sodipodi:nodetypes="cccsc"+ inkscape:connector-curvature="0"+ id="path4558-8-0"+ d="m 274.81058,86.467913 c -2.89161,0 -4.33991,2.40805 -4.33991,5.28578 l -0.0857,15.420157 c 0,0.40233 -0.33562,0.79574 -0.43631,0.86682 -0.34536,0.24381 -0.57069,0.25557 -1.14385,0.25961"+ style="fill:none;stroke:#afafaf;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"+ inkscape:export-filename="/home/johan/birdfont/icons/tab1_left.png"+ inkscape:export-xdpi="319"+ inkscape:export-ydpi="319" />+ <path+ style="fill:none;stroke:#858585;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"+ d="m 274.81232,86.245913 c -2.89161,0 -4.51543,2.15215 -4.51543,5.02988 l 0,15.582367 c 0,1.03097 -0.61149,1.41999 -1.5206,1.44552 l 5.86287,0"+ id="path4556-2-6"+ inkscape:connector-curvature="0"+ sodipodi:nodetypes="cccc"+ inkscape:export-filename="/home/johan/birdfont/icons/tab1_left.png"+ inkscape:export-xdpi="319"+ inkscape:export-ydpi="319" />+ <path+ sodipodi:nodetypes="ccccccc"+ inkscape:connector-curvature="0"+ id="path4560-4-1"+ d="m 300.18113,142.23986 c -0.47451,-0.0133 -0.17678,-0.37966 -0.17678,-0.62868 -2.19013,0 -1.5206,-2.82661 -1.5206,-4.39749 l 0,-12.48558 c 0,-2.87773 -1.62382,-5.02988 -4.51543,-5.02988 l 0.17678,22.51954 z"+ style="fill:url(#radialGradient4803);fill-opacity:1;stroke:none"+ inkscape:export-filename="/home/johan/birdfont/icons/tab2_right.png"+ inkscape:export-xdpi="319"+ inkscape:export-ydpi="319" />+ <path+ sodipodi:nodetypes="cccsc"+ inkscape:connector-curvature="0"+ id="path4558-8-05"+ d="m 293.97006,119.92023 c 2.89161,0 4.33991,2.40805 4.33991,5.28578 l 0.0857,15.42016 c 0,0.40233 0.33562,0.79574 0.43631,0.86682 0.34536,0.24381 0.57069,0.25557 1.14385,0.25961"+ style="fill:none;stroke:#afafaf;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"+ inkscape:export-filename="/home/johan/birdfont/icons/tab2_right.png"+ inkscape:export-xdpi="319"+ inkscape:export-ydpi="319" />+ <path+ style="fill:none;stroke:#858585;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"+ d="m 293.96832,119.69823 c 2.89161,0 4.51543,2.15215 4.51543,5.02988 l 0,15.58237 c 0,1.03097 0.61149,1.41999 1.5206,1.44552 l -5.86287,0"+ id="path4556-2-4"+ inkscape:connector-curvature="0"+ sodipodi:nodetypes="cccc"+ inkscape:export-filename="/home/johan/birdfont/icons/tab2_right.png"+ inkscape:export-xdpi="319"+ inkscape:export-ydpi="319" />+ <path+ sodipodi:nodetypes="ccccccc"+ inkscape:connector-curvature="0"+ id="path4560-4-1-9"+ d="m 268.22439,142.32343 c 0.47451,-0.0133 0.17678,-0.37966 0.17678,-0.62868 2.19013,0 1.5206,-2.82661 1.5206,-4.39749 l 0,-12.48558 c 0,-2.87773 1.62382,-5.02988 4.51543,-5.02988 l -0.17678,22.51954 z"+ style="fill:url(#radialGradient4857);fill-opacity:1;stroke:none"+ inkscape:export-filename="/home/johan/birdfont/icons/tab2_left.png"+ inkscape:export-xdpi="319"+ inkscape:export-ydpi="319" />+ <path+ sodipodi:nodetypes="cccsc"+ inkscape:connector-curvature="0"+ id="path4558-8-05-4"+ d="m 274.43546,120.0038 c -2.89161,0 -4.33991,2.40805 -4.33991,5.28578 l -0.0857,15.42016 c 0,0.40233 -0.33562,0.79574 -0.43631,0.86682 -0.34536,0.24381 -0.57069,0.25557 -1.14385,0.25961"+ style="fill:none;stroke:#afafaf;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"+ inkscape:export-filename="/home/johan/birdfont/icons/tab2_left.png"+ inkscape:export-xdpi="319"+ inkscape:export-ydpi="319" />+ <path+ style="fill:none;stroke:#858585;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"+ d="m 274.4372,119.7818 c -2.89161,0 -4.51543,2.15215 -4.51543,5.02988 l 0,15.58237 c 0,1.03097 -0.61149,1.41999 -1.5206,1.44552 l 5.86287,0"+ id="path4556-2-4-0"+ inkscape:connector-curvature="0"+ sodipodi:nodetypes="cccc"+ inkscape:export-filename="/home/johan/birdfont/icons/tab2_left.png"+ inkscape:export-xdpi="319"+ inkscape:export-ydpi="319" />+ <path+ style="fill:none;stroke:#858585;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"+ d="m 269.07873,187.76549 28.1407,0"+ id="path4880"+ inkscape:connector-curvature="0"+ sodipodi:nodetypes="cc"+ inkscape:export-filename="/home/johan/birdfont/icons/tab_bar_background.png"+ inkscape:export-xdpi="319"+ inkscape:export-ydpi="319" />+ <g+ id="B-6"+ transform="matrix(0.81155097,0,0,0.81155097,348.0384,80.629261)"+ style="fill:#b6b6b6"+ inkscape:export-filename="/home/johan/birdfont/icons/next_tab.png"+ inkscape:export-xdpi="319"+ inkscape:export-ydpi="319"> <path- inkscape:export-ydpi="319.89001"- inkscape:export-xdpi="319.89001"- inkscape:export-filename="/home/johan/birdfont/icons/track.png"- inkscape:connector-curvature="0"- id="path3621"- d="m 203.99938,61.379513 1.22611,2.787498"- style="fill:none;stroke:#858585;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />+ id="path_B-1"+ d="m 13.412585,68.93231 q -1.325797,0.640992 -2.907881,0.732288 -1.5820831,0.0913 -2.9728122,-0.392935 Q 6.1411627,68.787433 4.9579045,67.733287 3.7746464,66.679141 3.1336552,65.353344 2.4926639,64.027548 2.4013677,62.445464 2.3100715,60.863381 2.7943021,59.472652 3.2785327,58.081923 4.3326785,56.898664 5.3868243,55.715406 6.712621,55.074415 q 1.3257968,-0.640991 2.9078802,-0.732287 1.5820838,-0.0913 2.9728128,0.392934 1.390729,0.484231 2.573987,1.538376 1.183258,1.054146 1.824249,2.379943 0.640992,1.325797 0.732288,2.90788 0.0913,1.582084 -0.392934,2.972813 -0.484231,1.390729 -1.538377,2.573987 -1.054146,1.183258 -2.379942,1.824249 z m 6.062929,-3.65815 q 0.630042,-1.809503 0.511254,-3.867981 -0.118787,-2.058478 -0.952792,-3.783496 -0.834006,-1.725019 -2.373565,-3.096587 -1.539559,-1.371569 -3.349062,-2.00161 -1.809503,-0.630042 -3.8679811,-0.511254 -2.0584779,0.118787 -3.7834965,0.952792 -1.7250185,0.834006 -3.096587,2.373565 -1.3715685,1.539559 -2.00160988,3.349062 -0.63004134,1.809503 -0.51125418,3.867981 0.11878715,2.058478 0.95279266,3.783497 0.8340056,1.725018 2.3735645,3.096587 1.5395589,1.371568 3.3490622,2.001609 1.8095032,0.630042 3.8679813,0.511255 2.058478,-0.118787 3.783496,-0.952793 1.725019,-0.834006 3.096587,-2.373564 1.371569,-1.539559 2.00161,-3.349063 z m -11.3919557,0.645926 5.9690657,-4.0457 -5.9690657,-3.979378 0,8.025078 z"+ style="fill:#b6b6b6;stroke-width:0px"+ inkscape:connector-curvature="0" />+ </g>+ <g+ id="B-6-4"+ transform="matrix(-0.81155097,0,0,0.81155097,335.72858,80.573302)"+ style="fill:#b6b6b6"+ inkscape:export-filename="/home/johan/birdfont/icons/previous_tab.png"+ inkscape:export-xdpi="319"+ inkscape:export-ydpi="319"> <path- sodipodi:nodetypes="cc"- inkscape:connector-curvature="0"- id="path3795"- d="m 200.78554,58.501116 c 1.85663,0.04157 2.59285,-0.471854 3.47686,-1.323342"- style="fill:none;stroke:#858585;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />+ id="path_B-1-5"+ d="m 13.412585,68.93231 q -1.325797,0.640992 -2.907881,0.732288 -1.5820831,0.0913 -2.9728122,-0.392935 Q 6.1411627,68.787433 4.9579045,67.733287 3.7746464,66.679141 3.1336552,65.353344 2.4926639,64.027548 2.4013677,62.445464 2.3100715,60.863381 2.7943021,59.472652 3.2785327,58.081923 4.3326785,56.898664 5.3868243,55.715406 6.712621,55.074415 q 1.3257968,-0.640991 2.9078802,-0.732287 1.5820838,-0.0913 2.9728128,0.392934 1.390729,0.484231 2.573987,1.538376 1.183258,1.054146 1.824249,2.379943 0.640992,1.325797 0.732288,2.90788 0.0913,1.582084 -0.392934,2.972813 -0.484231,1.390729 -1.538377,2.573987 -1.054146,1.183258 -2.379942,1.824249 z m 6.062929,-3.65815 q 0.630042,-1.809503 0.511254,-3.867981 -0.118787,-2.058478 -0.952792,-3.783496 -0.834006,-1.725019 -2.373565,-3.096587 -1.539559,-1.371569 -3.349062,-2.00161 -1.809503,-0.630042 -3.8679811,-0.511254 -2.0584779,0.118787 -3.7834965,0.952792 -1.7250185,0.834006 -3.096587,2.373565 -1.3715685,1.539559 -2.00160988,3.349062 -0.63004134,1.809503 -0.51125418,3.867981 0.11878715,2.058478 0.95279266,3.783497 0.8340056,1.725018 2.3735645,3.096587 1.5395589,1.371568 3.3490622,2.001609 1.8095032,0.630042 3.8679813,0.511255 2.058478,-0.118787 3.783496,-0.952793 1.725019,-0.834006 3.096587,-2.373564 1.371569,-1.539559 2.00161,-3.349063 z m -11.3919557,0.645926 5.9690657,-4.0457 -5.9690657,-3.979378 0,8.025078 z"+ style="fill:#b6b6b6;stroke-width:0px"+ inkscape:connector-curvature="0" /> </g> </g> </svg>Binary files a/icons/next_tab.png and b/icons/next_tab.png differBinary files a/icons/previous_tab.png and b/icons/previous_tab.png differBinary files a/icons/tab1_left.png and b/icons/tab1_left.png differBinary files a/icons/tab1_right.png and b/icons/tab1_right.png differBinary files a/icons/tab2_left.png and b/icons/tab2_left.png differBinary files a/icons/tab2_right.png and b/icons/tab2_right.png differBinary files a/icons/tab3_left.png and b/icons/tab3_left.png differBinary files a/icons/tab3_right.png and b/icons/tab3_right.png differdeleted file mode 100644Binary files a/icons/tabbar_background.png and /dev/null differBinary files a/icons/window_icon.png and b/icons/window_icon.png differ@@ -487,4 +487,11 @@ public string t_ (string t) { return _(t); } +/** Print a warning if Birdfont was started with the --test argument. */+public static void warn_if_test (string message) {+ if (BirdFont.has_argument ("--test")) {+ warning (message);+ }+}+ }@@ -80,25 +80,31 @@ class BirdFontFile : GLib.Object { bool ok = true; Xml.Node* root; + TabBar.start_wheel (); tr.read (); root = tr.expand (); - if (is_null (root)) {+ if (!is_null (root)) {+ create_background_files (root);+ ok = parse_file (root);+ } else { warning ("No root element");- tr.close ();- return false; }-- create_background_files (root);- ok = parse_file (root);+ tr.close ();- + TabBar.stop_wheel ();+ return ok; } public bool write_font_file (string path, bool backup = false) {+ TabBar.start_wheel ();+ try {- File file = File.new_for_path (path);+ DataOutputStream os;+ File file;+ + file = File.new_for_path (path); if (file.query_file_type (0) == FileType.DIRECTORY) { warning (@"Can't save font. $path is a directory.");@@ -108,9 +114,8 @@ class BirdFontFile : GLib.Object { if (file.query_exists ()) { file.delete (); }- - DataOutputStream os = new DataOutputStream (file.create (FileCreateFlags.REPLACE_DESTINATION));- ++ os = new DataOutputStream (file.create (FileCreateFlags.REPLACE_DESTINATION)); write_root_tag (os); // this a backup of another font@@ -154,8 +159,7 @@ class BirdFontFile : GLib.Object { } catch (GLib.Error e) { warning (e.message); }- - ProgressBar.set_progress (0); + TooltipArea.show_text (t_("Saving")); }); @@ -185,8 +189,7 @@ class BirdFontFile : GLib.Object { warning (@"Failed to save $path \n"); warning (@"$(ef.message) \n"); }- - ProgressBar.set_progress (0); + TooltipArea.show_text (t_("Saving")); }); @@ -200,7 +203,7 @@ class BirdFontFile : GLib.Object { return false; } - TooltipArea.show_text ("");+ TabBar.stop_wheel (); return true; } @@ -216,12 +219,10 @@ class BirdFontFile : GLib.Object { public void write_kerning (DataOutputStream os) throws GLib.Error { uint num_kerning_pairs;- uint progress; string range; num_kerning_pairs = KerningClasses.get_instance ().classes_first.length ();- progress = num_kerning_pairs;- ProgressBar.set_progress (1);+ for (uint i = 0; i < num_kerning_pairs; i++) { range = KerningClasses.get_instance ().classes_first.nth (i).data.get_all_ranges (); @@ -239,8 +240,7 @@ class BirdFontFile : GLib.Object { os.put_string ("hadjustment=\""); os.put_string (float_point (KerningClasses.get_instance ().classes_kerning.nth (i).data.val)); os.put_string ("\" />\n");- - ProgressBar.set_progress (--progress / (double) num_kerning_pairs);+ Tool.yield (); } @@ -259,13 +259,11 @@ class BirdFontFile : GLib.Object { os.put_string (float_point (k)); os.put_string ("\" />\n"); - ProgressBar.set_progress (++progress / (double) num_kerning_pairs); Tool.yield (); } catch (GLib.Error e) { warning (@"$(e.message) \n"); } - ProgressBar.set_progress (0); TooltipArea.show_text (t_("Saving")); }); }@@ -523,7 +521,6 @@ class BirdFontFile : GLib.Object { private bool parse_file (Xml.Node* root) { Xml.Node* node = root;- int i = 0; for (Xml.Node* iter = node->children; iter != null; iter = iter->next) { // this is a backup file set path to the original @@ -611,14 +608,9 @@ class BirdFontFile : GLib.Object { if (iter->name == "kerning") { parse_kerning (iter); }- - ProgressBar.set_progress (++i / 20480.0);- - if (i == 20480) {- i = 0;- } TooltipArea.show_text (t_("Loading XML data."));+ Tool.yield (); } TooltipArea.show_text ("");@@ -683,7 +675,7 @@ class BirdFontFile : GLib.Object { hadjustment = double.parse (attr_content); } - ProgressBar.set_progress (0);+ Tool.yield (); } if (range_left.get_length () > 1) {@@ -140,7 +140,6 @@ public class CharDatabaseParser : GLib.Object { CharDatabase.full_unicode_range = utf8; CharDatabase.show_loading_message (); CharDatabase.database_is_loaded = true;- ProgressBar.set_progress (0); return false; }); idle.attach (null);@@ -405,7 +405,7 @@ public class GlyphBackgroundImage { ct.rectangle (0, 0, allocation.width, allocation.height); ct.fill (); - // scale both canvas and image at the same time; rather tricky.+ // scale both canvas and image at the same time scale_x = view_zoom * img_scale_x; scale_y = view_zoom * img_scale_y; @@ -417,7 +417,7 @@ public class GlyphBackgroundImage { ct.paint (); ct.restore (); - // append it+ // add it cr.save (); cr.set_source_surface (st, 0, 0); cr.paint ();@@ -116,13 +116,19 @@ public class GlyphRange { } /** Parse ranges on the form a-z. Single characters can be added as well as - * multiple ranges and characters can be added separated by space. The - * word "space" is used to kern against the space character and divis to- * kern against "-".+ * multiple ranges separated by space. The word "space" is used to kern against + * the space character and the word "divis" is used to kern against "-". * @param ranges unicode ranges- * @return true if the range could be fully parsed */ public void parse_ranges (string ranges) throws MarkupError {+ parse_range_string (ranges, true);+ }+ + public void parse_ranges_async (string ranges) throws MarkupError {+ parse_range_string (ranges, false);+ } + + private void parse_range_string (string ranges, bool sync) throws MarkupError { string[] r; if (ranges == " ") {@@ -155,6 +161,10 @@ public class GlyphRange { } else { throw new MarkupError.PARSE (@"$w is not a single letter or a unicode range."); }++ if (!sync) {+ Tool.yield ();+ } } } @@ -43,11 +43,13 @@ public class MenuTab : FontDisplay { } public static void export_all () {- if (set_suppress_event (true)) { - ExportTool.export_all ();- } else {+ if (!set_suppress_event (true)) { warning ("suppressed event");- } + return;+ }+ + ExportTool.export_all ();+ set_suppress_event (false); } public static bool set_suppress_event (bool e) {@@ -69,6 +71,7 @@ public class MenuTab : FontDisplay { public static void select_overview () { if (suppress_event) {+ warn_if_test ("Event supressed"); return; } @@ -89,6 +92,7 @@ public class MenuTab : FontDisplay { int i; if (suppress_event) {+ warn_if_test ("Event supressed"); return false; } @@ -124,6 +128,7 @@ public class MenuTab : FontDisplay { bool saved = false; if (suppress_event) {+ warn_if_test ("Event supressed"); return false; } @@ -170,6 +175,7 @@ public class MenuTab : FontDisplay { string? fn; if (suppress_event) {+ warn_if_test ("Event supressed"); return; } @@ -192,6 +198,7 @@ public class MenuTab : FontDisplay { SaveDialogListener dialog = new SaveDialogListener (); if (suppress_event) {+ warn_if_test ("Event supressed"); return; } @@ -236,6 +243,7 @@ public class MenuTab : FontDisplay { Font font = BirdFont.get_current_font (); if (suppress_event) {+ warn_if_test ("Event supressed"); return; } @@ -262,6 +270,7 @@ public class MenuTab : FontDisplay { Font f; if (suppress_event) {+ warn_if_test ("Event supressed"); return; } @@ -289,6 +298,7 @@ public class MenuTab : FontDisplay { Preferences.save (); if (suppress_event) {+ warn_if_test ("Event supressed"); return; } @@ -316,6 +326,7 @@ public class MenuTab : FontDisplay { public static void show_kerning_context () { if (suppress_event) {+ warn_if_test ("Event supressed"); return; } @@ -327,6 +338,7 @@ public class MenuTab : FontDisplay { Font font = BirdFont.get_current_font (); if (suppress_event) {+ warn_if_test ("Event supressed"); return; } @@ -345,6 +357,7 @@ public class MenuTab : FontDisplay { FontFormat format = BirdFont.get_current_font ().format; if (suppress_event) {+ warn_if_test ("Event supressed"); return; } @@ -363,6 +376,7 @@ public class MenuTab : FontDisplay { /** Display the language selection tab. */ public static void select_language () { if (suppress_event) {+ warn_if_test ("Event supressed"); return; } @@ -371,6 +385,7 @@ public class MenuTab : FontDisplay { public static void use_current_glyph_as_background () { if (suppress_event) {+ warn_if_test ("Event supressed"); return; } @@ -387,6 +402,7 @@ public class MenuTab : FontDisplay { public static void remove_all_kerning_pairs () { if (suppress_event) {+ warn_if_test ("Event supressed"); return; } @@ -396,6 +412,7 @@ public class MenuTab : FontDisplay { public static void list_all_kerning_pairs () { if (suppress_event) {+ warn_if_test ("Event supressed"); return; } @@ -42,6 +42,8 @@ public class CodePageBits : GLib.Object { } else { set_bits_for_glyph (g, ref p0, ref p1); }+ + Tool.yield (); } } @@ -161,7 +163,7 @@ public class CodePageBits : GLib.Object { ranges = new GlyphRange (); try {- ranges.parse_ranges (unicode_ranges);+ ranges.parse_ranges_async (unicode_ranges); } catch (GLib.Error e) { warning (e.message); }@@ -77,7 +77,7 @@ public class FontData : Object { added_bytes++; if (added_bytes % 1024 == 0) {- OpenFontFormatWriter.show_progress (added_bytes / (double) l);+ Tool.yield (); } } @@ -125,8 +125,6 @@ public class GlyfTable : Table { printd (@"loca fd.length (): $(fd.length ())\n"); last_len = fd.length ();- - ProgressBar.set_progress ((double) (++i) / num_glyphs); } location_offsets.append (fd.length ()); // last entry in loca table is special@@ -182,8 +180,6 @@ public class GlyfTable : Table { printd ("Adding unassigned glyph."); unassigned_glyphs.append (g); }- - OpenFontFormatWriter.show_progress (++i / num_glyphs); } foreach (Glyph ug in unassigned_glyphs) {@@ -215,16 +215,12 @@ public class GposTable : Table { } catch (Error e) { warning (e.message); }- - OpenFontFormatWriter.show_progress (i / num_pairs); }, num_pairs); if (unlikely (pairs_set_length () != written)) { warning (@"Bad pair set length: $(pairs_set_length ()), real length: $written"); } - ProgressBar.set_progress (0); // reset progress bar- if (unlikely (fd.length () != coverage_offset)) { warning (@"Bad coverage offset, coverage_offset: $coverage_offset, real length: $(fd.length ())"); warning (@"pairs_offset_length: $(pairs_offset_length ()) pairs_set_length: $(pairs_set_length ())");@@ -163,8 +163,6 @@ public class KernTable : Table { } catch (GLib.Error e) { warning (e.message); }- - OpenFontFormatWriter.show_progress (i / n_pairs); }, n_pairs); fd.pad ();@@ -156,7 +156,6 @@ public class OpenFontFormatReader : Object { unichar left, right; double kerning, units_per_em; uint npairs = 0;- uint i = 0; try { reader.parse_index (file_name);@@ -190,9 +189,7 @@ public class OpenFontFormatReader : Object { bf_kerning.append (@"$kerning".replace (",", ".")); bf_kerning.append ("\" />\n"); }- - ++i;- ProgressBar.set_progress ((npairs - i) / (double) npairs);+ Tool.yield (); } } catch (GLib.Error e) {@@ -47,6 +47,8 @@ public class OpenFontFormatWriter : Object { FontData fd; uint l; + TabBar.start_wheel ();+ font = nfont; directory_table.process (); @@ -68,10 +70,8 @@ public class OpenFontFormatWriter : Object { os.put_byte (data[j]); } }- }- - public static void show_progress (double progress) {- ProgressBar.set_progress (progress);+ + TabBar.stop_wheel (); } public void close () throws Error {@@ -89,7 +89,7 @@ public class PostTable : Table { uint16 nnames = dis.read_ushort (); if (format != 0x00020000) {- warning ("Only post tables of version 2 will parset got $(format.get_string ())");+ warning ("Only post tables of version 2 will be parsed found version $(format.get_string ())"); return; } @@ -1185,7 +1185,9 @@ public class PostTable : Table { public void process () throws Error { FontData fd = new FontData (); string n;- + int name_index;+ Glyph g;+ fd.add_fixed (0x00020000); // Version fd.add_fixed (0x00000000); // italicAngle @@ -1211,23 +1213,21 @@ public class PostTable : Table { assert (names.length () == 0); add_standard_names (); - int index;- Glyph g; for (int i = 1; i < glyf_table.glyphs.length (); i++) { g = (!) glyf_table.glyphs.nth (i).data;- index = get_standard_index (g.unichar_code);+ name_index = get_standard_index (g.unichar_code); - if (index != 0) {- fd.add_ushort ((uint16) index); // use standard name+ if (name_index != 0) {+ fd.add_ushort ((uint16) name_index); // use standard name } else { printd (@"Adding non standard postscript name $(g.get_name ())\n"); - index = (int) names.length (); // use font specific name- fd.add_ushort ((uint16) index);+ name_index = (int) names.length (); // use font specific name+ fd.add_ushort ((uint16) name_index); names.append (g.get_name ()); } - this.index.append ((uint16) index);+ this.index.append ((uint16) name_index); } for (int i = 258; i < names.length (); i++) {@@ -571,7 +571,7 @@ FT_ULong get_charcode (FT_Face face, FT_UInt gid) { } } - g_warning ("Can not find unicode value.");+ g_warning ("Can not find unicode value for gid %d.", gid); return 0; } @@ -775,8 +775,9 @@ GString* get_bf_font (FT_Face face, char* file, int* err) { } g_string_append (bf, glyph->str);- g_string_free (glyph, 0); - bird_font_progress_bar_set_progress ((double)i / face->num_glyphs);+ g_string_free (glyph, 0);+ + bird_font_tool_yield (); } kerning = (GString*) bird_font_open_font_format_reader_parse_kerning (file); @@ -785,7 +786,7 @@ GString* get_bf_font (FT_Face face, char* file, int* err) { g_string_append (bf, "</font>\n"); - bird_font_progress_bar_set_progress (0);+ bird_font_tool_yield (); return bf; }@@ -802,6 +803,8 @@ GString* load_freetype_font (char* file, int* err) { FT_Glyph glyph; FT_UInt glyph_index; + bird_font_tab_bar_start_wheel ();+ error = FT_Init_FreeType (&library); if (error != OK) { g_warning ("Freetype init error %d.\n", error);@@ -833,6 +836,8 @@ GString* load_freetype_font (char* file, int* err) { FT_Done_Face ( face ); FT_Done_FreeType( library ); + bird_font_tab_bar_stop_wheel ();+ *err = OK; return bf; }@@ -260,9 +260,9 @@ public class OverView : FontDisplay { if (unlikely (!(0 <= selected < visible_items.length ()))) { warning (@"0 <= $selected < $(visible_items.length ())");- new OverViewItem (null, '\0', 0, 0);+ return new OverViewItem (null, '\0', 0, 0); } - + return visible_items.nth (selected).data; } @@ -2486,7 +2486,7 @@ public class Path { double minx, maxx, miny, maxy; if (unlikely (points.length () < 2)) {- warning ("Missing points");+ warning (@"Missing points, $(points.length ()) points in path."); return; } @@ -66,6 +66,8 @@ public class PreviewTools : ToolCollection { ExportTool.export_svg_font (); TooltipArea.show_text (t_("Three font files have been created.")); suppress_event = false;+ } else {+ warn_if_test ("Export event supressed"); } } @@ -14,43 +14,9 @@ namespace BirdFont { -/** Progress bar */+// FIXME: Delete this class class ProgressBar {- - static double current_progress = 0;- public signal void new_progress ();- static ProgressBar? singleton = null;-- public ProgressBar () {- singleton = this;- }- public static void set_progress (double d) {- ProgressBar p;- - if (singleton == null) {- return;- }- - p = (!) singleton;- current_progress = d;- p.new_progress ();- - if (is_null (MainWindow.get_tooltip ())) {- MainWindow.get_tooltip ().redraw ();- }- }-- public static double get_progress () {- ProgressBar p;- - if (singleton == null) {- return 0;- }- - p = (!) singleton;- - return ProgressBar.current_progress; } } @@ -83,8 +83,7 @@ class SvgFontFormatWriter : Object { put (@"<glyph unicode=\"$(b.str)\" horiz-adv-x=\"$(glyph.get_width ())\" d=\"$(glyph.get_svg_data ())\" />"); } }- - ProgressBar.set_progress (0);+ Tool.yield (); } @@ -114,7 +113,6 @@ class SvgFontFormatWriter : Object { warning (e.message); } - ProgressBar.set_progress (0); Tool.yield (); }); @@ -741,9 +741,9 @@ public class SvgParser { move_and_resize (bezier_points, bi, svg_glyph, units, glyph); if (format == SvgFormat.ILLUSTRATOR) {- path_list = create_paths_inkscape (bezier_points, bi);- } else { path_list = create_paths_illustrator (bezier_points, bi);+ } else {+ path_list = create_paths_inkscape (bezier_points, bi); } // TODO: Find out if it is possible to tie handles.@@ -762,7 +762,7 @@ public class SvgParser { b[i].x2 *= units; b[i].y2 *= units; - // move and resize+ // move all points if (svg_glyph) { // move only y b[i].x0 += glyph.left_limit;@@ -789,6 +789,9 @@ public class SvgParser { left_y = 0; last_type = PointType.NONE; + return_if_fail (b.length != 0);+ return_if_fail (b[0].type != 'z');+ for (int i = start_index; i < num_b; i++) { switch (b[i].type) { case 'Q':@@ -1048,6 +1051,11 @@ public class SvgParser { Path path = new Path (); for (int i = 0; i < c.length - 1; i += 2) { + if (i + 1 == c.length) {+ warning ("No y value.");+ break;+ }+ path.add (parse_double (c[i]), -parse_double (c[i + 1])); } @@ -1,5 +1,5 @@ /*- Copyright (C) 2012 Johan Mattsson+ Copyright (C) 2012, 2014 Johan Mattsson This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -26,13 +26,15 @@ public class TabBar : GLib.Object { static const int NO_TAB = -1; static const int NEXT_TAB = -2; static const int PREVIOUS_TAB = -3;+ static const int PROGRESS_WHEEL = -3; int first_tab = 0; int selected = 0; int over = NO_TAB;- int over_close = NO_TAB;+ int over_close_tab = NO_TAB; public signal void signal_tab_selected (Tab selected_tab);+ public signal void redraw (int x, int y, int w, int h); Tab? previous_tab = null; Tab? current_tab = null;@@ -46,10 +48,18 @@ public class TabBar : GLib.Object { ImageSurface? tab3_left = null; ImageSurface? tab3_right = null; - ImageSurface? bar_background = null;- ImageSurface next_tab;- ImageSurface to_previous_tab;- + ImageSurface? progress = null;++ ImageSurface? next_tab;+ ImageSurface? to_previous_tab;+ + ImageSurface? tab_bar_background = null;+ + double scale = 1; // scale images in 320 dpi+ + bool processing = false;+ double wheel_rotation = 0;+ public TabBar () { tabs = new List<Tab> (); @@ -62,60 +72,75 @@ public class TabBar : GLib.Object { tab3_left = Icons.get_icon ("tab3_left.png"); tab3_right = Icons.get_icon ("tab3_right.png"); - bar_background = Icons.get_icon ("tabbar_background.png");+ next_tab = Icons.get_icon ("next_tab.png");+ to_previous_tab = Icons.get_icon ("previous_tab.png"); - next_tab = (!) Icons.get_icon ("next_tab.png");- to_previous_tab = (!) Icons.get_icon ("previous_tab.png");- - if (is_null (next_tab)) {- warning ("Tab icon is null");- }+ progress = Icons.get_icon ("progress_wheel.png");+ tab_bar_background = Icons.get_icon ("tab_bar_background.png"); } public void motion (double x, double y) {- is_over_close (x, y, out over, out over_close);+ over_close (x, y, out over, out over_close_tab); } - private void is_over_close (double x, double y, out int over, out int over_close) {+ private void over_close (double x, double y, out int over, out int over_close_tab) { int i = 0; double offset = 19;+ double edge;+ + return_if_fail (tab3_right != null);+ + edge = ((!)tab3_right).get_width () * scale; if (x < 19 && has_scroll ()) {- over_close = NO_TAB;+ over_close_tab = NO_TAB; over = PREVIOUS_TAB; return; }++ if (has_scroll () && has_progress_wheel ()) {+ if (x > width - 19) {+ over_close_tab = NO_TAB;+ over = PROGRESS_WHEEL;+ } else if (x > width - 2 * 19) {+ over_close_tab = NO_TAB;+ over = NEXT_TAB;+ }+ } else if (!has_scroll () && has_progress_wheel ()) {+ if (x > width - 19) {+ over_close_tab = NO_TAB;+ over = PROGRESS_WHEEL;+ }+ } else if (has_scroll () && !has_progress_wheel ()) {+ if (x > width - 19) {+ over_close_tab = NO_TAB;+ over = NEXT_TAB;+ }+ } foreach (Tab t in tabs) {- if (i < first_tab) { i++; continue; }- - if (offset + t.get_width () + 3 > width && has_scroll ()) {- over_close = NO_TAB;- over = NEXT_TAB;- return;- }- - if (offset < x < offset + t.get_width ()) {++ if (offset < x < offset + t.get_width () + edge) { over = i; - if (height - 18 < y < height - 5 && x > offset + t.get_width () - 16) {- over_close = i;+ if (height - 18 < y < height - 5 && x > offset + t.get_width () - 19) {+ over_close_tab = i; } else {- over_close = NO_TAB;+ over_close_tab = NO_TAB; } return; } - offset += t.get_width () + 3;+ offset += t.get_width () + ((!)tab1_right).get_width () * scale; i++; } - over_close = NO_TAB; + over_close_tab = NO_TAB; over = NO_TAB; } @@ -127,6 +152,7 @@ public class TabBar : GLib.Object { int i = 0; if (MenuTab.suppress_event) {+ warn_if_test ("Event supressed"); return false; } @@ -143,6 +169,7 @@ public class TabBar : GLib.Object { public bool select_tab_name (string s) { if (MenuTab.suppress_event) {+ warn_if_test ("Event supressed"); return false; } @@ -151,6 +178,7 @@ public class TabBar : GLib.Object { public void select_overview () { if (MenuTab.suppress_event) {+ warn_if_test ("Event supressed"); return; } @@ -162,6 +190,7 @@ public class TabBar : GLib.Object { bool open; if (MenuTab.suppress_event) {+ warn_if_test ("Event supressed"); return; } @@ -181,6 +210,7 @@ public class TabBar : GLib.Object { int i = -1; if (MenuTab.suppress_event) {+ warn_if_test ("Event supressed"); return; } @@ -200,6 +230,7 @@ public class TabBar : GLib.Object { public void close_all_tabs () { if (MenuTab.suppress_event) {+ warn_if_test ("Event supressed"); return; } @@ -217,6 +248,7 @@ public class TabBar : GLib.Object { Tab empty_tab; if (MenuTab.suppress_event) {+ warn_if_test ("Event supressed"); return false; } @@ -264,6 +296,7 @@ public class TabBar : GLib.Object { int i = 0; if (MenuTab.suppress_event) {+ warn_if_test ("Event supressed"); return false; } @@ -280,6 +313,7 @@ public class TabBar : GLib.Object { public void close_background_tab_by_name (string name) { if (MenuTab.suppress_event) {+ warn_if_test ("Event supressed"); return; } @@ -291,6 +325,7 @@ public class TabBar : GLib.Object { int i = 0; if (MenuTab.suppress_event) {+ warn_if_test ("Event supressed"); return false; } @@ -328,6 +363,7 @@ public class TabBar : GLib.Object { int i = 0; if (MenuTab.suppress_event) {+ warn_if_test ("Event supressed"); return false; } @@ -350,7 +386,6 @@ public class TabBar : GLib.Object { } warning ("No tab selected.");- return new Tab (new EmptyTab ("Error", "Error"), 30, false); } @@ -366,6 +401,7 @@ public class TabBar : GLib.Object { Tab t; if (MenuTab.suppress_event) {+ warn_if_test ("Event supressed"); return; } @@ -413,6 +449,9 @@ public class TabBar : GLib.Object { private bool has_scroll () { int i = 0; double offset = 19;+ double end = (has_progress_wheel ()) ? width - 28 : width - 19;+ + return_if_fail (tab1_right != null); if (first_tab > 0) { return true;@@ -424,11 +463,11 @@ public class TabBar : GLib.Object { continue; } - if (offset + t.get_width () + 3 > width - 19) {+ if (offset + t.get_width () + 3 > end) { return true; } - offset += t.get_width () + 3;+ offset += t.get_width () + ((!)tab1_right).get_width () * scale; i++; } @@ -439,8 +478,8 @@ public class TabBar : GLib.Object { unowned List<Tab?>? lt; Tab t; - lt = tabs.nth(index);- return_if_fail(lt != null); + lt = tabs.nth (index);+ return_if_fail (lt != null); t = (!) ((!) lt).data; signal_tab_selected (t); @@ -449,6 +488,9 @@ public class TabBar : GLib.Object { private void scroll_to_tab (int index, bool send_signal_selected = true) { double offset = 19; int i = 0;+ double end = (has_progress_wheel ()) ? width - 28 : width - 19;+ + return_if_fail (tab1_right != null); if (index < first_tab) { first_tab = index;@@ -467,7 +509,7 @@ public class TabBar : GLib.Object { } // out of view- if (offset + t.get_width () + 3 > width - 19) {+ if (offset + t.get_width () + 3 > end) { first_tab++; scroll_to_tab (index); return;@@ -483,7 +525,7 @@ public class TabBar : GLib.Object { return; } - offset += t.get_width () + 3;+ offset += t.get_width () + ((!)tab1_right).get_width () * scale; i++; } @@ -494,16 +536,18 @@ public class TabBar : GLib.Object { int over, close; if (MenuTab.suppress_event) {+ warn_if_test ("Event supressed"); return; } this.width = width; this.height = height;+ this.scale = height / 117.0; - is_over_close (x, y, out over, out close);+ over_close (x, y, out over, out close); - if (over_close >= 0 && over == selected) {- close_tab (over_close);+ if (over_close_tab >= 0 && over == selected) {+ close_tab (over_close_tab); } else { select_tab (over); }@@ -515,6 +559,7 @@ public class TabBar : GLib.Object { int s = (tabs.length () == 0) ? 0 : selected + 1; if (MenuTab.suppress_event) {+ warn_if_test ("Event supressed"); return; } @@ -532,6 +577,7 @@ public class TabBar : GLib.Object { bool i; if (MenuTab.suppress_event) {+ warn_if_test ("Event supressed"); return false; } @@ -546,40 +592,97 @@ public class TabBar : GLib.Object { } public void draw (Context cr, int width, int height) {+ double next_tab_x;+ double w, h;+ double progress_y;+ this.width = width; this.height = height;+ this.scale = height / 117.0;+ + return_if_fail (to_previous_tab != null);+ return_if_fail (next_tab != null);+ return_if_fail (progress != null);+ return_if_fail (tab_bar_background != null); cr.save (); cr.rectangle (0, 0, width, height); cr.set_line_width (0); cr.set_source_rgba (230/255.0, 229/255.0, 228/255.0, 1); cr.fill_preserve ();- cr.stroke (); cr.restore (); - for (int j = 0; j < width; j++) {- cr.set_source_surface ((!) bar_background, j, height - ((!) bar_background).get_height ());+ cr.save ();+ cr.scale (scale, scale);+ + w = width / scale;+ h = height / scale;++ for (double i = 0; i < w; i += ((!)tab_bar_background).get_width ()) {+ cr.set_source_surface ((!) tab_bar_background, i, h - ((!) tab_bar_background).get_height ()); cr.paint (); } if (has_scroll ()) { // left arrow- cr.set_source_surface (to_previous_tab, 3, height - to_previous_tab.get_height () - 5);+ cr.set_source_surface ((!) to_previous_tab, 2 / scale, h - ((!) to_previous_tab).get_height () - 5 / scale); cr.paint (); // right arrow- cr.set_source_surface (next_tab, width - 19, height - next_tab.get_height () - 5);+ next_tab_x = (has_progress_wheel ()) ? w - (2 * 19 + 3) / scale : w - 19 / scale;+ cr.set_source_surface ((!) next_tab, next_tab_x, h - ((!) next_tab).get_height () - 5 / scale); cr.paint (); } - draw_tabs (cr);+ // progress wheel+ if (has_progress_wheel ()) {+ ImageSurface p = (!) progress;+ Surface s = new Surface.similar (p, p.get_content (), p.get_width (), p.get_height ());+ Context c = new Context (s);+ + c.save ();+ c.rectangle (0, 0, p.get_width (), p.get_height ());+ c.set_line_width (0);+ c.set_source_rgba (230/255.0, 229/255.0, 228/255.0, 1);+ c.fill_preserve (); + + c.translate (p.get_width () / 2.0, p.get_height () / 2.0);+ c.rotate (wheel_rotation);+ c.translate (-p.get_width () / 2.0, -p.get_height () / 2.0);+ + c.set_source_surface ((!) progress, 0 ,0);+ + c.translate (p.get_width () / 2.0, p.get_height () / 2.0);+ c.paint ();+ c.restore ();++ progress_y = (has_scroll ()) ? h - ((!) progress).get_height () - 5 / scale : (h - ((!) progress).get_height ()) / 2;+ cr.set_source_surface (c.get_target (), w - 19 / scale, progress_y);+ cr.paint ();+ + } + draw_tabs (cr);+ cr.restore (); } private void draw_tabs (Context cr) { double close_opacity;- double offset = 19;+ double offset = 19 / scale;+ double tab_width; int i = 0;+ double tabs_end = width / scale;+ double h = height / scale;+ double tab_height;+ double tab_y;+ + if (has_progress_wheel ()) {+ tabs_end -= 19 / scale;+ }+ + if (has_scroll ()) {+ tabs_end -= 19 / scale;+ } return_if_fail (tab3_right != null); return_if_fail (tab2_right != null);@@ -589,6 +692,10 @@ public class TabBar : GLib.Object { return_if_fail (tab2_left != null); return_if_fail (tab1_left != null); return_if_fail (tab1_right != null);+ return_if_fail (next_tab != null);+ + tab_height = ((!)tab3_right).get_height ();+ tab_y = h - tab_height; foreach (Tab t in tabs) { @@ -599,77 +706,81 @@ public class TabBar : GLib.Object { cr.save (); cr.translate (offset, 0);- - if (offset + t.get_width () + next_tab.get_width () + 3 > width) {+ + tab_width = t.get_width () / scale;+ + if (offset + tab_width + ((!)next_tab).get_width () + 3 / scale > tabs_end) {+ cr.restore (); break; } // background if (i == selected) {- for (int j = 0; j < t.get_width (); j++) {- cr.set_source_surface ((!) tab3_right, j, (height - ((!)tab1_left).get_height ()) + 1);+ for (int j = ((!)tab3_left).get_width (); j < tab_width; j++) {+ cr.set_source_surface ((!) tab3_right, j, tab_y); cr.paint (); } } else if (i == over) {- for (int j = 0; j < t.get_width (); j++) {- cr.set_source_surface ((!) tab2_right, j, (height - ((!)tab1_left).get_height ()) + 1);+ for (int j = ((!)tab2_left).get_width (); j < tab_width; j++) {+ cr.set_source_surface ((!) tab2_right, j, tab_y); cr.paint (); } } else {- for (int j = 0; j < t.get_width (); j++) {- cr.set_source_surface ((!) tab1_right, j, (height - ((!)tab1_left).get_height ()) + 1);+ for (int j = ((!)tab1_left).get_width (); j < tab_width; j++) {+ cr.set_source_surface ((!) tab1_right, j, tab_y); cr.paint (); } } // close (x) if (t.has_close_button ()) {- cr.set_line_width (1);+ cr.save ();+ cr.new_path ();+ cr.set_line_width (1 / scale); - close_opacity = (over_close == i) ? 1 : 0.2; + close_opacity = (over_close_tab == i) ? 1 : 0.2; cr.set_source_rgba (0, 0, 0, close_opacity); - cr.move_to (t.get_width () - 5, height - 14);- cr.line_to (t.get_width () - 10, height - 9);+ cr.move_to (tab_width - 5 / scale, h - 14 / scale);+ cr.line_to (tab_width - 10 / scale, h - 9 / scale); - cr.move_to (t.get_width () - 10, height - 14);- cr.line_to (t.get_width () - 5, height - 9);+ cr.move_to (tab_width - 10 / scale, h - 14 / scale);+ cr.line_to (tab_width - 5 / scale, h - 9 / scale); cr.stroke ();+ cr.restore (); } cr.set_source_rgba (0, 0, 0, 1);- cr.set_font_size (14);- cr.move_to (8, height - 6);+ cr.set_font_size (14 / scale);+ cr.move_to (8 / scale, h - 6 / scale); cr.show_text (t.get_display ().get_label ()); cr.stroke (); // edges- if (tab1_left != null && tab1_right != null && tab2_left != null && tab2_right != null && tab3_left != null && tab3_right != null) {- if (i == selected) {- cr.set_source_surface ((!) tab3_left, 0, (height - ((!)tab1_left).get_height ()) + 1);- cr.paint ();- - cr.set_source_surface ((!) tab3_right, t.get_width () - 2, (height - ((!)tab1_left).get_height ()) + 1);- cr.paint ();- } else if (i == over) {- cr.set_source_surface ((!) tab2_left, 0, (height - ((!)tab1_left).get_height ()) + 1);- cr.paint ();+ if (i == selected) {+ cr.set_source_surface ((!) tab3_left, 0, tab_y);+ cr.paint ();+ + cr.set_source_surface ((!) tab3_right, tab_width, tab_y);+ cr.paint ();+ } else if (i == over) {+ cr.set_source_surface ((!) tab2_left, 0, tab_y);+ cr.paint (); - cr.set_source_surface ((!) tab2_right, t.get_width () - 2, (height - ((!)tab1_left).get_height ()) + 1);- cr.paint ();- } else {- cr.set_source_surface ((!) tab1_left, 0, (height - ((!)tab1_left).get_height ()) + 1);- cr.paint ();+ cr.set_source_surface ((!) tab2_right, tab_width, tab_y);+ cr.paint ();+ } else {+ cr.set_source_surface ((!) tab1_left, 0, tab_y);+ cr.paint (); - cr.set_source_surface ((!) tab1_right, t.get_width () - 2, (height - ((!)tab1_left).get_height ()) + 1);- cr.paint ();- }+ cr.set_source_surface ((!) tab1_right, tab_width, tab_y);+ cr.paint (); } cr.restore (); - offset += t.get_width () + 3;+ offset += tab_width + ((!)tab1_right).get_width (); i++; } }@@ -677,6 +788,49 @@ public class TabBar : GLib.Object { public void add_empty_tab (string name, string label) { add_tab (new EmptyTab (name, label)); }+ + bool has_progress_wheel () {+ return processing;+ }++ public void set_progress (bool running) {+ TimeoutSource timer;+ + if (unlikely (processing == running)) {+ warning (@"Progress is already set to $running");+ return;+ }+ + processing = running;+ + if (processing) {+ timer = new TimeoutSource (50);+ timer.set_callback (() => {+ wheel_rotation += 0.008 * 2 * Math.PI;+ + if (wheel_rotation > 2 * Math.PI) {+ wheel_rotation -= 2 * Math.PI;+ }+ redraw (width - 19, 0, 19, height);+ return processing;+ });+ timer.attach (null);+ }+ }+ + public static void start_wheel () {+ if (!is_null (MainWindow.get_tab_bar ())) {+ MainWindow.get_tab_bar ().set_progress (true);+ Tool.yield ();+ }+ }++ public static void stop_wheel () {+ if (!is_null (MainWindow.get_tab_bar ())) {+ MainWindow.get_tab_bar ().set_progress (false);+ Tool.yield ();+ }+ } } }@@ -18,24 +18,14 @@ using Gdk; namespace BirdFont { public class TooltipArea : GLib.Object {- string tooltip;- ProgressBar progress_bar; public signal void redraw (); public TooltipArea () {- progress_bar = new ProgressBar ();- progress_bar.new_progress.connect (progress);- set_text_from_tool (); } - void progress () {- redraw ();- Tool.yield ();- }- public void update_text () { set_text_from_current_tool (); redraw ();@@ -123,15 +113,6 @@ public class TooltipArea : GLib.Object { cr.restore (); cr.save ();- w = (int) (alloc.width * ProgressBar.get_progress ());- cr.rectangle (0, 2, w, alloc.height - 2);- cr.set_line_width (0);- cr.set_source_rgba (170/255.0, 170/255.0, 170/255.0, 1);- cr.fill_preserve ();- cr.stroke ();- cr.restore ();- - cr.save (); cr.set_font_size (14); cr.move_to (5, 15); cr.show_text (tooltip);