setting box: add Appearance tab(change the name general to appearance). add item Transparency.
This commit is contained in:
1 parent
ec9f491a0d
commit
6e4dd14c3e
7 files changed
+199
-13
No files matched your search
+7
-9
@@ -6,7 +6,7 @@ from .addConfigSideMenuItem import addConfigSideMenuItem
|
||||
from .createSettingBoxContainer import createSettingBoxContainer
|
||||
|
||||
|
||||
from .setting_box_containers import createSettingBox_General
|
||||
from .setting_box_containers import createSettingBox_Appearance
|
||||
|
||||
|
||||
def createSideMenuAndSettingsBoxContainers(config_window, settings):
|
||||
@@ -45,16 +45,14 @@ def createSideMenuAndSettingsBoxContainers(config_window, settings):
|
||||
|
||||
side_menu_and_setting_box_containers_settings = [
|
||||
{
|
||||
"side_menu_tab_attr_name": "side_menu_tab_general",
|
||||
"label_attr_name": "label_general",
|
||||
"selected_mark_attr_name": "translation_selected_mark",
|
||||
"text": "General",
|
||||
"side_menu_tab_attr_name": "side_menu_tab_appearance",
|
||||
"label_attr_name": "label_appearance",
|
||||
"selected_mark_attr_name": "selected_mark_appearance",
|
||||
"text": "Appearance",
|
||||
"setting_box_container_settings": {
|
||||
"setting_box_container_attr_name": "setting_box_container_general",
|
||||
"setting_box_container_attr_name": "setting_box_container_appearance",
|
||||
"setting_boxes": [
|
||||
{ "section_title": None, "setting_box": createSettingBox_General },
|
||||
# { "section_title": "General Section Title", "setting_box": createSettingBox_General },
|
||||
# { "section_title": None, "setting_box": createSettingBox_General },
|
||||
{ "section_title": None, "setting_box": createSettingBox_Appearance },
|
||||
]
|
||||
},
|
||||
"activate_by_default": True,
|
||||
|
||||
+2
-1
@@ -3,6 +3,7 @@ from ctk_scrollable_dropdown import CTkScrollableDropdown
|
||||
|
||||
from vrct_gui.ui_utils import createButtonWithImage
|
||||
|
||||
from typing import Union
|
||||
|
||||
|
||||
class SettingBoxGenerator():
|
||||
@@ -154,7 +155,7 @@ class SettingBoxGenerator():
|
||||
|
||||
|
||||
|
||||
def createSettingBoxSlider(self, parent_widget, label_text, desc_text, slider_attr_name, slider_range, slider_number_of_steps, command, variable):
|
||||
def createSettingBoxSlider(self, parent_widget, label_text, desc_text, slider_attr_name, slider_range, command, variable, slider_number_of_steps: Union[int, None] = None):
|
||||
(setting_box_frame, setting_box_frame_wrapper) = self._createSettingBoxFrame(parent_widget, label_text, desc_text)
|
||||
|
||||
setting_box_slider_frame = CTkFrame(setting_box_frame_wrapper, corner_radius=0, width=0, height=0, fg_color=self.ctm.SB__BG_COLOR)
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
from .setting_box_general import createSettingBox_General
|
||||
from .setting_box_appearance import createSettingBox_Appearance
|
||||
+1
@@ -0,0 +1 @@
|
||||
from .createSettingBox_Appearance import createSettingBox_Appearance
|
||||
+1
-1
@@ -7,7 +7,7 @@ from ..SettingBoxGenerator import SettingBoxGenerator
|
||||
|
||||
from config import config
|
||||
|
||||
def createSettingBox_General(setting_box_wrapper, config_window, settings):
|
||||
def __tmp(setting_box_wrapper, config_window, settings):
|
||||
|
||||
|
||||
sbg = SettingBoxGenerator(config_window, settings)
|
||||
+187
@@ -0,0 +1,187 @@
|
||||
from time import sleep
|
||||
|
||||
from customtkinter import StringVar, IntVar
|
||||
|
||||
|
||||
from ..SettingBoxGenerator import SettingBoxGenerator
|
||||
|
||||
from config import config
|
||||
|
||||
def createSettingBox_Appearance(setting_box_wrapper, config_window, settings):
|
||||
|
||||
|
||||
sbg = SettingBoxGenerator(config_window, settings)
|
||||
|
||||
createSettingBoxDropdownMenu = sbg.createSettingBoxDropdownMenu
|
||||
createSettingBoxSwitch = sbg.createSettingBoxSwitch
|
||||
createSettingBoxCheckbox = sbg.createSettingBoxCheckbox
|
||||
createSettingBoxSlider = sbg.createSettingBoxSlider
|
||||
createSettingBoxProgressbarXSlider = sbg.createSettingBoxProgressbarXSlider
|
||||
createSettingBoxEntry = sbg.createSettingBoxEntry
|
||||
|
||||
|
||||
|
||||
# 関数名は変えるかもしれない。
|
||||
def slider_transparency_callback(value, slider_widget):
|
||||
# self.parent.wm_attributes("-alpha", int(value/100))
|
||||
config.TRANSPARENCY = int(value)
|
||||
|
||||
|
||||
|
||||
row=0
|
||||
config_window.sb__transparency = createSettingBoxSlider(
|
||||
parent_widget=setting_box_wrapper,
|
||||
label_text="Transparency",
|
||||
desc_text="It'll change window's transparency. (50% ~ 100%)",
|
||||
slider_attr_name="sb__transparency_slider",
|
||||
slider_range=(50, 100),
|
||||
command=lambda value: slider_transparency_callback(value, config_window.sb__transparency_slider),
|
||||
variable=IntVar(value=config.TRANSPARENCY),
|
||||
)
|
||||
config_window.sb__transparency.grid(row=row)
|
||||
row+=1
|
||||
|
||||
|
||||
|
||||
# config_window.sb__dropdown_menu_1 = createSettingBoxDropdownMenu(
|
||||
# parent_widget=setting_box_wrapper,
|
||||
# label_text="Option Menu",
|
||||
# desc_text="Select your preferences from the options menu.\nYou can choose your preferred language.",
|
||||
# optionmenu_attr_name="optionmenu_attr_name_1",
|
||||
# dropdown_menu_attr_name="dropdown_menu_attr_name_1",
|
||||
# dropdown_menu_values=["tt", "Japanese", "English"],
|
||||
# command=lambda value: dropdownMenuFun(value, config_window.optionmenu_attr_name_1, config_window.dropdown_menu_attr_name_1),
|
||||
# variable=StringVar(value=config.INPUT_SOURCE_LANG)
|
||||
# )
|
||||
# config_window.sb__dropdown_menu_1.grid(row=row)
|
||||
# row+=1
|
||||
|
||||
|
||||
# config_window.sb__dropdown_menu_2 = createSettingBoxDropdownMenu(
|
||||
# parent_widget=setting_box_wrapper,
|
||||
# label_text="Option Menu",
|
||||
# desc_text="Select your preferences from the options menu.\nYou can choose your preferred language.",
|
||||
# optionmenu_attr_name="optionmenu_attr_name_2",
|
||||
# dropdown_menu_attr_name="dropdown_menu_attr_name_1",
|
||||
# dropdown_menu_values=["tt", "Japanese", "English"],
|
||||
# command=lambda value: dropdownMenuFun(value, config_window.optionmenu_attr_name_2, config_window.dropdown_menu_attr_name_1),
|
||||
# variable=StringVar(value=config.INPUT_SOURCE_LANG)
|
||||
# )
|
||||
# config_window.sb__dropdown_menu_2.grid(row=row)
|
||||
# row+=1
|
||||
|
||||
# config_window.sb__switch_1 = createSettingBoxSwitch(
|
||||
# parent_widget=setting_box_wrapper,
|
||||
# label_text="Switch",
|
||||
# desc_text="Turning this switch on will bring happiness.\nAs for turning it off... I leave that to your imagination",
|
||||
# switch_attr_name="switch_attr_name_1",
|
||||
# command=lambda: switchFun(config_window.switch_attr_name_1),
|
||||
# is_checked=True,
|
||||
# )
|
||||
# config_window.sb__switch_1.grid(row=row)
|
||||
# row+=1
|
||||
|
||||
# config_window.sb__checkbox_1 = createSettingBoxCheckbox(
|
||||
# parent_widget=setting_box_wrapper,
|
||||
# label_text="Checkbox",
|
||||
# desc_text="Checkbox ticked, a checkmark.",
|
||||
# checkbox_attr_name="checkbox_attr_name_1",
|
||||
# command=lambda: checkboxFun(config_window.checkbox_attr_name_1),
|
||||
# is_checked=False,
|
||||
# )
|
||||
# config_window.sb__checkbox_1.grid(row=row)
|
||||
# row+=1
|
||||
|
||||
# config_window.sb__slider_1 = createSettingBoxSlider(
|
||||
# parent_widget=setting_box_wrapper,
|
||||
# label_text="Slider",
|
||||
# desc_text="Adjust using the slider; the balance is up to you.",
|
||||
# slider_attr_name="slider_attr_name_1",
|
||||
# slider_range=(0, config_window.MAX_SPEAKER_ENERGY_THRESHOLD),
|
||||
# slider_number_of_steps=config_window.MAX_SPEAKER_ENERGY_THRESHOLD,
|
||||
# command=lambda value: sliderFun(value, config_window.slider_attr_name_1),
|
||||
# variable=IntVar(value=config_window.INPUT_SPEAKER_ENERGY_THRESHOLD),
|
||||
# )
|
||||
# config_window.sb__slider_1.grid(row=row)
|
||||
# row+=1
|
||||
|
||||
|
||||
# config_window.sb__progressbar_x_slider_1 = createSettingBoxProgressbarXSlider(
|
||||
# parent_widget=setting_box_wrapper,
|
||||
# label_text="Progressbar and Slider for check the threshold",
|
||||
# desc_text="just the slider to modify the threshold for activating voice input.\nPress the microphone button to start input, and you can adjust it while monitoring the actual volume.",
|
||||
# command=set_input_threshold, # ?
|
||||
# variable=IntVar(value=config.INPUT_MIC_ENERGY_THRESHOLD),
|
||||
# entry_attr_name="progressbar_x_slider__entry_attr_name_1",
|
||||
|
||||
|
||||
# slider_attr_name="progressbar_x_slider__slider_attr_name_1",
|
||||
# slider_range=(0, config_window.MAX_SPEAKER_ENERGY_THRESHOLD),
|
||||
# slider_number_of_steps=config_window.MAX_SPEAKER_ENERGY_THRESHOLD,
|
||||
|
||||
# progressbar_attr_name="progressbar_x_slider__progressbar_attr_name_1",
|
||||
|
||||
# passive_button_attr_name="progressbar_x_slider__passive_button_attr_name_1",
|
||||
# passive_button_command=lambda e: checkbox_input_speaker_threshold_check_callback(
|
||||
# e,
|
||||
# config_window.progressbar_x_slider__passive_button_attr_name_1,
|
||||
# config_window.progressbar_x_slider__active_button_attr_name_1,
|
||||
# is_turned_on=True,
|
||||
# ),
|
||||
# active_button_attr_name="progressbar_x_slider__active_button_attr_name_1",
|
||||
# active_button_command=lambda e: checkbox_input_speaker_threshold_check_callback(
|
||||
# e,
|
||||
# config_window.progressbar_x_slider__passive_button_attr_name_1,
|
||||
# config_window.progressbar_x_slider__active_button_attr_name_1,
|
||||
# is_turned_on=False,
|
||||
# ),
|
||||
# button_image_filename="mic_icon_white.png"
|
||||
# )
|
||||
# config_window.sb__progressbar_x_slider_1.grid(row=row)
|
||||
# row+=1
|
||||
|
||||
# config_window.sb__progressbar_x_slider_2 = createSettingBoxProgressbarXSlider(
|
||||
# parent_widget=setting_box_wrapper,
|
||||
# label_text="Progressbar and Slider for check the threshold2",
|
||||
# desc_text="just the slider to modify the threshold for activating voice input.\nPress the microphone button to start input, and you can adjust it while monitoring the actual volume.",
|
||||
# command=set_input_threshold, # ?
|
||||
# variable=IntVar(value=config.INPUT_SPEAKER_ENERGY_THRESHOLD),
|
||||
|
||||
# entry_attr_name="progressbar_x_slider__entry_attr_name_2",
|
||||
|
||||
|
||||
# slider_attr_name="progressbar_x_slider__slider_attr_name_2",
|
||||
# slider_range=(0, config_window.MAX_SPEAKER_ENERGY_THRESHOLD),
|
||||
# slider_number_of_steps=config_window.MAX_SPEAKER_ENERGY_THRESHOLD,
|
||||
# progressbar_attr_name="progressbar_x_slider__progressbar_attr_name_2",
|
||||
|
||||
# passive_button_attr_name="progressbar_x_slider__passive_button_attr_name_2",
|
||||
# passive_button_command=lambda e: checkbox_input_speaker_threshold_check_callback(
|
||||
# e,
|
||||
# config_window.progressbar_x_slider__passive_button_attr_name_2,
|
||||
# config_window.progressbar_x_slider__active_button_attr_name_2,
|
||||
# is_turned_on=True,
|
||||
# ),
|
||||
# active_button_attr_name="progressbar_x_slider__active_button_attr_name_2",
|
||||
# active_button_command=lambda e: checkbox_input_speaker_threshold_check_callback(
|
||||
# e,
|
||||
# config_window.progressbar_x_slider__passive_button_attr_name_2,
|
||||
# config_window.progressbar_x_slider__active_button_attr_name_2,
|
||||
# is_turned_on=False,
|
||||
# ),
|
||||
# button_image_filename="headphones_icon_white.png"
|
||||
# )
|
||||
# config_window.sb__progressbar_x_slider_2.grid(row=row)
|
||||
# row+=1
|
||||
|
||||
# config_window.sb__entry_1 = createSettingBoxEntry(
|
||||
# parent_widget=setting_box_wrapper,
|
||||
# label_text="Entry",
|
||||
# desc_text="Please input a numerical value.",
|
||||
# entry_attr_name="entry_attr_name_1",
|
||||
# entry_width=settings.uism.SB__ENTRY_WIDTH_100,
|
||||
# entry_bind__Any_KeyRelease=lambda value: entryFun(value, config_window.entry_attr_name_1),
|
||||
# entry_textvariable=IntVar(value=config_window.INPUT_MIC_PHRASE_TIMEOUT),
|
||||
# )
|
||||
# config_window.sb__entry_1.grid(row=row, pady=0)
|
||||
# row+=1
|
||||
-1
@@ -1 +0,0 @@
|
||||
from .createSettingBox_General import createSettingBox_General
|
||||
Reference in new issue
Block a user