Skip to content

Commit 76797d3

Browse files
committed
Fix focus, spacing, and colors on desktop apps
1 parent 22f6876 commit 76797d3

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

seleniumbase/console_scripts/sb_commander.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def set_colors(use_colors):
4646
c0 = colorama.Fore.BLUE + colorama.Back.LIGHTCYAN_EX
4747
c1 = colorama.Fore.BLUE + colorama.Back.LIGHTGREEN_EX
4848
c2 = colorama.Fore.RED + colorama.Back.LIGHTYELLOW_EX
49-
c3 = colorama.Fore.LIGHTGREEN_EX + colorama.Back.BLACK
49+
c3 = colorama.Fore.BLACK + colorama.Back.LIGHTGREEN_EX
5050
c4 = colorama.Fore.BLUE + colorama.Back.LIGHTYELLOW_EX
5151
c5 = colorama.Fore.RED + colorama.Back.LIGHTYELLOW_EX
5252
cr = colorama.Style.RESET_ALL
@@ -255,7 +255,7 @@ def create_tkinter_gui(tests, command_string):
255255
count = 0
256256
ara = {}
257257
for row in tests:
258-
row += " " * 400
258+
row += " " * 200
259259
ara[count] = tk.IntVar()
260260
cb = tk.Checkbutton(
261261
text_area,
@@ -327,6 +327,14 @@ def create_tkinter_gui(tests, command_string):
327327

328328
# Bring form window to front
329329
send_window_to_front(root)
330+
# Use decoy to set correct focus on main window
331+
decoy = tk.Tk()
332+
decoy.geometry("1x1")
333+
decoy.iconify()
334+
decoy.update()
335+
decoy.deiconify()
336+
decoy.destroy()
337+
# Start tkinter
330338
root.mainloop()
331339

332340

seleniumbase/console_scripts/sb_recorder.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,14 @@ def create_tkinter_gui():
192192

193193
# Bring form window to front
194194
send_window_to_front(window)
195+
# Use decoy to set correct focus on main window
196+
decoy = tk.Tk()
197+
decoy.geometry("1x1")
198+
decoy.iconify()
199+
decoy.update()
200+
decoy.deiconify()
201+
decoy.destroy()
202+
# Start tkinter
195203
window.mainloop()
196204

197205

0 commit comments

Comments
 (0)