The Birdfont Source Code


All Repositories / birdfont.git / commit – RSS feed

Move progrss wheel to icon font

These changes was commited to the Birdfont repository Tue, 17 Mar 2015 20:57:53 +0000.

Contributing

Send patches or pull requests to johan.mattsson.m@gmail.com.
Clone this repository: git clone https://github.com/johanmattssonm/birdfont.git
author Johan Mattsson <johan.mattsson.m@gmail.com>
Tue, 17 Mar 2015 20:57:53 +0000 (21:57 +0100)
committer Johan Mattsson <johan.mattsson.m@gmail.com>
Tue, 17 Mar 2015 20:58:13 +0000 (21:58 +0100)
commit bce508b654501fba16044268130603684f12b1f9
tree 395f671326372a6a02190b5621fd9a0e7f5433c0
parent b4abe6d726ed289bef9c72ef4308d8301629cbc8
Move progrss wheel to icon font

libbirdfont/Renderer/Text.vala
libbirdfont/TabBar.vala
resources/icons.bf
--- a/libbirdfont/Renderer/Text.vala +++ b/libbirdfont/Renderer/Text.vala @@ -153,14 +153,8 @@ GlyphSequence word; Glyph? g; KerningClasses kc; - - // FIXME: Create a thread safe implementation of the bf text rendering - // The problem is (probably) in the spacing and kerning code. - if (MenuTab.suppress_event) { - return; - } - glyph = new Glyph ("", '\0'); + glyph = new Glyph.no_lines ("", '\0'); w = 0; prev = null;
--- a/libbirdfont/TabBar.vala +++ b/libbirdfont/TabBar.vala @@ -68,14 +68,11 @@ right_arrow = new Text ("right_arrow"); right_arrow.load_font (Theme.get_icon_file ()); + + start_wheel (); } - public void redraw (int x, int y, int w, int h) { - if (MenuTab.suppress_event) { - warn_if_test ("Redraw tab bar: event suppressed"); - return; - } - + public void redraw (int x, int y, int w, int h) { redraw_tab_bar (x, y, w, h); } @@ -655,35 +652,24 @@ // progress wheel if (has_progress_wheel ()) { - - // FIXME: make text rendering thread safe and update position double progress_size = 40 / scale; Surface s = new Surface.similar (cr.get_target (), Cairo.Content.COLOR_ALPHA, (int) progress_size, (int) progress_size); Context c = new Context (s); - if (MainWindow.get_menu ().show_menu) { - Theme.text_color (menu_icon, "Foreground Inverted"); - } else { - Theme.text_color (menu_icon, "Foreground 2"); - } + Theme.text_color (progress_icon, "Foreground 2"); progress_icon.set_font_size (progress_size); - progress_icon.widget_x = 0; - progress_icon.widget_y = 0; + progress_icon.widget_x = w - 20 / scale; + progress_icon.widget_y = h / 2.0; + progress_icon.use_cache (false); - c.translate (progress_size / 2.0, progress_size / 2.0); - c.rotate (wheel_rotation); - c.translate (-progress_size / 2.0, -progress_size / 2.0); + cr.save (); + cr.translate (progress_icon.widget_x, progress_icon.widget_y); + cr.rotate (wheel_rotation); + cr.translate (-progress_icon.widget_x, -progress_icon.widget_y); - progress_icon.draw (c); - - c.translate (progress_size / 2.0, progress_size / 2.0); - c.paint (); - c.restore (); - - progress_y = (has_scroll ()) ? h - progress_size - 5 / scale : (h - progress_size) / 2; - cr.set_source_surface (c.get_target (), w - 19 / scale, progress_y); - cr.paint (); + progress_icon.draw (cr); + cr.restore (); } else { // menu icon if (MainWindow.get_menu ().show_menu) { @@ -718,7 +704,7 @@ double tab_height; Tab t; Text label; - + if (has_progress_wheel ()) { tabs_end -= 19 / scale; }
--- a/resources/icons.bf +++ b/resources/icons.bf @@ -455,8 +455,8 @@ <collection name="left_arrow"> <selected id="1"/> <glyph id="1" left="-28" right="25.184466019417457"> - <path stroke="0" skew="0" data="S 16.3457544910,11.1720448618 D 12.9964458443,7.8227362151 3.5780616609,3.9215137507 -1.1585760518,3.9215137507 T D -5.8952137645,3.9215137507 -15.3135979479,7.8227362151 -18.6629065945,11.1720448618 T D -22.0122152412,14.5213535084 -25.9134377056,23.9397376918 -25.9134377056,28.6763754045 T D -25.9134377056,33.4130131172 -22.0122152412,42.8313973006 -18.6629065945,46.1807059473 T D -15.3135979479,49.5300145940 -5.8952137645,53.4312370584 -1.1585760518,53.4312370584 T D 3.5780616609,53.4312370584 12.9964458443,49.5300145940 16.3457544910,46.1807059473 T D 19.6950631377,42.8313973006 23.5962856021,33.4130131172 23.5962856021,28.6763754045 T D 23.5962856021,23.9397376918 19.6950631377,14.5213535084 16.3457544910,11.1720448618 T" /> - <path stroke="0" skew="0" data="S 19.0193836125,28.5566343042 D 19.0193836125,32.3716968002 15.8771953315,39.9576103638 13.1795387700,42.6552669253 T D 10.4818822084,45.3529234869 2.8959686448,48.4951117679 -0.9190938511,48.4951117679 T D -4.7341563471,48.4951117679 -12.3200699107,45.3529234869 -15.0177264722,42.6552669253 T D -17.7153830338,39.9576103638 -20.8575713148,32.3716968002 -20.8575713148,28.5566343042 T D -20.8575713148,24.7415718082 -17.7153830338,17.1556582447 -15.0177264722,14.4580016831 T D -12.3200699107,11.7603451216 -4.7341563471,8.6181568405 -0.9190938511,8.6181568405 T D 2.8959686448,8.6181568405 10.4818822084,11.7603451216 13.1795387700,14.4580016831 T D 15.8771953315,17.1556582447 19.0193836125,24.7415718082 19.0193836125,28.5566343042 T" /> + <path stroke="0" skew="0" data="S 16.3457544910,11.1720448618 D 12.9964458443,7.8227362151 3.5780616609,3.9215137507 -1.1585760518,3.9215137507 T D -5.8952137645,3.9215137507 -15.3135979478,7.8227362152 -18.6629065945,11.1720448618 T D -22.0122152412,14.5213535084 -25.9134377056,23.9397376918 -25.9134377056,28.6763754045 T D -25.9134377056,33.4130131172 -22.0122152411,42.8313973006 -18.6629065945,46.1807059473 T D -15.3135979479,49.5300145940 -5.8952137645,53.4312370584 -1.1585760518,53.4312370584 T D 3.5780616609,53.4312370584 12.9964458443,49.5300145940 16.3457544910,46.1807059473 T D 19.6950631377,42.8313973006 23.5962856021,33.4130131172 23.5962856021,28.6763754045 T D 23.5962856021,23.9397376918 19.6950631377,14.5213535084 16.3457544910,11.1720448618 T" /> + <path stroke="0" skew="0" data="S 19.0193836125,28.5566343042 D 19.0193836125,32.3716968002 15.8771953315,39.9576103638 13.1795387700,42.6552669253 T D 10.4818822084,45.3529234869 2.8959686448,48.4951117679 -0.9190938511,48.4951117679 T D -4.7341563471,48.4951117679 -12.3200699106,45.3529234868 -15.0177264722,42.6552669253 T D -17.7153830338,39.9576103638 -20.8575713148,32.3716968002 -20.8575713148,28.5566343042 T D -20.8575713148,24.7415718082 -17.7153830338,17.1556582447 -15.0177264722,14.4580016831 T D -12.3200699107,11.7603451216 -4.7341563471,8.6181568405 -0.9190938511,8.6181568405 T D 2.8959686448,8.6181568405 10.4818822085,11.7603451215 13.1795387700,14.4580016831 T D 15.8771953315,17.1556582447 19.0193836125,24.7415718082 19.0193836125,28.5566343042 T" /> <path stroke="0" skew="0" data="B 3.6031455894,42.2522867907 M -11.4649549106,27.1840862907 M 3.8796255894,14.8808862907 M 3.6031455894,42.2522867907" /> </glyph> </collection> @@ -597,8 +597,8 @@ </collection> <collection name="progress"> <selected id="1"/> - <glyph id="1" left="-28" right="28"> - <path stroke="0" skew="0" data="S 15.2459546926,42.3268608414 D 12.7256932529,44.8471222811 5.6386215657,47.7826834915 2.0744336570,47.7826834915 T D -1.4897542518,47.7826834915 -8.5768259390,44.8471222811 -11.0970873786,42.3268608414 T D -13.6173488183,39.8065994017 -16.5529100287,32.7195277146 -16.5529100287,29.1553398058 T D -16.5529100287,25.5911518971 -13.6173488183,18.5040802099 -11.0970873786,15.9838187702 T D -8.5768259390,13.4635573305 -1.4897542518,10.5279961202 2.0744336570,10.5279961202 T D 5.6386215657,10.5279961202 12.7256932529,13.4635573305 15.2459546926,15.9838187702 L 19.7155857659,11.2747054963 D 16.2484515754,7.8075713058 6.4987374504,3.7691074859 1.5954692557,3.7691074859 D -3.3077989391,3.7691074859 -13.0575130641,7.8075713058 -16.5246472546,11.2747054963 T D -19.9917814450,14.7418396868 -24.0302452649,24.4915538117 -24.0302452649,29.3948220065 T D -24.0302452649,34.2980902012 -19.9917814450,44.0478043262 -16.5246472546,47.5149385167 T D -13.0575130641,50.9820727072 -3.3077989391,55.0205365270 1.5954692557,55.0205365270 T D 6.4987374504,55.0205365270 16.0036116558,51.6997601095 19.7155857659,47.5149385167 L 15.2459546926,42.3268608414" /> + <glyph id="1" left="-28" right="-4.190043063380541"> + <path stroke="0" skew="0" data="S -13.5940894663,96.4649933504 D -16.1143509060,98.9852547901 -23.2014225932,101.9208160005 -26.7656105019,101.9208160005 T D -30.3297984107,101.9208160005 -37.4168700978,98.9852547901 -39.9371315375,96.4649933504 T D -42.4573929772,93.9447319107 -45.3929541876,86.8576602236 -45.3929541876,83.2934723148 T D -45.3929541876,79.7292844061 -42.4573929772,72.6422127190 -39.9371315375,70.1219512792 T D -37.4168700979,67.6016898395 -30.3297984107,64.6661286292 -26.7656105019,64.6661286292 T D -23.2014225932,64.6661286292 -16.1143509060,67.6016898395 -13.5940894663,70.1219512792 L -9.1244583930,65.4128380053 D -12.5915925835,61.9457038148 -22.3413067085,57.9072399949 -27.2445749032,57.9072399949 D -32.1478430980,57.9072399949 -41.8975572231,61.9457038148 -45.3646914135,65.4128380053 T D -48.8318256039,68.8799721958 -52.8702894238,78.6296863207 -52.8702894238,83.5329545155 T D -52.8702894238,88.4362227102 -48.8318256039,98.1859368353 -45.3646914135,101.6530710257 T D -41.8975572230,105.1202052162 -32.1478430980,109.1586690360 -27.2445749032,109.1586690360 T D -22.3413067085,109.1586690360 -12.8364325031,105.8378926185 -9.1244583930,101.6530710257 L -13.5940894663,96.4649933504" /> </glyph> </collection> <collection unicode="U+71"> @@ -944,79 +944,79 @@ <ligature sequence="i n s e r t _ g l y p h _ f r o m _ o v e r v i e w" replacement="insert_glyph_from_overview"/> <ligature sequence="h i g h _ c o n t r a s t _ b a c k g r o u n d" replacement="high_contrast_background"/> - <ligature sequence="g e n e r a t e _ h t m l _ d o c u m e n t" replacement="generate_html_document"/> <ligature sequence="s h o w _ x h e i g h t _ h e l p l i n e s" replacement="show_xheight_helplines"/> - <ligature sequence="z o o m _ b a c k g r o u n d _ i m a g e" replacement="zoom_background_image"/> - <ligature sequence="a u t o _ t r a c e _ r e s o l u t i o n" replacement="auto_trace_resolution"/> - <ligature sequence="b a c k g r o u n d _ h e l p _ l i n e s" replacement="background_help_lines"/> + <ligature sequence="g e n e r a t e _ h t m l _ d o c u m e n t" replacement="generate_html_document"/> <ligature sequence="s h o w _ a l l _ l i n e _ h a n d l e s" replacement="show_all_line_handles"/> + <ligature sequence="b a c k g r o u n d _ h e l p _ l i n e s" replacement="background_help_lines"/> + <ligature sequence="a u t o _ t r a c e _ r e s o l u t i o n" replacement="auto_trace_resolution"/> + <ligature sequence="z o o m _ b a c k g r o u n d _ i m a g e" replacement="zoom_background_image"/> <ligature sequence="a u t o _ t r a c e _ s i m p l i f y" replacement="auto_trace_simplify"/> - <ligature sequence="c o n t r a s t _ t h r e s h o l d" replacement="contrast_threshold"/> <ligature sequence="k e r n i n g _ t e x t _ i n p u t" replacement="kerning_text_input"/> - <ligature sequence="s e l e c t _ b a c k g r o u n d" replacement="select_background"/> - <ligature sequence="i n s e r t _ b a c k g r o u n d" replacement="insert_background"/> - <ligature sequence="n e w _ p o i n t _ o n _ p a t h" replacement="new_point_on_path"/> + <ligature sequence="c o n t r a s t _ t h r e s h o l d" replacement="contrast_threshold"/> <ligature sequence="d e l e t e _ b a c k g r o u n d" replacement="delete_background"/> - <ligature sequence="q u a d r a t i c _ p o i n t s" replacement="quadratic_points"/> + <ligature sequence="n e w _ p o i n t _ o n _ p a t h" replacement="new_point_on_path"/> + <ligature sequence="i n s e r t _ b a c k g r o u n d" replacement="insert_background"/> + <ligature sequence="s e l e c t _ b a c k g r o u n d" replacement="select_background"/> <ligature sequence="s c a l e _ b a c k g r o u n d" replacement="scale_background"/> + <ligature sequence="q u a d r a t i c _ p o i n t s" replacement="quadratic_points"/> + <ligature sequence="m o v e _ b a c k g r o u n d" replacement="move_background"/> + <ligature sequence="f l i p _ h o r i z o n t a l" replacement="flip_horizontal"/> + <ligature sequence="s h o w _ b a c k g r o u n d" replacement="show_background"/> <ligature sequence="z o o m _ b o u n d a r i e s" replacement="zoom_boundaries"/> - <ligature sequence="s h o w _ b a c k g r o u n d" replacement="show_background"/> - <ligature sequence="f l i p _ h o r i z o n t a l" replacement="flip_horizontal"/> - <ligature sequence="m o v e _ b a c k g r o u n d" replacement="move_background"/> + <ligature sequence="i n s e r t _ u n i c h a r" replacement="insert_unichar"/> + <ligature sequence="c u t _ b a c k g r o u n d" replacement="cut_background"/> + <ligature sequence="u p d a t e _ w e b v i e w" replacement="update_webview"/> <ligature sequence="f i l l _ o p e n _ p a t h" replacement="fill_open_path"/> - <ligature sequence="u p d a t e _ w e b v i e w" replacement="update_webview"/> - <ligature sequence="c u t _ b a c k g r o u n d" replacement="cut_background"/> - <ligature sequence="i n s e r t _ u n i c h a r" replacement="insert_unichar"/> + <ligature sequence="d r o p d o w n _ m e n u" replacement="dropdown_menu"/> + <ligature sequence="f l i p _ v e r t i c a l" replacement="flip_vertical"/> + <ligature sequence="d e l e t e _ b u t t o n" replacement="delete_button"/> + <ligature sequence="c o n v e r t _ p o i n t" replacement="convert_point"/> + <ligature sequence="d o u b l e _ p o i n t s" replacement="double_points"/> + <ligature sequence="k e r n i n g _ c l a s s" replacement="kerning_class"/> <ligature sequence="a d d _ n e w _ t h e m e" replacement="add_new_theme"/> - <ligature sequence="k e r n i n g _ c l a s s" replacement="kerning_class"/> - <ligature sequence="d o u b l e _ p o i n t s" replacement="double_points"/> - <ligature sequence="c o n v e r t _ p o i n t" replacement="convert_point"/> - <ligature sequence="d e l e t e _ b u t t o n" replacement="delete_button"/> - <ligature sequence="f l i p _ v e r t i c a l" replacement="flip_vertical"/> - <ligature sequence="d r o p d o w n _ m e n u" replacement="dropdown_menu"/> + <ligature sequence="y _ c o o r d i n a t e" replacement="y_coordinate"/> + <ligature sequence="x _ c o o r d i n a t e" replacement="x_coordinate"/> + <ligature sequence="c u b i c _ p o i n t s" replacement="cubic_points"/> + <ligature sequence="r e v e r s e _ p a t h" replacement="reverse_path"/> <ligature sequence="e x p o r t _ f o n t s" replacement="export_fonts"/> - <ligature sequence="r e v e r s e _ p a t h" replacement="reverse_path"/> - <ligature sequence="c u b i c _ p o i n t s" replacement="cubic_points"/> - <ligature sequence="x _ c o o r d i n a t e" replacement="x_coordinate"/> - <ligature sequence="y _ c o o r d i n a t e" replacement="y_coordinate"/> + <ligature sequence="r i g h t _ a r r o w" replacement="right_arrow"/> + <ligature sequence="b e z i e r _ l i n e" replacement="bezier_line"/> + <ligature sequence="c r e a t e _ l i n e" replacement="create_line"/> + <ligature sequence="s p i n _ b u t t o n" replacement="spin_button"/> <ligature sequence="m o v e _ c a n v a s" replacement="move_canvas"/> - <ligature sequence="s p i n _ b u t t o n" replacement="spin_button"/> - <ligature sequence="c r e a t e _ l i n e" replacement="create_line"/> - <ligature sequence="b e z i e r _ l i n e" replacement="bezier_line"/> - <ligature sequence="r i g h t _ a r r o w" replacement="right_arrow"/> + <ligature sequence="l e f t _ a r r o w" replacement="left_arrow"/> + <ligature sequence="h e l p _ l i n e s" replacement="help_lines"/> + <ligature sequence="m o v e _ l a y e r" replacement="move_layer"/> + <ligature sequence="s e l e c t _ a l l" replacement="select_all"/> + <ligature sequence="p o i n t _ t o o l" replacement="point_tool"/> <ligature sequence="f u l l _ g l y p h" replacement="full_glyph"/> - <ligature sequence="p o i n t _ t o o l" replacement="point_tool"/> - <ligature sequence="s e l e c t _ a l l" replacement="select_all"/> - <ligature sequence="m o v e _ l a y e r" replacement="move_layer"/> - <ligature sequence="h e l p _ l i n e s" replacement="help_lines"/> - <ligature sequence="l e f t _ a r r o w" replacement="left_arrow"/> + <ligature sequence="i n f o _ i c o n" replacement="info_icon"/> + <ligature sequence="s h o w _ g r i d" replacement="show_grid"/> + <ligature sequence="a u t o t r a c e" replacement="autotrace"/> + <ligature sequence="u n d o _ t o o l" replacement="undo_tool"/> + <ligature sequence="t i e _ p o i n t" replacement="tie_point"/> + <ligature sequence="s y m m e t r i c" replacement="symmetric"/> + <ligature sequence="f o r e s i g h t" replacement="foresight"/> + <ligature sequence="z o o m _ t o o l" replacement="zoom_tool"/> + <ligature sequence="r e c t a n g l e" replacement="rectangle"/> + <ligature sequence="t t f _ u n i t s" replacement="ttf_units"/> <ligature sequence="m e n u _ i c o n" replacement="menu_icon"/> - <ligature sequence="t t f _ u n i t s" replacement="ttf_units"/> - <ligature sequence="r e c t a n g l e" replacement="rectangle"/> - <ligature sequence="z o o m _ t o o l" replacement="zoom_tool"/> - <ligature sequence="f o r e s i g h t" replacement="foresight"/> - <ligature sequence="s y m m e t r i c" replacement="symmetric"/> - <ligature sequence="t i e _ p o i n t" replacement="tie_point"/> - <ligature sequence="u n d o _ t o o l" replacement="undo_tool"/> - <ligature sequence="a u t o t r a c e" replacement="autotrace"/> - <ligature sequence="s h o w _ g r i d" replacement="show_grid"/> - <ligature sequence="i n f o _ i c o n" replacement="info_icon"/> + <ligature sequence="z o o m _ o u t" replacement="zoom_out"/> + <ligature sequence="r o t a t i o n" replacement="rotation"/> + <ligature sequence="p e n _ t o o l" replacement="pen_tool"/> + <ligature sequence="z o o m _ 1 _ 1" replacement="zoom_1_1"/> <ligature sequence="p r o g r e s s" replacement="progress"/> - <ligature sequence="z o o m _ 1 _ 1" replacement="zoom_1_1"/> - <ligature sequence="p e n _ t o o l" replacement="pen_tool"/> - <ligature sequence="r o t a t i o n" replacement="rotation"/> - <ligature sequence="z o o m _ o u t" replacement="zoom_out"/> <ligature sequence="z o o m _ i n" replacement="zoom_in"/> + <ligature sequence="h e i g h t" replacement="height"/> + <ligature sequence="r e s i z e" replacement="resize"/> <ligature sequence="c i r c l e" replacement="circle"/> - <ligature sequence="r e s i z e" replacement="resize"/> - <ligature sequence="h e i g h t" replacement="height"/> + <ligature sequence="t h e m e" replacement="theme"/> + <ligature sequence="w i d t h" replacement="width"/> <ligature sequence="t r a c k" replacement="track"/> - <ligature sequence="w i d t h" replacement="width"/> - <ligature sequence="t h e m e" replacement="theme"/> + <ligature sequence="s k e w" replacement="skew"/> + <ligature sequence="m o v e" replacement="move"/> + <ligature sequence="p r e v" replacement="prev"/> <ligature sequence="n e x t" replacement="next"/> - <ligature sequence="p r e v" replacement="prev"/> - <ligature sequence="m o v e" replacement="move"/> - <ligature sequence="s k e w" replacement="skew"/> </font>