Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Color picker: Never use native dialog #2425

Merged
merged 2 commits into from
Dec 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/windows/views/blender_listview.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,9 @@ def dropdown_index_changed(self, widget, param, index):
log.info('New value of param: %s' % value)

def color_button_clicked(self, widget, param, index):
# Get translation object
_ = get_app()._tr

# Show color dialog
log.info('Animation param being changed: %s' % param["name"])
color_value = self.params[param["name"]]
Expand All @@ -227,7 +230,8 @@ def color_button_clicked(self, widget, param, index):
if len(color_value) == 3:
#currentColor = QColor(color_value[0], color_value[1], color_value[2])
currentColor.setRgbF(color_value[0], color_value[1], color_value[2])
newColor = QColorDialog.getColor(currentColor)
newColor = QColorDialog.getColor(currentColor, self, _("Select a Color"),
QColorDialog.DontUseNativeDialog)
if newColor.isValid():
widget.setStyleSheet("background-color: {}".format(newColor.name()))
self.params[param["name"]] = [newColor.redF(), newColor.greenF(), newColor.blueF()]
Expand Down
9 changes: 7 additions & 2 deletions src/windows/views/properties_tableview.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,10 @@ def mouseReleaseEvent(self, event):

def doubleClickedCB(self, model_index):
"""Double click handler for the property table"""

# Get translation object
_ = get_app()._tr

# Get data model and selection
model = self.clip_properties_model.model

Expand All @@ -291,7 +295,8 @@ def doubleClickedCB(self, model_index):

# Show color dialog
currentColor = QColor(red, green, blue)
newColor = QColorDialog.getColor(currentColor)
newColor = QColorDialog.getColor(currentColor, self, _("Select a Color"),
QColorDialog.DontUseNativeDialog)

# Set the new color keyframe
self.clip_properties_model.color_update(self.selected_item, newColor)
Expand Down Expand Up @@ -737,4 +742,4 @@ def __init__(self, *args):
self.setLayout(hbox)

# Connect signals
get_app().window.propertyTableView.loadProperties.connect(self.select_item)
get_app().window.propertyTableView.loadProperties.connect(self.select_item)