Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Commit

Permalink
Merge pull request #2359 from pypeclub/bugfix/placeholder_color_fix
Browse files Browse the repository at this point in the history
Tools: Placeholder color
  • Loading branch information
iLLiCiTiT authored Dec 2, 2021
2 parents ff20e3a + 611c9bb commit af6fa09
Show file tree
Hide file tree
Showing 13 changed files with 42 additions and 18 deletions.
7 changes: 5 additions & 2 deletions openpype/tools/loader/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
from avalon import api, io, pipeline

from openpype import style
from openpype.tools.utils import lib
from openpype.tools.utils import (
lib,
PlaceholderLineEdit
)
from openpype.tools.utils.assets_widget import MultiSelectAssetsWidget

from .widgets import (
Expand Down Expand Up @@ -517,7 +520,7 @@ def __init__(self, items, groups_config, parent=None):
self.subsets = parent._subsets_widget
self.asset_ids = parent.data["state"]["assetIds"]

name = QtWidgets.QLineEdit()
name = PlaceholderLineEdit(self)
name.setPlaceholderText("Remain blank to ungroup..")

# Menu for pre-defined subset groups
Expand Down
3 changes: 2 additions & 1 deletion openpype/tools/project_manager/project_manager/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
PROJECT_NAME_REGEX
)
from openpype.style import load_stylesheet
from openpype.tools.utils import PlaceholderLineEdit
from avalon.api import AvalonMongoDB

from Qt import QtWidgets, QtCore
Expand Down Expand Up @@ -345,7 +346,7 @@ def __init__(self, project_name, parent):

question_label = QtWidgets.QLabel("<b>Are you sure?</b>", self)

confirm_input = QtWidgets.QLineEdit(self)
confirm_input = PlaceholderLineEdit(self)
confirm_input.setPlaceholderText("Type \"Delete\" to confirm...")

cancel_btn = _SameSizeBtns("Cancel", self)
Expand Down
5 changes: 3 additions & 2 deletions openpype/tools/publisher/widgets/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

from openpype.widgets.attribute_defs import create_widget_for_attr_def
from openpype.tools.flickcharm import FlickCharm
from openpype.tools.utils import PlaceholderLineEdit
from openpype.pipeline.create import SUBSET_NAME_ALLOWED_SYMBOLS
from .models import (
AssetsHierarchyModel,
Expand Down Expand Up @@ -396,7 +397,7 @@ def __init__(self, controller, parent):
proxy_model.setSourceModel(model)
proxy_model.setFilterCaseSensitivity(QtCore.Qt.CaseInsensitive)

filter_input = QtWidgets.QLineEdit(self)
filter_input = PlaceholderLineEdit(self)
filter_input.setPlaceholderText("Filter assets..")

asset_view = QtWidgets.QTreeView(self)
Expand Down Expand Up @@ -934,7 +935,7 @@ def reset_to_origin(self):
self.set_selected_items(self._origin_value)


class VariantInputWidget(QtWidgets.QLineEdit):
class VariantInputWidget(PlaceholderLineEdit):
"""Input widget for variant."""
value_changed = QtCore.Signal()

Expand Down
4 changes: 2 additions & 2 deletions openpype/tools/publisher/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
resources,
style
)

from openpype.tools.utils import PlaceholderLineEdit
from .control import PublisherController
from .widgets import (
BorderedLabelWidget,
Expand Down Expand Up @@ -131,7 +131,7 @@ def __init__(self, parent=None):
subset_content_layout.addWidget(subset_attributes_wrap, 7)

# Footer
comment_input = QtWidgets.QLineEdit(subset_frame)
comment_input = PlaceholderLineEdit(subset_frame)
comment_input.setObjectName("PublishCommentInput")
comment_input.setPlaceholderText(
"Attach a comment to your publish"
Expand Down
3 changes: 2 additions & 1 deletion openpype/tools/settings/local_settings/apps_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
ExpandingWidget
)
from openpype.tools.settings import CHILD_OFFSET
from openpype.tools.utils import PlaceholderLineEdit


class AppVariantWidget(QtWidgets.QWidget):
Expand Down Expand Up @@ -45,7 +46,7 @@ def __init__(self, group_label, variant_name, variant_entity, parent):
content_layout.addWidget(warn_label)
return

executable_input_widget = QtWidgets.QLineEdit(content_widget)
executable_input_widget = PlaceholderLineEdit(content_widget)
executable_input_widget.setPlaceholderText(self.exec_placeholder)
content_layout.addWidget(executable_input_widget)

Expand Down
3 changes: 2 additions & 1 deletion openpype/tools/settings/local_settings/general_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from Qt import QtWidgets, QtCore
from openpype.lib import is_admin_password_required
from openpype.widgets import PasswordDialog
from openpype.tools.utils import PlaceholderLineEdit


class LocalGeneralWidgets(QtWidgets.QWidget):
Expand All @@ -11,7 +12,7 @@ def __init__(self, parent):

self._loading_local_settings = False

username_input = QtWidgets.QLineEdit(self)
username_input = PlaceholderLineEdit(self)
username_input.setPlaceholderText(getpass.getuser())

is_admin_input = QtWidgets.QCheckBox(self)
Expand Down
3 changes: 2 additions & 1 deletion openpype/tools/settings/local_settings/mongo_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from pymongo.errors import ServerSelectionTimeoutError

from openpype.api import change_openpype_mongo_url
from openpype.tools.utils import PlaceholderLineEdit


class OpenPypeMongoWidget(QtWidgets.QWidget):
Expand All @@ -25,7 +26,7 @@ def __init__(self, parent):
mongo_url_label = QtWidgets.QLabel("OpenPype Mongo URL", self)

# Input
mongo_url_input = QtWidgets.QLineEdit(self)
mongo_url_input = PlaceholderLineEdit(self)
mongo_url_input.setPlaceholderText("< OpenPype Mongo URL >")
mongo_url_input.setText(os.environ["OPENPYPE_MONGO"])

Expand Down
3 changes: 2 additions & 1 deletion openpype/tools/settings/local_settings/projects_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import copy
from Qt import QtWidgets, QtCore, QtGui
from openpype.tools.settings.settings import ProjectListWidget
from openpype.tools.utils import PlaceholderLineEdit
from openpype.settings.constants import (
PROJECT_ANATOMY_KEY,
DEFAULT_PROJECT_KEY
Expand Down Expand Up @@ -45,7 +46,7 @@ def __init__(
parent
):
super(DynamicInputItem, self).__init__()
input_widget = QtWidgets.QLineEdit(parent)
input_widget = PlaceholderLineEdit(parent)

settings_value = input_def.get("value")
placeholder = input_def.get("placeholder")
Expand Down
3 changes: 2 additions & 1 deletion openpype/tools/settings/settings/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from openpype.tools.utils.lib import paint_image_with_color

from openpype.widgets.nice_checkbox import NiceCheckbox
from openpype.tools.utils import PlaceholderLineEdit
from openpype.settings.lib import get_system_settings
from .images import (
get_pixmap,
Expand All @@ -24,7 +25,7 @@
)


class SettingsLineEdit(QtWidgets.QLineEdit):
class SettingsLineEdit(PlaceholderLineEdit):
focused_in = QtCore.Signal()

def focusInEvent(self, event):
Expand Down
8 changes: 6 additions & 2 deletions openpype/tools/standalonepublish/widgets/widget_asset.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import contextlib
from Qt import QtWidgets, QtCore
from . import RecursiveSortFilterProxyModel, AssetModel

from openpype.tools.utils import PlaceholderLineEdit

from avalon.vendor import qtawesome
from avalon import style

from . import RecursiveSortFilterProxyModel, AssetModel
from . import TasksTemplateModel, DeselectableTreeView
from . import _iter_model_rows

Expand Down Expand Up @@ -165,7 +169,7 @@ def __init__(self, dbcon, settings, parent=None):
refresh = QtWidgets.QPushButton(icon, "")
refresh.setToolTip("Refresh items")

filter = QtWidgets.QLineEdit()
filter = PlaceholderLineEdit()
filter.textChanged.connect(proxy.setFilterFixedString)
filter.setPlaceholderText("Filter assets..")

Expand Down
3 changes: 2 additions & 1 deletion openpype/tools/subsetmanager/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from avalon.vendor import qtawesome

from openpype import style
from openpype.tools.utils import PlaceholderLineEdit
from openpype.tools.utils.lib import (
iter_model_rows,
qt_app_context
Expand Down Expand Up @@ -44,7 +45,7 @@ def __init__(self, parent=None):
header_widget = QtWidgets.QWidget(left_side_widget)

# Filter input
filter_input = QtWidgets.QLineEdit(header_widget)
filter_input = PlaceholderLineEdit(header_widget)
filter_input.setPlaceholderText("Filter subsets..")

# Refresh button
Expand Down
8 changes: 8 additions & 0 deletions openpype/tools/utils/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from .widgets import (
PlaceholderLineEdit,
)


__all__ = (
"PlaceholderLineEdit",
)
7 changes: 4 additions & 3 deletions openpype/tools/workfiles/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
schedule,
qt_app_context
)
from openpype.tools.utils import PlaceholderLineEdit
from openpype.tools.utils.assets_widget import SingleSelectAssetsWidget
from openpype.tools.utils.tasks_widget import TasksWidget
from openpype.tools.utils.delegates import PrettyTimeDelegate
Expand Down Expand Up @@ -139,7 +140,7 @@ def __init__(self, parent, root, anatomy, template_key, session=None):
preview_label = QtWidgets.QLabel("Preview filename", inputs_widget)

# Subversion input
subversion_input = QtWidgets.QLineEdit(inputs_widget)
subversion_input = PlaceholderLineEdit(inputs_widget)
subversion_input.setPlaceholderText("Will be part of filename.")

# Extensions combobox
Expand Down Expand Up @@ -394,9 +395,9 @@ def __init__(self, parent=None):
files_view.setColumnWidth(0, 330)

# Filtering input
filter_input = QtWidgets.QLineEdit(self)
filter_input.textChanged.connect(proxy_model.setFilterFixedString)
filter_input = PlaceholderLineEdit(self)
filter_input.setPlaceholderText("Filter files..")
filter_input.textChanged.connect(proxy_model.setFilterFixedString)

# Home Page
# Build buttons widget for files widget
Expand Down

0 comments on commit af6fa09

Please sign in to comment.