本文整理汇总了Python中glue.app.qt.preferences.PreferencesDialog.data_color方法的典型用法代码示例。如果您正苦于以下问题:Python PreferencesDialog.data_color方法的具体用法?Python PreferencesDialog.data_color怎么用?Python PreferencesDialog.data_color使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类glue.app.qt.preferences.PreferencesDialog
的用法示例。
在下文中一共展示了PreferencesDialog.data_color方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_custom_changes
# 需要导入模块: from glue.app.qt.preferences import PreferencesDialog [as 别名]
# 或者: from glue.app.qt.preferences.PreferencesDialog import data_color [as 别名]
def test_custom_changes(self):
# Check that themes work
with patch('glue.config.settings') as settings:
settings.FOREGROUND_COLOR = 'red'
settings.BACKGROUND_COLOR = (0, 0.5, 1)
settings.DATA_COLOR = (1, 0.5, 0.25)
settings.DATA_ALPHA = 0.3
dialog = PreferencesDialog(self.app)
dialog.show()
dialog.foreground = (0, 1, 1)
dialog.accept()
assert rgb(settings.FOREGROUND_COLOR) == (0, 1, 1)
assert rgb(settings.BACKGROUND_COLOR) == (0, 0.5, 1)
assert rgb(settings.DATA_COLOR) == (1, 0.5, 0.25)
assert settings.DATA_ALPHA == 0.3
dialog = PreferencesDialog(self.app)
dialog.show()
dialog.background = (1, 0, 1)
dialog.accept()
assert rgb(settings.FOREGROUND_COLOR) == (0, 1, 1)
assert rgb(settings.BACKGROUND_COLOR) == (1, 0, 1)
assert rgb(settings.DATA_COLOR) == (1, 0.5, 0.25)
assert settings.DATA_ALPHA == 0.3
dialog = PreferencesDialog(self.app)
dialog.show()
dialog.data_color = (1, 1, 0.5)
dialog.accept()
assert rgb(settings.FOREGROUND_COLOR) == (0, 1, 1)
assert rgb(settings.BACKGROUND_COLOR) == (1, 0, 1)
assert rgb(settings.DATA_COLOR) == (1, 1, 0.5)
assert settings.DATA_ALPHA == 0.3
dialog = PreferencesDialog(self.app)
dialog.show()
dialog.data_alpha = 0.4
dialog.accept()
assert rgb(settings.FOREGROUND_COLOR) == (0, 1, 1)
assert rgb(settings.BACKGROUND_COLOR) == (1, 0, 1)
assert rgb(settings.DATA_COLOR) == (1, 1, 0.5)
assert settings.DATA_ALPHA == 0.4