@@ -39,6 +39,9 @@ def update(self):
3939 self .input_unchecked = "#404040"
4040 self .input_hover = "#808080"
4141 self .input_press = "#afafaf"
42+ self .scrollbar_arrow = "#606060"
43+ self .scrollbar_arrow_disabled = "#bfbfbf"
44+ self .scrollbar_thumb = "#cdcdcd"
4245 self .accent = winaccent .accent_dark
4346 self .accent_hover = winaccent ._utils .blend_colors (self .accent , self .bg , 90 )
4447 self .accent_press = winaccent ._utils .blend_colors (self .accent , self .bg , 80 )
@@ -76,6 +79,9 @@ def update(self):
7679 self .input_unchecked = "#404040"
7780 self .input_hover = "#4f4f4f"
7881 self .input_press = "#5f5f5f"
82+ self .scrollbar_arrow = "#676767"
83+ self .scrollbar_arrow_disabled = "#404040"
84+ self .scrollbar_thumb = "#4d4d4d"
7985 self .accent = winaccent .accent_light
8086 self .accent_hover = winaccent ._utils .blend_colors (self .accent , self .bg , 80 )
8187 self .accent_press = winaccent ._utils .blend_colors (self .accent , self .bg , 60 )
@@ -572,6 +578,16 @@ def update_colors(self):
572578 self .radio .config ()
573579
574580
581+ class ScrolledTextTtkScrollbar (ScrolledText ):
582+ def __init__ (self , master , ** kwargs ):
583+ super ().__init__ (master , ** kwargs )
584+
585+ self .vbar .destroy ()
586+ self .vbar = ttk .Scrollbar (self .frame , command = self .yview )
587+ self .vbar .pack (side = "right" , fill = "y" )
588+ self .configure (yscrollcommand = self .vbar .set )
589+
590+
575591class App (tk .Tk ):
576592 def set_theme (self ):
577593 pywinstyles .apply_style (self , "light" if colors .light_theme else "dark" )
@@ -586,12 +602,34 @@ def set_theme(self):
586602 style .configure ("StatusBar.TFrame" , background = colors .bg_status_bar )
587603 style .configure ("StatusBar.TLabel" , background = colors .bg_status_bar , foreground = colors .fg )
588604 style .configure ("Description.TLabel" , foreground = colors .fg_desc )
605+
606+ self .style .configure (
607+ "Vertical.TScrollbar" , background = colors .bg , troughcolor = colors .bg ,
608+ bordercolor = colors .bg , relief = "solid" , padding = (2 , 3 , 1 , 2 )
609+ )
610+
611+ self .style .map (
612+ "Vertical.TScrollbar" ,
613+ arrowcolor = [("disabled" , colors .scrollbar_arrow_disabled ), ("" , colors .scrollbar_arrow )],
614+ lightcolor = [("disabled" , colors .bg ), ("" , colors .scrollbar_thumb )],
615+ darkcolor = [("disabled" , colors .bg ), ("" , colors .scrollbar_thumb )],
616+ fieldbackground = [("disabled" , colors .bg ), ("" , colors .scrollbar_thumb )],
617+ )
618+
589619 self .configure (background = colors .bg )
590620
591621 def __init__ (self , * args , ** kwargs ):
592622 super ().__init__ (* args , ** kwargs )
593623 self .withdraw ()
594624
625+ self .style = ttk .Style ()
626+ self .style .element_create ("Custom.Vertical.Scrollbar.trough" , "from" , "clam" )
627+ self .style .element_create ("Custom.Vertical.Scrollbar.uparrow" , "from" , "alt" )
628+ self .style .element_create ("Custom.Vertical.Scrollbar.downarrow" , "from" , "alt" )
629+ self .style .element_create ("Custom.Vertical.Scrollbar.thumb" , "from" , "clam" , "field" )
630+
631+ self .style .layout ("Vertical.TScrollbar" , [("Button.padding" , {"sticky" : "ns" , "children" : [("Custom.Vertical.Scrollbar.trough" , {"sticky" : "ns" , "children" : [("Custom.Vertical.Scrollbar.uparrow" , {"side" : "top" , "sticky" : "nswe" }), ("Custom.Vertical.Scrollbar.downarrow" , {"side" : "bottom" , "sticky" : "nswe" }), ("Custom.Vertical.Scrollbar.thumb" , {"expand" : "1" , "sticky" : "nswe" })]})]})])
632+
595633 self .iconbitmap (default = preferences .internal + "icons\\ icon.ico" )
596634 self .update ()
597635 self .set_theme ()
0 commit comments