Skip to content

Commit

Permalink
修改文本消息宽度
Browse files Browse the repository at this point in the history
  • Loading branch information
LC044 committed Nov 24, 2023
1 parent e61f092 commit b732481
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 65 deletions.
83 changes: 27 additions & 56 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions app/DataBase/hard_link.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 3 additions & 2 deletions app/components/bubble_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def __init__(self, text, is_send=False, parent=None):
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)
Expand All @@ -43,7 +43,8 @@ def __init__(self, text, is_send=False, parent=None):
)
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)
Expand Down
12 changes: 6 additions & 6 deletions app/decrypt/dat2pic.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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")
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion app/ui_pc/chat/chat_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,12 @@ def init_ui(self):
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)
Expand Down
1 change: 1 addition & 0 deletions app/ui_pc/contact/contact_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ def show_contacts(self):
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)
Expand Down
Binary file added doc/images/html_message.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit b732481

Please sign in to comment.