@@ -206,9 +206,10 @@ def show(self):
206206 self .hide ()
207207 prompting = False
208208 # yikes lol
209- if not self .menu .caller .caller .playing : # caller.caller is the main UI thing
210- self .window .nodelay (0 )
211209 self .menu .items [options [current_option ]]["on_click" ]()
210+ self .appState .colorPickerSelected = False
211+ #if not self.menu.caller.caller.playing: # caller.caller is the main UI thing
212+ # self.window.nodelay(0)
212213 elif c in [98 , curses .KEY_LEFT ]:
213214 self .hide ()
214215 prompting = False
@@ -422,7 +423,26 @@ def hideBorder(self):
422423 curses_addstr (self .parentWindow , y + line , x , (" " ))
423424
424425 def show (self ):
425- self .showFgPicker ()
426+ #self.showFgPicker()
427+ self .updateFgPicker ()
428+ #self.updateBgPicker()
429+ #prompting = False
430+ #print('\033[?1003l') # disable mouse movement tracking (xterm api)
431+ #curses.mousemask(1)
432+ #curses_cursorOff()
433+ # populate window with colors
434+ self .panel .top ()
435+ #self.move(0,self.x - 6)
436+ self .panel .show ()
437+ #oldColor = self.colorPicker.caller.colorfg
438+ #color = self.colorPicker.caller.colorfg
439+ #if self.appState.colorPickerSelected:
440+ # prompting = True
441+ #else:
442+ # prompting = False
443+ #if self.appState.colorPickerSelected:
444+ # if self.appState.sideBarShowing:
445+ # self.drawBorder()
426446
427447 def hide (self ):
428448 self .panel .bottom ()
@@ -489,16 +509,17 @@ def updateFgPicker(self):
489509 curses_addstr (self .window , line , col + 5 , str (self .colorPicker .caller .colorfg ), color_pair )
490510
491511 def showFgPicker (self ):
512+ #self.colorPicker.caller.notify(f"showFgPicker")
492513 self .showColorPicker (type = "fg" )
493514
494515 def showColorPicker (self , type = "fg" ):
516+ #self.colorPicker.caller.notify(f"showColorPicker")
495517 """ Shows picker, has UI loop for letting user pick color with keyboard or mouse """
496518 if type == "fg" :
497519 self .updateFgPicker ()
498520 elif type == "bg" :
499521 self .updateBgPicker ()
500- prompting = True
501- self .window .nodelay (1 )
522+ prompting = False
502523 #print('\033[?1003l') # disable mouse movement tracking (xterm api)
503524 #curses.mousemask(1)
504525 curses_cursorOff ()
@@ -515,6 +536,10 @@ def showColorPicker(self, type="fg"):
515536 if self .appState .colorPickerSelected :
516537 if self .appState .sideBarShowing :
517538 self .drawBorder ()
539+ #self.window.nodelay(1)
540+
541+ #self.colorPicker.caller.notify(f"showColorPicker() hit. {prompting=}")
542+
518543 while (prompting ):
519544 time .sleep (0.01 )
520545 #self.colorPicker.caller.drawStatusBar()
@@ -574,8 +599,13 @@ def showColorPicker(self, type="fg"):
574599 if not self .appState .sideBarShowing :
575600 self .hide ()
576601 prompting = False
602+ self .appState .colorPickerSelected = False
603+ c = None
577604 self .updateFgPicker ()
578- pass
605+ #self.colorPicker.caller.notify(f"{c=}, {prompting=}")
606+ if not self .colorPicker .caller .playing : # caller.caller is the main UI thing
607+ self .window .nodelay (0 ) # wait
608+ #return color
579609 elif c == curses .KEY_MOUSE :
580610 try :
581611 _ , mouseX , mouseY , _ , mouseState = curses .getmouse ()
@@ -633,7 +663,7 @@ def showColorPicker(self, type="fg"):
633663 #self.hide()
634664 prompting = False
635665
636- if self .appState .colorPickerSelected :
666+ if not self .appState .colorPickerSelected :
637667 if self .appState .sideBarShowing :
638668 self .hideBorder ()
639669
0 commit comments