@@ -552,6 +552,12 @@ def apply_camera_settings(cam, use_webcam):
552552 print (f"Error applying camera settings: { e } " )
553553
554554
555+
556+
557+
558+
559+
560+
555561class CameraSettingsActivity (Activity ):
556562 """Settings activity for comprehensive camera configuration."""
557563
@@ -656,8 +662,8 @@ def onCreate(self):
656662 expert_tab = tabview .add_tab ("Expert" )
657663 self .create_expert_tab (expert_tab , prefs )
658664
659- raw_tab = tabview .add_tab ("Raw" )
660- self .create_raw_tab (raw_tab , prefs )
665+ # raw_tab = tabview.add_tab("Raw")
666+ # self.create_raw_tab(raw_tab, prefs)
661667
662668 self .setContentView (screen )
663669
@@ -754,19 +760,10 @@ def create_textarea(self, parent, label_text, min_val, max_val, default_val, pre
754760 return textarea , cont
755761
756762 def show_keyboard (self , kbd ):
757- #self.button_cont.add_flag(lv.obj.FLAG.HIDDEN)
758763 mpos .ui .anim .smooth_show (kbd )
759- focusgroup = lv .group_get_default ()
760- if focusgroup :
761- # move the focus to the keyboard to save the user a "next" button press (optional but nice)
762- # this is focusing on the right thing (keyboard) but the focus is not "active" (shown or used) somehow
763- #print(f"current focus object: {lv.group_get_default().get_focused()}")
764- focusgroup .focus_next ()
765- #print(f"current focus object: {lv.group_get_default().get_focused()}")
766764
767765 def hide_keyboard (self , kbd ):
768766 mpos .ui .anim .smooth_hide (kbd )
769- #self.button_cont.remove_flag(lv.obj.FLAG.HIDDEN)
770767
771768 def add_buttons (self , parent ):
772769 # Save/Cancel buttons at bottom
@@ -775,7 +772,6 @@ def add_buttons(self, parent):
775772 button_cont .remove_flag (lv .obj .FLAG .SCROLLABLE )
776773 button_cont .align (lv .ALIGN .BOTTOM_MID , 0 , 0 )
777774 button_cont .set_style_border_width (0 , 0 )
778- button_cont .set_style_bg_opa (0 , 0 )
779775
780776 save_button = lv .button (button_cont )
781777 save_button .set_size (mpos .ui .pct_of_display_width (25 ), lv .SIZE_CONTENT )
@@ -857,16 +853,6 @@ def create_advanced_tab(self, tab, prefs):
857853 tab .set_flex_flow (lv .FLEX_FLOW .COLUMN )
858854 tab .set_style_pad_all (1 , 0 )
859855
860- # Special Effect
861- special_effect_options = [
862- ("None" , 0 ), ("Negative" , 1 ), ("Grayscale" , 2 ),
863- ("Reddish" , 3 ), ("Greenish" , 4 ), ("Blue" , 5 ), ("Retro" , 6 )
864- ]
865- special_effect = prefs .get_int ("special_effect" , 0 )
866- dropdown , cont = self .create_dropdown (tab , "Special Effect:" , special_effect_options ,
867- special_effect , "special_effect" )
868- self .ui_controls ["special_effect" ] = dropdown
869-
870856 # Auto Exposure Control (master switch)
871857 exposure_ctrl = prefs .get_bool ("exposure_ctrl" , True )
872858 aec_checkbox , cont = self .create_checkbox (tab , "Auto Exposure" , exposure_ctrl , "exposure_ctrl" )
@@ -877,27 +863,27 @@ def create_advanced_tab(self, tab, prefs):
877863 me_slider , label , cont = self .create_slider (tab , "Manual Exposure" , 0 , 1200 , aec_value , "aec_value" )
878864 self .ui_controls ["aec_value" ] = me_slider
879865
880- # Set initial state
881- if exposure_ctrl :
882- me_slider . add_state ( lv . STATE . DISABLED )
883- me_slider . set_style_bg_opa ( 128 , 0 )
866+ # Auto Exposure Level (dependent)
867+ ae_level = prefs . get_int ( "ae_level" , 0 )
868+ ae_slider , label , cont = self . create_slider ( tab , "Auto Exposure Level" , - 2 , 2 , ae_level , "ae_level" )
869+ self . ui_controls [ "ae_level" ] = ae_slider
884870
885871 # Add dependency handler
886- def exposure_ctrl_changed (e ):
872+ def exposure_ctrl_changed (e = None ):
887873 is_auto = aec_checkbox .get_state () & lv .STATE .CHECKED
888874 if is_auto :
889875 me_slider .add_state (lv .STATE .DISABLED )
890- me_slider .set_style_bg_opa (128 , 0 )
876+ me_slider .set_style_opa (128 , 0 )
877+ ae_slider .remove_state (lv .STATE .DISABLED )
878+ ae_slider .set_style_opa (255 , 0 )
891879 else :
892880 me_slider .remove_state (lv .STATE .DISABLED )
893- me_slider .set_style_bg_opa (255 , 0 )
881+ me_slider .set_style_opa (255 , 0 )
882+ ae_slider .add_state (lv .STATE .DISABLED )
883+ ae_slider .set_style_opa (128 , 0 )
894884
895885 aec_checkbox .add_event_cb (exposure_ctrl_changed , lv .EVENT .VALUE_CHANGED , None )
896-
897- # Auto Exposure Level
898- ae_level = prefs .get_int ("ae_level" , 0 )
899- slider , label , cont = self .create_slider (tab , "Auto Exposure Level" , - 2 , 2 , ae_level , "ae_level" )
900- self .ui_controls ["ae_level" ] = slider
886+ exposure_ctrl_changed ()
901887
902888 # Night Mode (AEC2)
903889 aec2 = prefs .get_bool ("aec2" , False )
@@ -916,17 +902,17 @@ def exposure_ctrl_changed(e):
916902
917903 if gain_ctrl :
918904 slider .add_state (lv .STATE .DISABLED )
919- slider .set_style_bg_opa (128 , 0 )
905+ slider .set_style_opa (128 , 0 )
920906
921907 def gain_ctrl_changed (e ):
922908 is_auto = agc_checkbox .get_state () & lv .STATE .CHECKED
923909 gain_slider = self .ui_controls ["agc_gain" ]
924910 if is_auto :
925911 gain_slider .add_state (lv .STATE .DISABLED )
926- gain_slider .set_style_bg_opa (128 , 0 )
912+ gain_slider .set_style_opa (128 , 0 )
927913 else :
928914 gain_slider .remove_state (lv .STATE .DISABLED )
929- gain_slider .set_style_bg_opa (255 , 0 )
915+ gain_slider .set_style_opa (255 , 0 )
930916
931917 agc_checkbox .add_event_cb (gain_ctrl_changed , lv .EVENT .VALUE_CHANGED , None )
932918
@@ -972,6 +958,16 @@ def whitebal_changed(e):
972958
973959 self .add_buttons (tab )
974960
961+ # Special Effect
962+ special_effect_options = [
963+ ("None" , 0 ), ("Negative" , 1 ), ("Grayscale" , 2 ),
964+ ("Reddish" , 3 ), ("Greenish" , 4 ), ("Blue" , 5 ), ("Retro" , 6 )
965+ ]
966+ special_effect = prefs .get_int ("special_effect" , 0 )
967+ dropdown , cont = self .create_dropdown (tab , "Special Effect:" , special_effect_options ,
968+ special_effect , "special_effect" )
969+ self .ui_controls ["special_effect" ] = dropdown
970+
975971 def create_expert_tab (self , tab , prefs ):
976972 """Create Expert settings tab."""
977973 #tab.set_scrollbar_mode(lv.SCROLLBAR_MODE.AUTO)
@@ -989,7 +985,7 @@ def create_expert_tab(self, tab, prefs):
989985
990986 if not supports_sharpness :
991987 slider .add_state (lv .STATE .DISABLED )
992- slider .set_style_bg_opa (128 , 0 )
988+ slider .set_style_opa (128 , 0 )
993989 note = lv .label (cont )
994990 note .set_text ("(Not available on this sensor)" )
995991 note .set_style_text_color (lv .color_hex (0x808080 ), 0 )
@@ -1002,7 +998,7 @@ def create_expert_tab(self, tab, prefs):
1002998
1003999 if not supports_sharpness :
10041000 slider .add_state (lv .STATE .DISABLED )
1005- slider .set_style_bg_opa (128 , 0 )
1001+ slider .set_style_opa (128 , 0 )
10061002 note = lv .label (cont )
10071003 note .set_text ("(Not available on this sensor)" )
10081004 note .set_style_text_color (lv .color_hex (0x808080 ), 0 )
0 commit comments