Change color of arrows for overflow menuitem

Change color of arrows for overflow menuitem

csarrazinS7UXX
Explorer Explorer
338 Views
1 Reply
Message 1 of 2

Change color of arrows for overflow menuitem

csarrazinS7UXX
Explorer
Explorer

Hello, is there a way to update the color of the arrows for the overflow menuItem? As you can see in the images provided, the arrows are very hard to see (in the red square).  

 

image.png

image (1).png

0 Likes
Accepted solutions (1)
339 Views
1 Reply
Reply (1)
Message 2 of 2

jmreinhart
Advisor
Advisor
Accepted solution
import maya.OpenMayaUI as omui

try:
  from PySide2.QtCore import *
  from PySide2.QtGui import *
  from PySide2.QtWidgets import *
  from PySide2 import __version__
  from shiboken2 import wrapInstance
except ImportError:
  from PySide.QtCore import *
  from PySide.QtGui import *
  from PySide import __version__
  from shiboken import wrapInstance
  
# Get the main window as a widget
omui.MQtUtil.mainWindow()
ptr = omui.MQtUtil.mainWindow()
mainWindow_widget = wrapInstance(int(ptr), QWidget)
children = mainWindow_widget.findChildren(QWidget)

# Iterate through the list to find the toolbar widget
for child in children:
    if isinstance(child, QToolBar):
        toolbar = child
        break
       
children[1].setStyleSheet("background-color: red;")

 

A bit hacky, but you can get the button using pyside and then set it's background color 🙂