use class name over object name for formatting

This commit is contained in:
Jakub Trllo 2024-08-21 11:29:44 +02:00
parent bf48d9e804
commit 8a9d815278
2 changed files with 15 additions and 10 deletions

View file

@ -740,22 +740,22 @@ OverlayMessageWidget QWidget {
}
/* Hinted Line Edit */
#HintedLineEditInput {
HintedLineEditInput {
border-radius: 0.2em;
border-top-right-radius: 0px;
border-bottom-right-radius: 0px;
border: 1px solid {color:border};
}
#HintedLineEditInput:hover {
HintedLineEditInput:hover {
border-color: {color:border-hover};
}
#HintedLineEditInput:focus{
HintedLineEditInput:focus{
border-color: {color:border-focus};
}
#HintedLineEditInput:disabled {
HintedLineEditInput:disabled {
background: {color:bg-inputs-disabled};
}
#HintedLineEditButton {
HintedLineEditButton {
border: none;
border-radius: 0.2em;
border-bottom-left-radius: 0px;

View file

@ -121,6 +121,14 @@ def get_down_arrow_icon() -> QtGui.QIcon:
return icon
class HintedLineEditInput(PlaceholderLineEdit):
pass
class HintedLineEditButton(QtWidgets.QPushButton):
pass
class HintedLineEdit(QtWidgets.QWidget):
SEPARATORS: Set[str] = {"---", "---separator---"}
returnPressed = QtCore.Signal()
@ -134,11 +142,8 @@ class HintedLineEdit(QtWidgets.QWidget):
):
super().__init__(parent)
text_input = PlaceholderLineEdit(self)
options_button = QtWidgets.QPushButton(self)
text_input.setObjectName("HintedLineEditInput")
options_button.setObjectName("HintedLineEditButton")
text_input = HintedLineEditInput(self)
options_button = HintedLineEditButton(self)
options_button.setIcon(get_down_arrow_icon())
main_layout = QtWidgets.QHBoxLayout(self)