Skip to content

Commit 1de784d

Browse files
committed
Merge pull request #1169 from chaosphere2112/mac_control_click
Mac control click fixes
2 parents dc3a384 + 3217c7e commit 1de784d

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

Packages/vcs/Lib/editors/marker.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import vtk
66
import vcs.vcs2vtk
77
import priority
8+
import sys
89

910
class MarkerEditor(behaviors.ClickableMixin, behaviors.DraggableMixin, priority.PriorityEditor):
1011
"""
@@ -61,7 +62,8 @@ def __init__(self, interactor, marker, index, display, configurator):
6162
prop.SetBackgroundColor(.87, .79, .55)
6263
prop.SetBackgroundOpacity(1)
6364
prop.SetColor(0, 0, 0)
64-
self.tooltip = vtk_ui.Label(self.interactor, "Ctrl + Click to place new markers.", textproperty=prop)
65+
66+
self.tooltip = vtk_ui.Label(self.interactor, "%s + Click to place new markers." % ("Cmd" if sys.platform == "darwin" else "Ctrl"), textproperty=prop)
6567
self.tooltip.left = 0
6668
self.tooltip.top = self.interactor.GetRenderWindow().GetSize()[1] - self.tooltip.get_dimensions()[1]
6769
self.tooltip.show()
@@ -73,7 +75,7 @@ def get_object(self):
7375

7476
def handle_click(self, point):
7577
x, y = point
76-
# Alt drops a new instance
78+
# Control drops a new instance
7779
return self.in_bounds(x, y) or self.toolbar.in_toolbar(x, y) or self.current_modifiers()["control"]
7880

7981
def is_object(self, marker):
@@ -136,7 +138,6 @@ def cancel_color(self):
136138

137139
def click_release(self):
138140
x, y = self.event_position()
139-
140141
if self.current_modifiers()["control"]:
141142
h = vtk_ui.Handle(self.interactor, (x, y), dragged=self.adjust, color=(0,0,0), normalize=True)
142143
h.show()

Packages/vcs/Lib/editors/text.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import vcs
88
from vcs.vcs2vtk import genTextActor
99
from font import FontEditor
10+
import sys
1011

1112
__valign_map__ = {
1213
0: 0,
@@ -58,7 +59,7 @@ def __init__(self, interactor, text, index, dp, configurator):
5859
prop.SetBackgroundColor(.87, .79, .55)
5960
prop.SetBackgroundOpacity(1)
6061
prop.SetColor(0, 0, 0)
61-
self.tooltip = Label(self.interactor, "Ctrl + Click to place new text.", textproperty=prop)
62+
self.tooltip = Label(self.interactor, "%s + Click to place new text." % ("Cmd" if sys.platform == "darwin" else "Ctrl"), textproperty=prop)
6263
self.tooltip.left = 0
6364
self.tooltip.top = self.interactor.GetRenderWindow().GetSize()[1] - self.tooltip.get_dimensions()[1]
6465
self.tooltip.show()

0 commit comments

Comments
 (0)