@@ -619,15 +619,17 @@ def __init__(self,cwd,paths_to_add=None,exclude=None,exclude_regexp=None,norun=N
619
619
620
620
themes_names = ['Clam' , 'Alt' ]
621
621
if windows :
622
- themes_names = ['Vista' ,'Winnative' , 'Xpnative' ] + themes_names
623
- else :
624
- themes_names = themes_names + [ 'Classic' , 'Default' ]
622
+ themes_names = ['Vista' ,'Winnative' ] + themes_names
623
+
624
+ #print(' themes_names:',themes_names)
625
625
626
626
for name in themes_names :
627
627
for darkness ,darknesscode in (('' ,0 ),('Dark' ,1 )):
628
- full_name = name + ' ' + darkness
628
+ full_name = name + (( ' ' + darkness ) if darknesscode else '' )
629
629
self .themes_combos [full_name ]= name .lower (),darknesscode
630
630
631
+ #print('themes_combos:',self.themes_combos)
632
+
631
633
self .default_theme = 'vista' if windows else 'clam'
632
634
633
635
theme_name ,black_theme = self .themes_combos .get (self .cfg_get (CFG_THEME ),(self .default_theme ,0 ))
@@ -767,19 +769,22 @@ def __init__(self,cwd,paths_to_add=None,exclude=None,exclude_regexp=None,norun=N
767
769
####################################################################
768
770
style = Style ()
769
771
770
- parent_them = theme_name
771
-
772
772
try :
773
773
style .theme_create ( "dummy" , parent = theme_name )
774
774
except Exception as e :
775
+ print ("cannot set theme - setting default" )
775
776
print (e )
776
777
777
- try :
778
- style .theme_create ( "dummy" , parent = self .default_theme )
779
- except Exception as e2 :
780
- print (e2 )
778
+ self .cfg .set (CFG_THEME ,self .default_theme )
779
+
780
+ sys_exit (1 )
781
781
782
- sys_exit (1 )
782
+ #try:
783
+ # style.theme_create( "dummy", parent=self.default_theme )
784
+ #except Exception as e2:
785
+ # print(e2)
786
+
787
+ # sys_exit(1)
783
788
784
789
bg_color = self .bg_color = style .lookup ('TFrame' , 'background' )
785
790
preview .configure (bg = bg_color )
@@ -794,7 +799,7 @@ def __init__(self,cwd,paths_to_add=None,exclude=None,exclude_regexp=None,norun=N
794
799
style_map ('Treeview' , background = [('focus' ,bg_focus ),('selected' ,bg_sel ),('' ,self .bg_content )] )
795
800
style_map ('semi_focus.Treeview' , background = [('focus' ,bg_focus ),('selected' ,bg_focus_off ),('' ,self .bg_content )])
796
801
#works but not for every theme
797
- style_configure ("Treeview" , fieldbackground = self .bg_content )
802
+ style_configure ("Treeview" , fieldbackground = self .bg_content , background = bg_color , borderwidth = 0 )
798
803
799
804
style_map ("TCheckbutton" ,indicatorbackground = [("disabled" ,self .bg_color ),('' ,'white' )],indicatorforeground = [("disabled" ,'darkgray' ),('' ,'black' )],foreground = [('disabled' ,"gray" ),('' ,"black" )])
800
805
style_map ("TEntry" , foreground = [("disabled" ,'darkgray' ),('' ,'black' )],fieldbackground = [("disabled" ,self .bg_color ),('' ,'white' )])
@@ -815,11 +820,50 @@ def __init__(self,cwd,paths_to_add=None,exclude=None,exclude_regexp=None,norun=N
815
820
style_configure ("Treeview" ,rowheight = 18 )
816
821
style_configure ("TButton" , anchor = "center" )
817
822
style_configure ("TCheckbutton" ,anchor = 'center' ,padding = (4 , 0 , 4 , 0 ) )
823
+
818
824
if windows :
819
825
#fix border problem ...
820
826
style_configure ("TCombobox" ,padding = 1 )
821
827
828
+ #######################################################################
829
+
830
+ style .element_create ("Treeheading.border" , "from" , "default" )
831
+ style .layout ("Treeview.Heading" , [
832
+ ("Treeheading.cell" , {'sticky' : 'nswe' }),
833
+ ("Treeheading.border" , {'sticky' :'nswe' , 'children' : [
834
+ ("Treeheading.padding" , {'sticky' :'nswe' , 'children' : [
835
+ ("Treeheading.image" , {'side' :'right' , 'sticky' :'' }),
836
+ ("Treeheading.text" , {'sticky' :'we' })
837
+ ]})
838
+ ]}),
839
+ ])
840
+
841
+ style_configure ("Treeview.Heading" ,background = self .bg_color , foreground = "black" , relief = "groove" )
842
+ style_map ("Treeview.Heading" ,relief = [('active' ,'raised' ),('pressed' ,'sunken' )])
822
843
844
+ style_configure ("Treeview" ,background = self .bg_color , relief = "flat" ,borderwidth = 0 )
845
+
846
+ #######################################################################
847
+ #style.element_create("Vertical.Scrollbar.trough", "from", "default")
848
+ #style.element_create("Vertical.Scrollbar.thumb", "from", "default")
849
+ #style.element_create("Vertical.Scrollbar.grip", "from", "default")
850
+ #style.element_create("Vertical.Scrollbar.uparrow", "from", "default")
851
+ #style.element_create("Vertical.Scrollbar.downarrow", "from", "default")
852
+
853
+
854
+ #style.layout("Vertical.TScrollbar", [
855
+ # ("Vertical.Scrollbar.uparrow", {"side": "top", "sticky": "news"}),
856
+ # ("Vertical.Scrollbar.downarrow", {"side": "bottom", "sticky": "news"}),
857
+ # ("Vertical.Scrollbar.trough", {"sticky": "news", "children": [
858
+ # ("Vertical.Scrollbar.thumb", {"sticky": "nswe", "children": [
859
+ # ("Vertical.Scrollbar.grip", {"sticky": "news"})
860
+ # ]})
861
+ # ]})
862
+ #])
863
+
864
+ # Konfiguracja stylu Scrollbara
865
+ #style_configure("Vertical.TScrollbar",background=self.bg_color,troughcolor=self.bg_color,bordercolor='black',relief="raised")
866
+ #style_map("Vertical.TScrollbar", background=[("active", "lightgray")],relief=[("pressed", "sunken")])
823
867
824
868
#######################################################################
825
869
self .menubar = Menu (self_main ,bg = bg_color )
@@ -856,24 +900,24 @@ def __init__(self,cwd,paths_to_add=None,exclude=None,exclude_regexp=None,norun=N
856
900
self .status_all_quant = Label (status_frame_groups ,width = 10 ,borderwidth = 2 ,bg = bg_color ,relief = 'groove' ,foreground = 'red' ,anchor = 'w' )
857
901
self .status_all_quant_configure = self .status_all_quant .configure
858
902
859
- self .status_all_quant .pack (fill = 'x ' ,expand = 0 ,side = 'right' )
860
- Label (status_frame_groups ,width = 16 ,text = STR ("All marked files # " ),relief = 'groove' ,borderwidth = 2 ,bg = bg_color ,anchor = 'e' ).pack (fill = 'x ' ,expand = 0 ,side = 'right' )
903
+ self .status_all_quant .pack (fill = 'both ' ,expand = 0 ,side = 'right' )
904
+ Label (status_frame_groups ,width = 16 ,text = STR ("All marked files # " ),relief = 'groove' ,borderwidth = 2 ,bg = bg_color ,anchor = 'e' ).pack (fill = 'both ' ,expand = 0 ,side = 'right' )
861
905
self .status_all_size = Label (status_frame_groups ,width = 10 ,borderwidth = 2 ,bg = bg_color ,relief = 'groove' ,foreground = 'red' ,anchor = 'w' )
862
- self .status_all_size .pack (fill = 'x ' ,expand = 0 ,side = 'right' )
906
+ self .status_all_size .pack (fill = 'both ' ,expand = 0 ,side = 'right' )
863
907
self .status_all_size_configure = self .status_all_size .configure
864
908
865
- Label (status_frame_groups ,width = 20 ,text = STR ('All marked files size: ' ),relief = 'groove' ,borderwidth = 2 ,bg = bg_color ,anchor = 'e' ).pack (fill = 'x ' ,expand = 0 ,side = 'right' )
909
+ Label (status_frame_groups ,width = 20 ,text = STR ('All marked files size: ' ),relief = 'groove' ,borderwidth = 2 ,bg = bg_color ,anchor = 'e' ).pack (fill = 'both ' ,expand = 0 ,side = 'right' )
866
910
self .status_groups = Label (status_frame_groups ,text = '0' ,image = self .ico_empty ,width = 80 ,compound = 'right' ,borderwidth = 2 ,bg = bg_color ,relief = 'groove' ,anchor = 'e' )
867
911
self .status_groups_configure = self .status_groups .configure
868
912
869
- self .status_groups .pack (fill = 'x ' ,expand = 0 ,side = 'right' )
913
+ self .status_groups .pack (fill = 'both ' ,expand = 0 ,side = 'right' )
870
914
871
915
self .widget_tooltip (self .status_groups ,STR ('Number of groups with consideration of\n "Cross paths" or "Same directory" mode' ))
872
916
873
- Label (status_frame_groups ,width = 10 ,text = STR ('Groups: ' ),relief = 'groove' ,borderwidth = 2 ,bg = bg_color ,anchor = 'e' ).pack (fill = 'x ' ,expand = 0 ,side = 'right' )
917
+ Label (status_frame_groups ,width = 10 ,text = STR ('Groups: ' ),relief = 'groove' ,borderwidth = 2 ,bg = bg_color ,anchor = 'e' ).pack (fill = 'both ' ,expand = 0 ,side = 'right' )
874
918
875
- self .status_path = Label (status_frame_groups ,text = '' ,relief = 'flat' ,borderwidth = 1 ,bg = bg_color ,anchor = 'w' )
876
- self .status_path .pack (fill = 'x ' ,expand = 1 ,side = 'left' )
919
+ self .status_path = Label (status_frame_groups ,text = '' ,relief = 'flat' ,borderwidth = 3 ,bg = bg_color ,anchor = 'w' )
920
+ self .status_path .pack (fill = 'both ' ,expand = 1 ,side = 'left' )
877
921
self .widget_tooltip (self .status_path ,STR ('The full path of a directory\n shown in the bottom panel.' ))
878
922
879
923
self .status_path_configure = self .status_path .configure
@@ -882,20 +926,20 @@ def __init__(self,cwd,paths_to_add=None,exclude=None,exclude_regexp=None,norun=N
882
926
(status_frame_folder := Frame (frame_folder ,bg = bg_color )).pack (side = 'bottom' ,fill = 'both' )
883
927
884
928
self .status_line_lab = Label (status_frame_folder ,width = 30 ,image = self_ico ['expression' ],compound = 'left' ,text = '' ,borderwidth = 2 ,bg = bg_color ,relief = 'groove' ,anchor = 'w' )
885
- self .status_line_lab .pack (fill = 'x ' ,expand = 1 ,side = 'left' )
929
+ self .status_line_lab .pack (fill = 'both ' ,expand = 1 ,side = 'left' )
886
930
self .status_line_lab_configure = self .status_line_lab .configure
887
931
self .status_line_lab_update = self .status_line_lab .update
888
932
889
933
self .status_folder_quant = Label (status_frame_folder ,width = 10 ,borderwidth = 2 ,bg = bg_color ,relief = 'groove' ,foreground = 'red' ,anchor = 'w' )
890
- self .status_folder_quant .pack (fill = 'x ' ,expand = 0 ,side = 'right' )
934
+ self .status_folder_quant .pack (fill = 'both ' ,expand = 0 ,side = 'right' )
891
935
self .status_folder_quant_configure = self .status_folder_quant .configure
892
936
893
- Label (status_frame_folder ,width = 16 ,text = STR ('Marked files # ' ),relief = 'groove' ,borderwidth = 2 ,bg = bg_color ,anchor = 'e' ).pack (fill = 'x ' ,expand = 0 ,side = 'right' )
894
- self .status_folder_size = Label (status_frame_folder ,width = 10 ,borderwidth = 2 ,bg = bg_color ,relief = 'groove' ,foreground = 'red' ,anchor = 'w' )
937
+ Label (status_frame_folder ,width = 16 ,text = STR ('Marked files # ' ),relief = 'groove' ,borderwidth = 2 ,bg = bg_color ,anchor = 'e' ).pack (fill = 'both ' ,expand = 0 ,side = 'right' )
938
+ self .status_folder_size = Label (status_frame_folder ,width = 80 , image = self . ico_empty , compound = 'right' ,borderwidth = 2 ,bg = bg_color ,relief = 'groove' ,foreground = 'red' ,anchor = 'w' )
895
939
self .status_folder_size .pack (expand = 0 ,side = 'right' )
896
940
self .status_folder_size_configure = self .status_folder_size .configure
897
941
898
- Label (status_frame_folder ,width = 20 ,text = STR ('Marked files size: ' ),relief = 'groove' ,borderwidth = 2 ,bg = bg_color ,anchor = 'e' ).pack (fill = 'x ' ,expand = 0 ,side = 'right' )
942
+ Label (status_frame_folder ,width = 20 ,text = STR ('Marked files size: ' ),relief = 'groove' ,borderwidth = 2 ,bg = bg_color ,anchor = 'e' ).pack (fill = 'both ' ,expand = 0 ,side = 'right' )
899
943
900
944
self_main_unbind_class = self .main_unbind_class = self_main .unbind_class
901
945
@@ -1046,47 +1090,24 @@ def self_folder_tree_yview(*args):
1046
1090
self_groups_tree_tag_configure = self_groups_tree .tag_configure
1047
1091
self_folder_tree_tag_configure = self_folder_tree .tag_configure
1048
1092
1049
- if black_theme :
1050
- self_groups_tree_tag_configure (self .NOTAG ,foreground = 'white' )
1051
- #self_groups_tree_tag_configure(self.FILE, foreground='white')
1052
- self_groups_tree_tag_configure (self .MARK , foreground = 'tomato' )
1053
- #self_groups_tree_tag_configure(self.MARK, background='red')
1054
-
1055
- self_groups_tree_tag_configure (self .CRC , foreground = 'white' )
1056
-
1057
-
1058
- self_folder_tree_tag_configure (self .DIR ,foreground = 'white' ,font = "TkDefaultFont 10 bold" )
1059
- self_folder_tree_tag_configure (self .DIRLINK ,foreground = 'white' ,font = "TkDefaultFont 10 bold" )
1060
- self_folder_tree_tag_configure (self .UPDIR ,foreground = 'white' ,font = "TkDefaultFont 10 bold" )
1061
-
1062
- self_folder_tree_tag_configure (self .NOTAG ,foreground = 'white' )
1063
- self_folder_tree_tag_configure (self .LINK ,foreground = 'white' )
1064
- self_folder_tree_tag_configure (self .SINGLEHARDLINKED ,foreground = 'white' )
1065
-
1066
- self_folder_tree_tag_configure (self .MARK , foreground = 'tomato' )
1067
- self_folder_tree_tag_configure (self .MARK , background = 'tomato' )
1068
-
1069
- self_folder_tree_tag_configure (self .SINGLE , foreground = 'white' )
1070
- self_folder_tree_tag_configure (self .DIR , foreground = 'white' ,font = "TkDefaultFont 10 bold" )
1071
- self_folder_tree_tag_configure (self .DIRLINK , foreground = 'white' ,font = "TkDefaultFont 10 bold" )
1072
- self_folder_tree_tag_configure (self .LINK , foreground = 'darkgray' )
1073
- else :
1074
- self_groups_tree_tag_configure (self .NOTAG ,foreground = 'black' )
1093
+ self_groups_tree_tag_configure (self .NOTAG ,foreground = self .fg_content )
1094
+ self_folder_tree_tag_configure (self .NOTAG ,foreground = self .fg_content )
1095
+ self_groups_tree_tag_configure (self .CRC , foreground = 'gray' )
1096
+ self_folder_tree_tag_configure (self .LINK , foreground = 'darkgray' )
1097
+ self_folder_tree_tag_configure (self .SINGLEHARDLINKED ,foreground = 'darkgray' )
1075
1098
1076
- self_groups_tree_tag_configure (self .MARK , foreground = 'red' )
1077
- self_groups_tree_tag_configure (self .MARK , background = 'red' )
1078
- self_groups_tree_tag_configure (self .CRC , foreground = 'gray' )
1099
+ mark_color = 'tomato' if black_theme else 'red'
1100
+ folder_color = 'wheat1' if black_theme else 'wheat4'
1079
1101
1080
- self_folder_tree_tag_configure = self_folder_tree . tag_configure
1102
+ self_groups_tree_tag_configure ( self . MARK , foreground = mark_color )
1081
1103
1082
- self_folder_tree_tag_configure (self .MARK , foreground = 'red' )
1083
- self_folder_tree_tag_configure (self .MARK , background = 'red' )
1104
+ self_folder_tree_tag_configure (self .DIR ,foreground = folder_color ,font = "TkDefaultFont 10 bold" )
1105
+ self_folder_tree_tag_configure (self .DIRLINK ,foreground = folder_color ,font = "TkDefaultFont 10 bold" )
1106
+ self_folder_tree_tag_configure (self .UPDIR ,foreground = folder_color ,font = "TkDefaultFont 10 bold" )
1084
1107
1085
- self_folder_tree_tag_configure (self .SINGLE , foreground = 'gray' )
1086
- self_folder_tree_tag_configure (self .DIR , foreground = 'sienna4' ,font = "TkDefaultFont 10 bold" )
1087
- self_folder_tree_tag_configure (self .DIRLINK , foreground = 'sienna4' ,font = "TkDefaultFont 10 bold" )
1088
- self_folder_tree_tag_configure (self .LINK , foreground = 'darkgray' )
1108
+ self_folder_tree_tag_configure (self .MARK , foreground = mark_color )
1089
1109
1110
+ self_folder_tree_tag_configure (self .SINGLE , foreground = 'gray' )
1090
1111
1091
1112
#bind_class breaks columns resizing
1092
1113
self_folder_tree .bind ('<ButtonPress-1>' , self .tree_on_mouse_button_press )
0 commit comments