[Update] Config Window: Slider系にtooltip追加。Thanks of Akascape.
This commit is contained in:
@@ -6,3 +6,4 @@ deepl == 1.15.0
|
|||||||
flashtext == 2.7
|
flashtext == 2.7
|
||||||
pyyaml == 6.0.1
|
pyyaml == 6.0.1
|
||||||
python-i18n == 0.3.9
|
python-i18n == 0.3.9
|
||||||
|
CTkToolTip == 0.8
|
||||||
@@ -3,6 +3,7 @@ from types import SimpleNamespace
|
|||||||
from typing import Union
|
from typing import Union
|
||||||
|
|
||||||
from customtkinter import CTkOptionMenu, CTkFont, CTkFrame, CTkLabel, CTkRadioButton, CTkEntry, CTkSlider, CTkSwitch, CTkCheckBox, CTkProgressBar
|
from customtkinter import CTkOptionMenu, CTkFont, CTkFrame, CTkLabel, CTkRadioButton, CTkEntry, CTkSlider, CTkSwitch, CTkCheckBox, CTkProgressBar
|
||||||
|
from CTkToolTip import *
|
||||||
|
|
||||||
from vrct_gui.ui_utils import createButtonWithImage, getLatestWidth, createOptionMenuBox
|
from vrct_gui.ui_utils import createButtonWithImage, getLatestWidth, createOptionMenuBox
|
||||||
from vrct_gui import vrct_gui
|
from vrct_gui import vrct_gui
|
||||||
@@ -260,11 +261,21 @@ class _SettingBoxGenerator():
|
|||||||
)
|
)
|
||||||
setattr(self.config_window, slider_attr_name, slider_widget)
|
setattr(self.config_window, slider_attr_name, slider_widget)
|
||||||
|
|
||||||
|
slider_tooltip = CTkToolTip(
|
||||||
|
slider_widget,
|
||||||
|
message=variable.get(),
|
||||||
|
delay=0,
|
||||||
|
bg_color=self.settings.ctm.SB__SLIDER_TOOLTIP_BG_COLOR,
|
||||||
|
text_color=self.settings.ctm.SB__SLIDER_TOOLTIP_TEXT_COLOR,
|
||||||
|
font=CTkFont(family=self.settings.FONT_FAMILY, size=self.settings.uism.SB__SLIDER_TOOLTIP_FONT_SIZE, weight="normal"),
|
||||||
|
)
|
||||||
|
|
||||||
slider_widget.grid(row=1, column=SETTING_BOX_COLUMN, sticky="e")
|
slider_widget.grid(row=1, column=SETTING_BOX_COLUMN, sticky="e")
|
||||||
|
|
||||||
if slider_bind__ButtonPress is not None:
|
if slider_bind__ButtonPress is not None:
|
||||||
def adjusted_slider_bind__ButtonPress(_e):
|
def adjusted_slider_bind__ButtonPress(_e):
|
||||||
command(_e)
|
command(_e)
|
||||||
|
slider_tooltip.configure(message=slider_widget.get())
|
||||||
slider_bind__ButtonPress()
|
slider_bind__ButtonPress()
|
||||||
slider_widget.configure(command=adjusted_slider_bind__ButtonPress)
|
slider_widget.configure(command=adjusted_slider_bind__ButtonPress)
|
||||||
|
|
||||||
|
|||||||
@@ -282,6 +282,8 @@ class ColorThemeManager():
|
|||||||
self.config_window.SB__SLIDER_PROGRESS_BG_COLOR = self.DARK_500_COLOR
|
self.config_window.SB__SLIDER_PROGRESS_BG_COLOR = self.DARK_500_COLOR
|
||||||
self.config_window.SB__SLIDER_BUTTON_COLOR = self.DARK_700_COLOR
|
self.config_window.SB__SLIDER_BUTTON_COLOR = self.DARK_700_COLOR
|
||||||
self.config_window.SB__SLIDER_BUTTON_HOVERED_COLOR = self.DARK_600_COLOR
|
self.config_window.SB__SLIDER_BUTTON_HOVERED_COLOR = self.DARK_600_COLOR
|
||||||
|
self.config_window.SB__SLIDER_TOOLTIP_BG_COLOR = self.DARK_850_COLOR
|
||||||
|
self.config_window.SB__SLIDER_TOOLTIP_TEXT_COLOR = self.DARK_200_COLOR
|
||||||
|
|
||||||
self.config_window.SB__SWITCH_BOX_BG_COLOR = self.DARK_800_COLOR
|
self.config_window.SB__SWITCH_BOX_BG_COLOR = self.DARK_800_COLOR
|
||||||
self.config_window.SB__SWITCH_BOX_ACTIVE_BG_COLOR = self.PRIMARY_500_COLOR
|
self.config_window.SB__SWITCH_BOX_ACTIVE_BG_COLOR = self.PRIMARY_500_COLOR
|
||||||
|
|||||||
@@ -262,6 +262,7 @@ class UiScalingManager():
|
|||||||
|
|
||||||
self.config_window.SB__SLIDER_WIDTH = self._calculateUiSize(200)
|
self.config_window.SB__SLIDER_WIDTH = self._calculateUiSize(200)
|
||||||
self.config_window.SB__SLIDER_HEIGHT = self._calculateUiSize(16)
|
self.config_window.SB__SLIDER_HEIGHT = self._calculateUiSize(16)
|
||||||
|
self.config_window.SB__SLIDER_TOOLTIP_FONT_SIZE = self._calculateUiSize(16)
|
||||||
|
|
||||||
self.config_window.SB__PROGRESSBAR_X_SLIDER__ENTRY_WIDTH = self.config_window.RESPONSIVE_UI_SIZE_INT_50
|
self.config_window.SB__PROGRESSBAR_X_SLIDER__ENTRY_WIDTH = self.config_window.RESPONSIVE_UI_SIZE_INT_50
|
||||||
self.config_window.SB__PROGRESSBAR_X_SLIDER__ENTRY_HEIGHT = self.config_window.SB__ENTRY_HEIGHT
|
self.config_window.SB__PROGRESSBAR_X_SLIDER__ENTRY_HEIGHT = self.config_window.SB__ENTRY_HEIGHT
|
||||||
|
|||||||
Reference in New Issue
Block a user