Skip to content
This repository was archived by the owner on Mar 31, 2020. It is now read-only.

Commit 3a8e6ac

Browse files
committed
Widget confi files
1 parent bcb5271 commit 3a8e6ac

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed

src/widget.py

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,14 @@
55
parser = ConfigParser()
66
parser.read(THEME)
77

8+
primary = parser['primary']
9+
secondary = parser['secondary']
10+
base = parser['base']
11+
812

913
class SecondaryFrame(tk.Frame):
1014
DEFAULT = {
11-
'bg': 'gray'
15+
**base, **secondary,
1216
}
1317

1418
def __init__(self, *args, **kwds):
@@ -19,6 +23,7 @@ def __init__(self, *args, **kwds):
1923

2024
class SecondaryButton(tk.Button):
2125
DEFAULT = {
26+
**base, **secondary,
2227
'height': 1,
2328
'width': 10
2429
}
@@ -31,9 +36,9 @@ def __init__(self, *args, **kwds):
3136

3237
class SecondaryLabel(tk.Label):
3338
DEFAULT = {
39+
**base, **secondary,
3440
'justify': 'left',
3541
'width': 10,
36-
'bg': 'gray'
3742
}
3843

3944
def __init__(self, *args, **kwds):
@@ -43,7 +48,9 @@ def __init__(self, *args, **kwds):
4348

4449

4550
class SecondaryCanvas(tk.Canvas):
46-
DEFAULT = {}
51+
DEFAULT = {
52+
**base, **secondary,
53+
}
4754

4855
def __init__(self, *args, **kwds):
4956
super().__init__(*args, **{**self.DEFAULT, **kwds})
@@ -53,7 +60,7 @@ def __init__(self, *args, **kwds):
5360

5461
class PrimaryFrame(tk.Frame):
5562
DEFAULT = {
56-
'bg': 'black'
63+
**base, **primary
5764
}
5865

5966
def __init__(self, *args, **kwds):
@@ -64,8 +71,8 @@ def __init__(self, *args, **kwds):
6471

6572
class PrimaryButton(tk.Button):
6673
DEFAULT = {
67-
'height': 3,
68-
'width': 10
74+
**base, **primary,
75+
'height': 3, 'width': 10
6976
}
7077

7178
def __init__(self, *args, **kwds):
@@ -76,9 +83,8 @@ def __init__(self, *args, **kwds):
7683

7784
class PrimaryLabel(tk.Label):
7885
DEFAULT = {
86+
**base, **primary,
7987
'font': ('Courier', 25),
80-
'bg': 'black',
81-
'fg': 'gray'
8288
}
8389

8490
def __init__(self, *args, **kwds):
@@ -89,7 +95,7 @@ def __init__(self, *args, **kwds):
8995

9096
class PrimaryCanvas(tk.Canvas):
9197
DEFAULT = {
92-
'bg': 'black'
98+
**base, **primary,
9399
}
94100

95101
def __init__(self, *args, **kwds):
@@ -100,7 +106,7 @@ def __init__(self, *args, **kwds):
100106

101107
class PrimaryCheckbutton(tk.Checkbutton):
102108
DEFAULT = {
103-
'bg': 'black'
109+
**base, **primary,
104110
}
105111
img = IMAGES / 'checkbox.png'
106112

0 commit comments

Comments
 (0)