Skip to content

Commit

Permalink
Merge pull request #264 from jchanvfx/replace_toTuple_getRgb_#262
Browse files Browse the repository at this point in the history
replace toTuple() with getRgb() method on QColor #262
  • Loading branch information
jchanvfx authored May 28, 2022
2 parents 370abf4 + a2e93c8 commit 227594c
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions NodeGraphQt/widgets/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ class BaseMenu(QtWidgets.QMenu):

def __init__(self, *args, **kwargs):
super(BaseMenu, self).__init__(*args, **kwargs)
text_color = self.palette().text().color().toTuple()
selected_color = self.palette().highlight().color().toTuple()
text_color = self.palette().text().color().getRgb()
selected_color = self.palette().highlight().color().getRgb()
style_dict = {
'QMenu': {
'color': 'rgb({0},{1},{2})'.format(*text_color),
Expand Down
4 changes: 2 additions & 2 deletions NodeGraphQt/widgets/node_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ def __init__(self, parent=None):
super(NodeGraphWidget, self).__init__(parent)
self.setTabsClosable(True)
self.setTabBarAutoHide(True)
text_color = self.palette().text().color().toTuple()
text_color = self.palette().text().color().getRgb()
bg_color = QtGui.QColor(
*ViewerEnum.BACKGROUND_COLOR.value).darker(120).toTuple()
*ViewerEnum.BACKGROUND_COLOR.value).darker(120).getRgb()
style_dict = {
'QWidget': {
'background-color': 'rgb({0},{1},{2})'.format(
Expand Down
8 changes: 4 additions & 4 deletions NodeGraphQt/widgets/node_widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def setTitle(self, text):
super(_NodeGroupBox, self).setTitle(text)

def setTitleAlign(self, align='center'):
text_color = self.palette().text().color().toTuple()
text_color = self.palette().text().color().getRgb()
style_dict = {
'QGroupBox': {
'background-color': 'rgba(0, 0, 0, 0)',
Expand Down Expand Up @@ -322,9 +322,9 @@ class NodeLineEdit(NodeBaseWidget):
def __init__(self, parent=None, name='', label='', text=''):
super(NodeLineEdit, self).__init__(parent, name, label)
plt = self.palette()
bg_color = plt.alternateBase().color().toTuple()
text_color = plt.text().color().toTuple()
text_sel_color = plt.highlightedText().color().toTuple()
bg_color = plt.alternateBase().color().getRgb()
text_color = plt.text().color().getRgb()
text_sel_color = plt.highlightedText().color().getRgb()
style_dict = {
'QLineEdit': {
'background': 'rgba({0},{1},{2},20)'.format(*bg_color),
Expand Down
8 changes: 4 additions & 4 deletions NodeGraphQt/widgets/tab_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ def __init__(self, parent=None):
super(TabSearchLineEditWidget, self).__init__(parent)
self.setAttribute(QtCore.Qt.WA_MacShowFocusRect, 0)
self.setMinimumSize(200, 22)
text_color = self.palette().text().color().toTuple()
selected_color = self.palette().highlight().color().toTuple()
text_color = self.palette().text().color().getRgb()
selected_color = self.palette().highlight().color().getRgb()
style_dict = {
'QLineEdit': {
'color': 'rgb({0},{1},{2})'.format(*text_color),
Expand Down Expand Up @@ -108,8 +108,8 @@ def __init__(self, node_dict=None):
search_widget.setDefaultWidget(self.line_edit)
self.addAction(search_widget)

text_color = self.palette().text().color().toTuple()
selected_color = self.palette().highlight().color().toTuple()
text_color = self.palette().text().color().getRgb()
selected_color = self.palette().highlight().color().getRgb()
style_dict = {
'QMenu': {
'color': 'rgb({0},{1},{2})'.format(*text_color),
Expand Down

0 comments on commit 227594c

Please sign in to comment.