Commit abcc7d5
Don't switch tab in zoom tool
Changed files (4)
modifiedgraphics/tools_and_buttons.svgmodifiedicons/generate_html_document.pngmodifiedlibbirdfont/BackgroundTab.valamodifiedlibbirdfont/ZoomTool.vala
Diff
@@ -1523,9 +1523,9 @@ borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2"- inkscape:zoom="8.0000002"- inkscape:cx="297.89452"- inkscape:cy="128.11798"+ inkscape:zoom="4.0000001"+ inkscape:cx="324.93909"+ inkscape:cy="128.40856" inkscape:current-layer="layer1" inkscape:document-units="px" showgrid="false"@@ -5736,8 +5736,8 @@ inkscape:export-xdpi="320" inkscape:export-ydpi="320" /> <path- style="fill:none;stroke:#e6e6e6;stroke-width:1.10593903px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"- d="m 373.79808,624.02072 3.85251,0"+ style="fill-opacity:1;stroke:#656a73;stroke-width:0.80000000000000004;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:0.55251139;stroke-miterlimit:4;stroke-dasharray:none"+ d="m 373.71479,624.02072 3.92534,0" id="path4233-7" inkscape:connector-curvature="0" inkscape:export-filename="/home/johan/birdfont/icons/generate_html_document.png"@@ -5757,8 +5757,8 @@ inkscape:connector-curvature="0" /> </g> <path- style="fill:none;stroke:#e6e6e6;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"- d="m 377.15393,623.71351 0.0134,-3.554"+ style="fill-opacity:1;stroke:#656a73;stroke-width:0.80000000000000004;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:0.55251139;stroke-miterlimit:4;stroke-dasharray:none"+ d="m 377.15415,623.71329 0.013,-3.67856" id="path4238-0" inkscape:connector-curvature="0" sodipodi:nodetypes="cc"Binary files a/icons/generate_html_document.png and b/icons/generate_html_document.png differ@@ -25,6 +25,10 @@ public class BackgroundTab : Glyph { base ("", '\0'); singleton = this; add_help_lines ();+ + Toolbox tools = MainWindow.get_toolbox ();+ ZoomTool z = (ZoomTool) tools.get_tool ("zoom_tool");+ z.store_current_view (); } public static BackgroundTab get_instance () {@@ -20,12 +20,12 @@ public class ZoomTool : Tool { int zoom_area_begin_y = -1; int view_index = 0;- List<Tab> views;+ Gee.ArrayList<Tab> views; public ZoomTool (string n) { base (n, "Zoom", 'z'); - views = new List<Tab> ();+ views = new Gee.ArrayList<Tab> (); select_action.connect((self) => { });@@ -97,27 +97,26 @@ public class ZoomTool : Tool { /** Add an item to zoom view list. */ public void store_current_view () { - if (views.length () - 1 > view_index) {- unowned List<Tab> i = views.nth (view_index + 1);- while (i != i.last ()) {- i.delete_link (i.next);+ if (views.size - 1 > view_index) {+ int i = view_index + 1;+ while (i != views.size - 1) {+ views.remove_at (i); } } - views.append (MainWindow.get_current_tab ());- view_index = (int)views.length () - 1;+ views.add (MainWindow.get_current_tab ());+ view_index = (int) views.size - 1; MainWindow.get_current_display ().store_current_view (); } /** Redo last zoom.*/ public void next_view () {- if (view_index + 1 >= (int) views.length ()) {+ if (view_index + 1 >= (int) views.size) { return; } view_index++; - MainWindow.select_tab (views.nth (view_index).data); MainWindow.get_current_display ().next_view (); GlyphCanvas.redraw (); }@@ -130,7 +129,6 @@ public class ZoomTool : Tool { view_index--; - MainWindow.select_tab (views.nth (view_index).data); MainWindow.get_current_display ().restore_last_view (); GlyphCanvas.redraw (); }