Skip to content
Snippets Groups Projects
Commit ef674336 authored by Tobias Schmidt's avatar Tobias Schmidt
Browse files

fix "carbons only" button in gui (fixes BZDNG-366)

parent 9a85f610
Branches
Tags
No related merge requests found
......@@ -146,7 +146,10 @@ class ByElementWidget(QtGui.QWidget):
def ChangeViewColor(self, entity, view):
if isinstance(entity, gfx.Entity) and isinstance(view, mol.EntityView):
beco=gfx.ByElementColorOp(mol.QueryViewWrapper(view))
if self.parent_.GetCarbonsOnly():
beco=gfx.ByElementColorOp(mol.QueryViewWrapper(mol.Query("ele=C"), view))
else:
beco=gfx.ByElementColorOp(mol.QueryViewWrapper(view))
entity.Apply(beco)
def GetText(self):
......@@ -185,7 +188,10 @@ class ByChainWidget(QtGui.QWidget):
def ChangeViewColor(self, entity, view):
if isinstance(entity, gfx.Entity) and isinstance(view, mol.EntityView):
bco=gfx.ByChainColorOp(mol.QueryViewWrapper(view))
if self.parent_.GetCarbonsOnly():
bco=gfx.ByChainColorOp(mol.QueryViewWrapper(mol.Query("ele=C"),view))
else:
bco=gfx.ByChainColorOp(mol.QueryViewWrapper(view))
entity.Apply(bco)
def GetText(self):
......@@ -234,7 +240,10 @@ class ByEntityWidget(QtGui.QWidget):
def ChangeViewColor(self, entity, view):
if isinstance(entity, gfx.Entity) and isinstance(view, mol.EntityView):
bco=gfx.ByChainColorOp(mol.QueryViewWrapper(view))
if self.parent_.GetCarbonsOnly():
bco=gfx.ByChainColorOp(mol.QueryViewWrapper(mol.Query("ele=C"),view))
else:
bco=gfx.ByChainColorOp(mol.QueryViewWrapper(view))
entity.Apply(bco)
def GetText(self):
......
......@@ -90,7 +90,10 @@ class GradientEditor(QtGui.QWidget):
def ChangeViewColor(self, entity, view):
if isinstance(entity, gfx.Entity) and isinstance(view, mol.EntityView):
glco=gfx.GradientLevelColorOp(mol.QueryViewWrapper(view),self.props[self.prop_combo_box_.currentIndex()],self.gradient_edit_.GetGfxGradient(),mol.Prop.Level.UNSPECIFIED)
if self.parent_.GetCarbonsOnly():
glco=gfx.GradientLevelColorOp(mol.QueryViewWrapper(mol.Query("ele=C"),view),self.props[self.prop_combo_box_.currentIndex()],self.gradient_edit_.GetGfxGradient(),mol.Prop.Level.UNSPECIFIED)
else:
glco=gfx.GradientLevelColorOp(mol.QueryViewWrapper(view),self.props[self.prop_combo_box_.currentIndex()],self.gradient_edit_.GetGfxGradient(),mol.Prop.Level.UNSPECIFIED)
entity.Apply(glco)
#Gradient Preview
......
......@@ -97,7 +97,10 @@ class UniformColorWidget(QtGui.QWidget):
def ChangeViewColor(self, entity, view):
if isinstance(entity, gfx.Entity) and isinstance(view, mol.EntityView):
gfx_color = self.color_select_widget_.GetGfxColor()
ufco=gfx.UniformColorOp(mol.QueryViewWrapper(view),gfx_color)
if self.parent_.GetCarbonsOnly():
ufco=gfx.UniformColorOp(mol.QueryViewWrapper(mol.Query("ele=C"), view),gfx_color)
else:
ufco=gfx.UniformColorOp(mol.QueryViewWrapper(view),gfx_color)
entity.Apply(ufco)
def resizeEvent(self, event):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment