added convenience actions isabelle.increase-font-size and isabelle.decrease-font-size;
authorwenzelm
Sun Nov 25 17:15:21 2012 +0100 (2012-11-25)
changeset 501980c7b351a6871
parent 50197 b385d134926d
child 50199 6d04e2422769
added convenience actions isabelle.increase-font-size and isabelle.decrease-font-size;
NEWS
src/Tools/jEdit/src/Isabelle.props
src/Tools/jEdit/src/actions.xml
src/Tools/jEdit/src/isabelle_actions.scala
     1.1 --- a/NEWS	Sun Nov 25 15:17:01 2012 +0100
     1.2 +++ b/NEWS	Sun Nov 25 17:15:21 2012 +0100
     1.3 @@ -82,7 +82,11 @@
     1.4  
     1.5  * Improved editing support for control styles: subscript, superscript,
     1.6  bold, reset of style -- operating on single symbols or text
     1.7 -selections.  Cf. keyboard short-cuts C+e DOWN/UP/RIGHT/LEFT.
     1.8 +selections.  Cf. keyboard shortcuts C+e DOWN/UP/RIGHT/LEFT.
     1.9 +
    1.10 +* Actions isabelle.increase-font-size and isabelle.decrease-font-size
    1.11 +adjust the main text area font size, and its derivatives for output,
    1.12 +tooltips etc.  Cf. keyboard shortcuts C-PLUS and C-MINUS.
    1.13  
    1.14  * Uniform Java 7 platform on Linux, Mac OS X, Windows: recent updates
    1.15  from Oracle provide better multi-platform experience.  This version is
     2.1 --- a/src/Tools/jEdit/src/Isabelle.props	Sun Nov 25 15:17:01 2012 +0100
     2.2 +++ b/src/Tools/jEdit/src/Isabelle.props	Sun Nov 25 17:15:21 2012 +0100
     2.3 @@ -27,6 +27,10 @@
     2.4  options.isabelle-rendering.code=new isabelle.jedit.Isabelle_Options2();
     2.5  
     2.6  #actions
     2.7 +isabelle.increase-font-size.label=Increase font size
     2.8 +isabelle.increase-font-size.shortcut=C+PLUS
     2.9 +isabelle.decrease-font-size.label=Decrease font size
    2.10 +isabelle.decrease-font-size.shortcut=C+MINUS
    2.11  isabelle.check-buffer.label=Commence full proof checking of current buffer
    2.12  isabelle.check-buffer.shortcut=C+e SPACE
    2.13  isabelle.cancel-execution.label=Cancel current proof checking process
     3.1 --- a/src/Tools/jEdit/src/actions.xml	Sun Nov 25 15:17:01 2012 +0100
     3.2 +++ b/src/Tools/jEdit/src/actions.xml	Sun Nov 25 17:15:21 2012 +0100
     3.3 @@ -42,6 +42,16 @@
     3.4  			wm.addDockableWindow("isabelle-symbols");
     3.5  		</CODE>
     3.6  	</ACTION>
     3.7 +	<ACTION NAME="isabelle.increase-font-size">
     3.8 +	  <CODE>
     3.9 +	    isabelle.jedit.Isabelle_Actions.increase_font_size(view);
    3.10 +	  </CODE>
    3.11 +	</ACTION>
    3.12 +	<ACTION NAME="isabelle.decrease-font-size">
    3.13 +	  <CODE>
    3.14 +	    isabelle.jedit.Isabelle_Actions.decrease_font_size(view);
    3.15 +	  </CODE>
    3.16 +	</ACTION>
    3.17  	<ACTION NAME="isabelle.check-buffer">
    3.18  	  <CODE>
    3.19  	    isabelle.jedit.Isabelle_Actions.check_buffer(buffer);
     4.1 --- a/src/Tools/jEdit/src/isabelle_actions.scala	Sun Nov 25 15:17:01 2012 +0100
     4.2 +++ b/src/Tools/jEdit/src/isabelle_actions.scala	Sun Nov 25 17:15:21 2012 +0100
     4.3 @@ -9,12 +9,28 @@
     4.4  
     4.5  import isabelle._
     4.6  
     4.7 -import org.gjt.sp.jedit.Buffer
     4.8 +import org.gjt.sp.jedit.{jEdit, View, Buffer}
     4.9  import org.gjt.sp.jedit.textarea.JEditTextArea
    4.10  
    4.11  
    4.12  object Isabelle_Actions
    4.13  {
    4.14 +  /* font size */
    4.15 +
    4.16 +  def change_font_size(view: View, change: Int => Int)
    4.17 +  {
    4.18 +    val FONT_SIZE = "view.fontsize"
    4.19 +    val size = change(jEdit.getIntegerProperty(FONT_SIZE, 12)) max 5
    4.20 +    jEdit.setIntegerProperty(FONT_SIZE, size)
    4.21 +    jEdit.propertiesChanged()
    4.22 +    jEdit.saveSettings()
    4.23 +    view.getStatus.setMessageAndClear("Text font size: " + size)
    4.24 +  }
    4.25 +
    4.26 +  def increase_font_size(view: View): Unit = change_font_size(view, i => i + ((i / 10) max 1))
    4.27 +  def decrease_font_size(view: View): Unit = change_font_size(view, i => i - ((i / 10) max 1))
    4.28 +
    4.29 +
    4.30    /* full checking */
    4.31  
    4.32    def check_buffer(buffer: Buffer)