Skip to content

Commit

Permalink
Don't use the sizegrip widget on macs
Browse files Browse the repository at this point in the history
  • Loading branch information
TeamSpen210 committed Nov 7, 2015
1 parent 6a9499e commit 7b60536
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 12 deletions.
16 changes: 9 additions & 7 deletions src/StyleVarPane.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,10 +249,12 @@ def make_pane(tool_frame):
UI['style_can'].config(
scrollregion=UI['style_can'].bbox(ALL),
width=canvas_frame.winfo_reqwidth(),
)
ttk.Sizegrip(
window,
cursor=utils.CURSORS['stretch_vert'],
)

if utils.USE_SIZEGRIP:
ttk.Sizegrip(
window,
cursor=utils.CURSORS['stretch_vert'],
).grid(row=1, column=0)

UI['style_can'].bind('<Configure>', flow_stylevar)
Expand All @@ -262,13 +264,13 @@ def make_pane(tool_frame):
window.bind(
"<MouseWheel>",
lambda e: scroll(int(-1*(e.delta/120))),
)
)
elif utils.MAC:
window.bind(
"<Button-4>",
lambda e: scroll(1),
)
)
window.bind(
"<Button-5>",
lambda e: scroll(-1),
)
)
12 changes: 7 additions & 5 deletions src/UI.py
Original file line number Diff line number Diff line change
Expand Up @@ -1104,7 +1104,8 @@ def set_pal_listbox(_=None):
UI['pal_remove'] = ttk.Button(f, text='Delete Palette', command=pal_remove)
UI['pal_remove'].grid(row=2, sticky="EW")

ttk.Sizegrip(f).grid(row=2, column=1)
if utils.USE_SIZEGRIP:
ttk.Sizegrip(f).grid(row=2, column=1)


def init_option(f):
Expand Down Expand Up @@ -1213,15 +1214,16 @@ def configure_voice():
elev_win.widget(props).grid(row=5, column=1, sticky='EW')
voice_win.widget(voice_frame).grid(row=0, column=1, sticky='EW')

ttk.Sizegrip(
props,
cursor=utils.CURSORS['stretch_horiz'],
if utils.USE_SIZEGRIP:
ttk.Sizegrip(
props,
cursor=utils.CURSORS['stretch_horiz'],
).grid(
row=2,
column=5,
rowspan=2,
sticky="NS",
)
)


def flow_preview():
Expand Down
2 changes: 2 additions & 0 deletions src/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,8 @@ def bind_rightclick(wid, func):
"""Other systems just bind directly."""
wid.bind(EVENTS['RIGHT'], func)

USE_SIZEGRIP = not MAC # On Mac, we don't want to use the sizegrip widget

BOOL_LOOKUP = {
'1': True,
'0': False,
Expand Down

0 comments on commit 7b60536

Please sign in to comment.