src/Tools/jEdit/src/simplifier_trace_window.scala
changeset 57044 042d6e58cb40
parent 57043 0f44d6dbd2a4
child 57612 990ffb84489b
equal deleted inserted replaced
57043:0f44d6dbd2a4 57044:042d6e58cb40
   136 class Simplifier_Trace_Window(
   136 class Simplifier_Trace_Window(
   137   view: View, snapshot: Document.Snapshot, trace: Simplifier_Trace.Trace) extends Frame
   137   view: View, snapshot: Document.Snapshot, trace: Simplifier_Trace.Trace) extends Frame
   138 {
   138 {
   139   Swing_Thread.require {}
   139   Swing_Thread.require {}
   140 
   140 
   141   private var zoom_factor = 100
   141   private val pretty_text_area = new Pretty_Text_Area(view)
   142 
   142   private val zoom = new Font_Info.Zoom_Box { def changed = do_paint() }
   143   val pretty_text_area = new Pretty_Text_Area(view)
       
   144 
   143 
   145   size = new Dimension(500, 500)
   144   size = new Dimension(500, 500)
   146   contents = new BorderPanel {
   145   contents = new BorderPanel {
   147     layout(Component.wrap(pretty_text_area)) = BorderPanel.Position.Center
   146     layout(Component.wrap(pretty_text_area)) = BorderPanel.Position.Center
   148   }
   147   }
   168 
   167 
   169   def do_paint()
   168   def do_paint()
   170   {
   169   {
   171     Swing_Thread.later {
   170     Swing_Thread.later {
   172       pretty_text_area.resize(
   171       pretty_text_area.resize(
   173         Font_Info.main(PIDE.options.real("jedit_font_scale") * zoom_factor / 100))
   172         Font_Info.main(PIDE.options.real("jedit_font_scale") * zoom.factor / 100))
   174     }
   173     }
   175   }
   174   }
   176 
   175 
   177   def handle_resize()
   176   def handle_resize()
   178   {
   177   {
   191   })
   190   })
   192 
   191 
   193 
   192 
   194   /* controls */
   193   /* controls */
   195 
   194 
   196   private val zoom = new GUI.Zoom_Box(factor => { zoom_factor = factor; handle_resize() })
       
   197   zoom.tooltip = "Zoom factor for basic font size"
       
   198 
       
   199   private val controls = new Wrap_Panel(Wrap_Panel.Alignment.Right)(
   195   private val controls = new Wrap_Panel(Wrap_Panel.Alignment.Right)(
   200     pretty_text_area.search_label,
   196     pretty_text_area.search_label,
   201     pretty_text_area.search_field,
   197     pretty_text_area.search_field,
   202     zoom)
   198     zoom)
   203 
   199