Skip to content

Commit

Permalink
typo: docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
Guts committed Jul 26, 2024
1 parent c100f7c commit 83fd64e
Showing 1 changed file with 29 additions and 16 deletions.
45 changes: 29 additions & 16 deletions qtribu/gui/dlg_emoji_picker.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
#! python3 # noqa: E265

"""A minimalist emoji picker using PyQt.
Inspirations:
- https://github.com/Svxy/mint-emojis/ (Apache 2.0)
"""

# standard
import json
import typing
Expand Down Expand Up @@ -94,11 +104,11 @@ def __init__(
def setupUi(self, Form):
Form.setObjectName("Form")
Form.resize(400, 300)
sizePolicy = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(Form.sizePolicy().hasHeightForWidth())
Form.setSizePolicy(sizePolicy)
size_policy = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred)
size_policy.setHorizontalStretch(0)
size_policy.setVerticalStretch(0)
size_policy.setHeightForWidth(Form.sizePolicy().hasHeightForWidth())
Form.setSizePolicy(size_policy)
self.verticalLayout = QVBoxLayout(Form)
self.verticalLayout.setObjectName("verticalLayout")
self.search_line_edit = QLineEdit(Form)
Expand All @@ -117,27 +127,27 @@ def setupUi(self, Form):
self.emoji_information_hlayout = QHBoxLayout()
self.emoji_information_hlayout.setObjectName("emoji_information_hlayout")
self.emoji_image_label = QLabel(Form)
sizePolicy = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(
size_policy = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Fixed)
size_policy.setHorizontalStretch(0)
size_policy.setVerticalStretch(0)
size_policy.setHeightForWidth(
self.emoji_image_label.sizePolicy().hasHeightForWidth()
)
self.emoji_image_label.setSizePolicy(sizePolicy)
self.emoji_image_label.setSizePolicy(size_policy)
font = QtGui.QFont()
font.setPointSize(22)
self.emoji_image_label.setFont(font)
self.emoji_image_label.setText("")
self.emoji_image_label.setObjectName("emoji_image_label")
self.emoji_information_hlayout.addWidget(self.emoji_image_label)
self.emoji_name_label = QLabel(Form)
sizePolicy = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(
size_policy = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed)
size_policy.setHorizontalStretch(0)
size_policy.setVerticalStretch(0)
size_policy.setHeightForWidth(
self.emoji_name_label.sizePolicy().hasHeightForWidth()
)
self.emoji_name_label.setSizePolicy(sizePolicy)
self.emoji_name_label.setSizePolicy(size_policy)
font = QtGui.QFont()
font.setPointSize(10)
self.emoji_name_label.setFont(font)
Expand Down Expand Up @@ -274,6 +284,9 @@ def leaveEvent(self, a0: QtCore.QEvent) -> None:
self.parent_emoji_picker.emoji_name_label.setText("")

def on_click(self):
"""Gets called if the button is pressed. Closes the emoji picker and if it was called via `QEmojiPicker.select()` the current button emoji will be returned"""
"""Gets called if the button is pressed. Closes the emoji picker and if it
was called via `QEmojiPicker.select()` the current button emoji will be
returned.
"""
self.parent_emoji_picker.selected_emoji = self.text()
self.parent_emoji_picker.close()

0 comments on commit 83fd64e

Please sign in to comment.