about summary refs log tree commit diff stats
path: root/source.lua
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2022-09-17 16:33:36 -0700
committerKartik K. Agaram <vc@akkartik.com>2022-09-17 16:33:36 -0700
commit0cc8c706ffc4da107df402e3eac977aefb75f6dc (patch)
tree852a784f2bfe3a9604b8988c4c5d89d797836eff /source.lua
parent287050d598184943209b564657cb1e29ff641fd7 (diff)
downloadtext.love-0cc8c706ffc4da107df402e3eac977aefb75f6dc.tar.gz
isolate some tests from settings
Diffstat (limited to 'source.lua')
-rw-r--r--source.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/source.lua b/source.lua
index 5bcb154..c752604 100644
--- a/source.lua
+++ b/source.lua
@@ -334,7 +334,9 @@ function source.keychord_pressed(chord, key)
 --?     print('done setting window')
     -- try to restore position if possible
     -- if the window gets wider the window manager may not respect this
-    source.set_window_position_from_settings(Settings.source)
+    if not App.run_tests then
+      source.set_window_position_from_settings(Settings.source)
+    end
     return
   end
   if chord == 'C-g' then
dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
-- simple immediate-mode buttons

Button_handlers = {}

-- draw button and queue up event handlers
function button(name, params)
  love.graphics.setColor(params.color[1], params.color[2], params.color[3])
  love.graphics.rectangle('fill', params.x,params.y, params.w,params.h, 5,5)
  if params.icon then params.icon(params.x, params.y) end
  table.insert(Button_handlers, params)
end

-- process button event handlers
function propagate_to_button_handlers(x, y, mouse_button)
  for _,ev in ipairs(Button_handlers) do
    if x>ev.x and x<ev.x+ev.w and y>ev.y and y<ev.y+ev.h then
      if ev.onpress1 and mouse_button == 1 then ev.onpress1() end
    end
  end
end