From c97fb6b467c5822d8cd50e34d8f47827b5eb641f Mon Sep 17 00:00:00 2001 From: ingvar1995 Date: Thu, 24 May 2018 15:20:21 +0300 Subject: [PATCH] minor stickers and smileys window fixes --- toxygen/smileys/smileys.py | 2 +- toxygen/stickers/stickers.py | 4 ++-- toxygen/ui/main_screen.py | 4 ++-- toxygen/ui/widgets_factory.py | 6 ------ 4 files changed, 5 insertions(+), 11 deletions(-) diff --git a/toxygen/smileys/smileys.py b/toxygen/smileys/smileys.py index 9027bcb..0391856 100644 --- a/toxygen/smileys/smileys.py +++ b/toxygen/smileys/smileys.py @@ -34,7 +34,7 @@ class SmileyLoader: print('Smiley pack {} loaded'.format(pack_name)) keys, values, self._list = [], [], [] for key, value in tmp.items(): - value = self.get_smileys_path() + value + value = util.join_path(self.get_smileys_path(), value) if value not in values: keys.append(key) values.append(value) diff --git a/toxygen/stickers/stickers.py b/toxygen/stickers/stickers.py index a406b6c..14142c7 100644 --- a/toxygen/stickers/stickers.py +++ b/toxygen/stickers/stickers.py @@ -10,9 +10,9 @@ def load_stickers(): d = util.get_stickers_directory() keys = [x[1] for x in os.walk(d)][0] for key in keys: - path = d + key + '/' + path = util.join_path(d, key) files = filter(lambda f: f.endswith('.png'), os.listdir(path)) - files = map(lambda f: str(path + f), files) + files = map(lambda f: util.join_path(path, f), files) result.extend(files) return result diff --git a/toxygen/ui/main_screen.py b/toxygen/ui/main_screen.py index d39cc91..415d8a5 100644 --- a/toxygen/ui/main_screen.py +++ b/toxygen/ui/main_screen.py @@ -570,8 +570,8 @@ class MainWindow(QtWidgets.QMainWindow): self.menu.hide() if self._contacts_manager.get_curr_contact() is not None: self.smiley = self._widget_factory.create_smiley_window(self) - self.smiley.setGeometry(QtCore.QRect(self.x() if self._settings['mirror_mode'] else 270 + self.x(), - self.y() + self.height() - 200, + self.smiley.setGeometry(QtCore.QRect(self.x() if self._settings['mirror_mode'] else 200 + self.x(), + self.y() + self.height() - 400, self.smiley.width(), self.smiley.height())) self.smiley.show() diff --git a/toxygen/ui/widgets_factory.py b/toxygen/ui/widgets_factory.py index 4c4f1c6..68583d6 100644 --- a/toxygen/ui/widgets_factory.py +++ b/toxygen/ui/widgets_factory.py @@ -22,9 +22,6 @@ class WidgetsFactory: def create_screenshot_window(self, *args): return ScreenShotWindow(self._file_transfer_handler, self._contacts_manager, *args) - def create_smiley_window(self, parent): - return SmileyWindow(parent, self._smiley_loader) - def create_welcome_window(self): return WelcomeScreen(self._settings) @@ -49,9 +46,6 @@ class WidgetsFactory: def create_add_contact_window(self, tox_id): return AddContact(self._settings, self._contacts_manager, tox_id) - def create_welcome_window(self): - return WelcomeScreen(self._settings) - def create_privacy_settings_window(self): return PrivacySettings(self._contacts_manager, self._settings)