Button color is system default for Mac platform ONLY, otherwise blue

Hated the gray buttons on windows so made the change so only the Mac platform uses the gray buttons
This commit is contained in:
MikeTheWatchGuy 2018-08-28 20:07:17 -04:00
parent f5d86d2fa2
commit 01e7fd65fa
1 changed files with 7 additions and 4 deletions

View File

@ -6,6 +6,7 @@ import tkinter.scrolledtext as tkst
import tkinter.font import tkinter.font
import datetime import datetime
import sys import sys
from sys import platform
import textwrap import textwrap
# ----====----====----==== Constants the user CAN safely change ====----====----====----# # ----====----====----==== Constants the user CAN safely change ====----====----====----#
@ -33,8 +34,10 @@ NICE_BUTTON_COLORS = ((GREENS[3], TANS[0]), ('#000000','#FFFFFF'),('#FFFFFF', '#
(YELLOWS[0], GREENS[3]), (YELLOWS[0], BLUES[2])) (YELLOWS[0], GREENS[3]), (YELLOWS[0], BLUES[2]))
COLOR_SYSTEM_DEFAULT = '1234567890' # Colors should never be this long COLOR_SYSTEM_DEFAULT = '1234567890' # Colors should never be this long
# DEFAULT_BUTTON_COLOR = ('white', BLUES[0]) # Foreground, Background (None, None) == System Default if sys.platform is 'darwin':
DEFAULT_BUTTON_COLOR = COLOR_SYSTEM_DEFAULT # Foreground, Background (None, None) == System Default DEFAULT_BUTTON_COLOR = COLOR_SYSTEM_DEFAULT # Foreground, Background (None, None) == System Default
else:
DEFAULT_BUTTON_COLOR = ('white', BLUES[0]) # Foreground, Background (None, None) == System Default
DEFAULT_ERROR_BUTTON_COLOR =("#FFFFFF", "#FF0000") DEFAULT_ERROR_BUTTON_COLOR =("#FFFFFF", "#FF0000")
DEFAULT_BACKGROUND_COLOR = None DEFAULT_BACKGROUND_COLOR = None
DEFAULT_ELEMENT_BACKGROUND_COLOR = None DEFAULT_ELEMENT_BACKGROUND_COLOR = None
@ -1866,7 +1869,7 @@ def PackFormIntoFrame(form, containing_frame, toplevel_form):
# done with row, pack the row of widgets # done with row, pack the row of widgets
tk_row_frame.grid(row=row_num+2, sticky=tk.NW, padx=DEFAULT_MARGINS[0]) tk_row_frame.grid(row=row_num+2, sticky=tk.NW, padx=DEFAULT_MARGINS[0])
if form.BackgroundColor is not None: if form.BackgroundColor is not None and form.BackgroundColor != COLOR_SYSTEM_DEFAULT:
tk_row_frame.configure(background=form.BackgroundColor) tk_row_frame.configure(background=form.BackgroundColor)
if not toplevel_form.IsTabbedForm: if not toplevel_form.IsTabbedForm:
toplevel_form.TKroot.configure(padx=DEFAULT_MARGINS[0], pady=DEFAULT_MARGINS[1]) toplevel_form.TKroot.configure(padx=DEFAULT_MARGINS[0], pady=DEFAULT_MARGINS[1])
@ -1973,7 +1976,7 @@ def StartupTK(my_flex_form):
ow = _my_windows.NumOpenWindows ow = _my_windows.NumOpenWindows
# print('Starting TK open Windows = {}'.format(ow)) # print('Starting TK open Windows = {}'.format(ow))
root = tk.Tk() if not ow else tk.Toplevel() root = tk.Tk() if not ow else tk.Toplevel()
if my_flex_form.BackgroundColor is not None: if my_flex_form.BackgroundColor is not None and my_flex_form.BackgroundColor != COLOR_SYSTEM_DEFAULT:
root.configure(background=my_flex_form.BackgroundColor) root.configure(background=my_flex_form.BackgroundColor)
_my_windows.Increment() _my_windows.Increment()