[Update] Resend Message Button: To be store-able the status.

Move to Appearance settings.
This commit is contained in:
Sakamoto Shiina
2025-06-15 17:49:42 +09:00
parent d454c9b13a
commit 3f38bfbba8
17 changed files with 90 additions and 42 deletions

View File

@@ -407,6 +407,17 @@ class Config:
self._MESSAGE_BOX_RATIO = value
self.saveConfig(inspect.currentframe().f_code.co_name, value, immediate_save=True)
@property
@json_serializable('SHOW_RESEND_BUTTON')
def SHOW_RESEND_BUTTON(self):
return self._SHOW_RESEND_BUTTON
@SHOW_RESEND_BUTTON.setter
def SHOW_RESEND_BUTTON(self, value):
if isinstance(value, bool):
self._SHOW_RESEND_BUTTON = value
self.saveConfig(inspect.currentframe().f_code.co_name, value)
@property
@json_serializable('FONT_FAMILY')
def FONT_FAMILY(self):
@@ -1090,6 +1101,7 @@ class Config:
self._UI_SCALING = 100
self._TEXTBOX_UI_SCALING = 100
self._MESSAGE_BOX_RATIO = 10
self._SHOW_RESEND_BUTTON = False
self._FONT_FAMILY = "Yu Gothic UI"
self._UI_LANGUAGE = "en"
self._MAIN_WINDOW_GEOMETRY = {

View File

@@ -832,6 +832,20 @@ class Controller:
config.MESSAGE_BOX_RATIO = data
return {"status":200, "result":config.MESSAGE_BOX_RATIO}
@staticmethod
def getShowResendButton(*args, **kwargs) -> dict:
return {"status":200, "result":config.SHOW_RESEND_BUTTON}
@staticmethod
def setEnableShowResendButton(*args, **kwargs) -> dict:
config.SHOW_RESEND_BUTTON = True
return {"status":200, "result":config.SHOW_RESEND_BUTTON}
@staticmethod
def setDisableShowResendButton(*args, **kwargs) -> dict:
config.SHOW_RESEND_BUTTON = False
return {"status":200, "result":config.SHOW_RESEND_BUTTON}
@staticmethod
def getFontFamily(*args, **kwargs) -> dict:
return {"status":200, "result":config.FONT_FAMILY}

View File

@@ -131,6 +131,10 @@ mapping = {
"/get/data/message_box_ratio": {"status": True, "variable":controller.getMessageBoxRatio},
"/set/data/message_box_ratio": {"status": True, "variable":controller.setMessageBoxRatio},
"/get/data/show_resend_button": {"status": True, "variable":controller.getShowResendButton},
"/set/enable/show_resend_button": {"status": True, "variable":controller.setEnableShowResendButton},
"/set/disable/show_resend_button": {"status": True, "variable":controller.setDisableShowResendButton},
"/get/data/font_family": {"status": True, "variable":controller.getFontFamily},
"/set/data/font_family": {"status": True, "variable":controller.setFontFamily},