修改文本消息宽度

This commit is contained in:
shuaikangzhou 2023-11-24 20:16:01 +08:00
parent e61f092d56
commit b732481d9c
7 changed files with 50 additions and 76 deletions

View File

@ -4,42 +4,13 @@
<option name="autoReloadType" value="SELECTIVE" />
</component>
<component name="ChangeListManager">
<list default="true" id="84e65474-7da9-466d-baf3-cc88dde3ffdd" name="变更" comment="更新wx选择的路径">
<change afterPath="$PROJECT_DIR$/app/person_pc.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/app/resources/resource.qrc" afterDir="false" />
<change afterPath="$PROJECT_DIR$/app/resources/version_list.json" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/WeChatMsg.iml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/WeChatMsg.iml" afterDir="false" />
<list default="true" id="84e65474-7da9-466d-baf3-cc88dde3ffdd" name="变更" comment="添加资源文件">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/DataBase/output_pc.py" beforeDir="false" afterPath="$PROJECT_DIR$/app/DataBase/output_pc.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/data/icons/404.png" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/app/data/icons/analysis.svg" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/app/data/icons/annual_report.svg" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/app/data/icons/back.svg" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/app/data/icons/chat.svg" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/app/data/icons/contact.svg" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/app/data/icons/csv.svg" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/app/data/icons/default_avatar.svg" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/app/data/icons/emotion.svg" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/app/data/icons/html.svg" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/app/data/icons/loading.svg" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/app/data/icons/logo.svg" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/app/data/icons/myinfo.svg" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/app/data/icons/output.svg" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/app/data/icons/search.svg" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/app/data/icons/word.svg" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/app/decrypt/get_wx_info.py" beforeDir="false" afterPath="$PROJECT_DIR$/app/decrypt/get_wx_info.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/person.py" beforeDir="false" afterPath="$PROJECT_DIR$/app/person.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/ui_pc/Icon.py" beforeDir="false" afterPath="$PROJECT_DIR$/app/ui_pc/Icon.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/DataBase/hard_link.py" beforeDir="false" afterPath="$PROJECT_DIR$/app/DataBase/hard_link.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/components/bubble_message.py" beforeDir="false" afterPath="$PROJECT_DIR$/app/components/bubble_message.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/decrypt/dat2pic.py" beforeDir="false" afterPath="$PROJECT_DIR$/app/decrypt/dat2pic.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/ui_pc/chat/chat_window.py" beforeDir="false" afterPath="$PROJECT_DIR$/app/ui_pc/chat/chat_window.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/ui_pc/contact/contactInfo.py" beforeDir="false" afterPath="$PROJECT_DIR$/app/ui_pc/contact/contactInfo.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/ui_pc/contact/contact_window.py" beforeDir="false" afterPath="$PROJECT_DIR$/app/ui_pc/contact/contact_window.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/ui_pc/mainview.py" beforeDir="false" afterPath="$PROJECT_DIR$/app/ui_pc/mainview.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/ui_pc/mainwindow.py" beforeDir="false" afterPath="$PROJECT_DIR$/app/ui_pc/mainwindow.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/ui_pc/mainwindow.ui" beforeDir="false" afterPath="$PROJECT_DIR$/app/ui_pc/mainwindow.ui" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/ui_pc/tool/pc_decrypt/pc_decrypt.py" beforeDir="false" afterPath="$PROJECT_DIR$/app/ui_pc/tool/pc_decrypt/pc_decrypt.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/ui_pc/tool/tool_window.py" beforeDir="false" afterPath="$PROJECT_DIR$/app/ui_pc/tool/tool_window.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/util/path.py" beforeDir="false" afterPath="$PROJECT_DIR$/app/util/path.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/decrypt_window.py" beforeDir="false" afterPath="$PROJECT_DIR$/decrypt_window.py" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -150,7 +121,28 @@
<recent name="D:\Project\PythonProject\WeChatMsg\app\Ui" />
</key>
</component>
<component name="RunManager" selected="Python.main_pc">
<component name="RunManager" selected="Python.dat2pic">
<configuration name="dat2pic" type="PythonConfigurationType" factoryName="Python" temporary="true" nameIsGenerated="true">
<module name="WeChatMsg" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<envs>
<env name="PYTHONUNBUFFERED" value="1" />
</envs>
<option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/app/decrypt" />
<option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/app/decrypt/dat2pic.py" />
<option name="PARAMETERS" value="" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="false" />
<option name="MODULE_MODE" value="false" />
<option name="REDIRECT_INPUT" value="false" />
<option name="INPUT_FILE" value="" />
<method v="2" />
</configuration>
<configuration name="decrypt_window" type="PythonConfigurationType" factoryName="Python" temporary="true" nameIsGenerated="true">
<module name="WeChatMsg" />
<option name="INTERPRETER_OPTIONS" value="" />
@ -193,27 +185,6 @@
<option name="INPUT_FILE" value="" />
<method v="2" />
</configuration>
<configuration name="main" type="PythonConfigurationType" factoryName="Python" temporary="true" nameIsGenerated="true">
<module name="WeChatMsg" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<envs>
<env name="PYTHONUNBUFFERED" value="1" />
</envs>
<option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/main.py" />
<option name="PARAMETERS" value="" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="true" />
<option name="MODULE_MODE" value="false" />
<option name="REDIRECT_INPUT" value="false" />
<option name="INPUT_FILE" value="" />
<method v="2" />
</configuration>
<configuration name="main_pc" type="PythonConfigurationType" factoryName="Python" temporary="true" nameIsGenerated="true">
<module name="WeChatMsg" />
<option name="INTERPRETER_OPTIONS" value="" />
@ -279,11 +250,11 @@
</configuration>
<recent_temporary>
<list>
<item itemvalue="Python.dat2pic" />
<item itemvalue="Python.hard_link" />
<item itemvalue="Python.main_pc" />
<item itemvalue="Python.decrypt_window" />
<item itemvalue="Python.test" />
<item itemvalue="Python.hard_link" />
<item itemvalue="Python.main" />
</list>
</recent_temporary>
</component>
@ -299,13 +270,6 @@
<option name="presentableId" value="Default" />
<updated>1672848140146</updated>
</task>
<task id="LOCAL-00036" summary="重构一些class删除一些不必要的文件">
<created>1698765961025</created>
<option name="number" value="00036" />
<option name="presentableId" value="LOCAL-00036" />
<option name="project" value="LOCAL" />
<updated>1698765961025</updated>
</task>
<task id="LOCAL-00037" summary="用stackedWidget实现导航栏">
<created>1698850498765</created>
<option name="number" value="00037" />
@ -642,7 +606,14 @@
<option name="project" value="LOCAL" />
<updated>1700490633275</updated>
</task>
<option name="localTasksCounter" value="85" />
<task id="LOCAL-00085" summary="添加资源文件">
<created>1700751510244</created>
<option name="number" value="00085" />
<option name="presentableId" value="LOCAL-00085" />
<option name="project" value="LOCAL" />
<updated>1700751510245</updated>
</task>
<option name="localTasksCounter" value="86" />
<servers />
</component>
<component name="UnknownFeatures">
@ -678,7 +649,6 @@
</option>
</component>
<component name="VcsManagerConfiguration">
<MESSAGE value="删除多余的Word文件" />
<MESSAGE value="修复无法查找wxid的bug" />
<MESSAGE value="修改UI" />
<MESSAGE value="新增联系人头像组件" />
@ -703,7 +673,8 @@
<MESSAGE value="修复修改wixd的bug" />
<MESSAGE value="文字消息设置圆角" />
<MESSAGE value="更新wx选择的路径" />
<option name="LAST_COMMIT_MESSAGE" value="更新wx选择的路径" />
<MESSAGE value="添加资源文件" />
<option name="LAST_COMMIT_MESSAGE" value="添加资源文件" />
<option name="OPTIMIZE_IMPORTS_BEFORE_PROJECT_COMMIT" value="true" />
<option name="REFORMAT_BEFORE_PROJECT_COMMIT" value="true" />
</component>

View File

@ -54,6 +54,7 @@ def get_md5_from_xml(content):
def get_image(content, thumb=False):
md5 = get_md5_from_xml(content)
# md5 = 'bc37a58c32cb203ee9ac587b068e5853'
md5 = '41895664fc5a77878e2155fc96209a19'
result = get_image_by_md5(binascii.unhexlify(md5))
if result:
# print(result)

View File

@ -20,7 +20,7 @@ class TextMessage(QLabel):
self.setFont(font)
self.setWordWrap(True)
self.setMaximumWidth(800)
self.setMinimumWidth(100)
# self.setMinimumWidth(100)
self.setMinimumHeight(45)
self.setTextInteractionFlags(Qt.TextSelectableByMouse)
self.setSizePolicy(QSizePolicy.Ignored, QSizePolicy.Ignored)
@ -43,7 +43,8 @@ class TextMessage(QLabel):
)
font_metrics = QFontMetrics(font)
rect = font_metrics.boundingRect(text)
self.setMaximumWidth(rect.width() + 30)
# rect = font_metrics
self.setMaximumWidth(rect.width() + 40)
def paintEvent(self, a0: QtGui.QPaintEvent) -> None:
super(TextMessage, self).paintEvent(a0)

View File

@ -17,8 +17,8 @@ def get_code(file_path):
"""
if os.path.isdir(file_path):
return -1, -1
if file_path[-4:] != ".dat":
return -1, -1
# if file_path[-4:] != ".dat":
# return -1, -1
dat_file = open(file_path, "rb")
dat_read = dat_file.read(2)
# print(dat_read)
@ -29,9 +29,9 @@ def get_code(file_path):
code = dat_read[0] ^ pic_head[head_index]
idf_code = dat_read[1] ^ code
head_index = head_index + 1
if idf_code == pic_head[head_index]:
dat_file.close()
return head_index, code
# if idf_code == pic_head[head_index]:
# dat_file.close()
return head_index, code
head_index = head_index + 1
dat_file.close()
print("not jpg, png, gif")
@ -82,7 +82,7 @@ def find_datfile(dir_path, out_path):
if __name__ == "__main__":
path = r"D:\download\wechat\WeChat Files\wxid_0o18ef858vnu22\FileStorage\MsgAttach\febd8caf62dd403a7212aef63fd55910\Thumb\2023-11"
path = "E:\86390\Documents\WeChat Files\wxid_27hqbq7vx5hf22\FileStorage\CustomEmotion\\71\\"
outpath = "D:\\test"
if not os.path.exists(outpath):
os.mkdir(outpath)

View File

@ -70,12 +70,12 @@ class ChatWindow(QWidget, Ui_Form):
self.stackedWidget.setCurrentIndex(0)
def show_chats(self):
print('chat0')
if self.ok_flag:
return
micro_msg.init_database()
if not micro_msg.is_database_exist():
QMessageBox.critical(self, "错误", "数据库不存在\n请先解密数据库")
self.load_finish_signal.emit(True)
return
self.show_thread = ShowContactThread()
self.show_thread.showSingal.connect(self.show_chat)

View File

@ -75,6 +75,7 @@ class ContactWindow(QWidget, Ui_Form):
micro_msg.init_database()
if not micro_msg.is_database_exist():
QMessageBox.critical(self, "错误", "数据库不存在\n请先解密数据库")
self.load_finish_signal.emit(True)
return
self.show_thread = ShowContactThread()
self.show_thread.showSingal.connect(self.show_contact)

BIN
doc/images/html_message.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB