-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
72 lines (51 loc) · 1.8 KB
/
Copy pathapp.py
File metadata and controls
72 lines (51 loc) · 1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
import tkinter as tk
from tkinter import ttk
import tkinter.font as font
from view.frames.chat import Chat
COLOUR_LIGHT_BACKGROUND_1 = "#fff"
COLOUR_LIGHT_BACKGROUND_2 = "#f2f3f5"
COLOUR_LIGHT_BACKGROUND_3 = "#e3e5e8"
COLOUR_LIGHT_TEXT = "#aaa"
COLOUR_BUTTON_NORMAL = "#5fba7d"
COLOUR_BUTTON_ACTIVE = "#58c77c"
COLOUR_BUTTON_PRESSED = "#44e378"
class Messenger(tk.Tk):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.geometry("1200x500")
self.minsize(800, 500)
self.columnconfigure(0, weight=1)
self.rowconfigure(0, weight=1)
self.chat_frame = Chat(
self,
background=COLOUR_LIGHT_BACKGROUND_3,
style="Messages.TFrame"
)
self.chat_frame.grid(row=0, column=0, sticky="NSEW")
def main():
root = Messenger()
font.nametofont("TkDefaultFont").configure(size=14)
style = ttk.Style(root)
style.theme_use("clam")
style.configure("Messages.TFrame", background=COLOUR_LIGHT_BACKGROUND_3)
style.configure("Controls.TFrame", background=COLOUR_LIGHT_BACKGROUND_2)
style.configure("SendButton.TButton", borderwidth=0, background=COLOUR_BUTTON_NORMAL)
style.map(
"SendButton.TButton",
background=[("pressed", COLOUR_BUTTON_PRESSED), ("active", COLOUR_BUTTON_ACTIVE)],
)
style.configure(
"SystemButton.TButton", background=COLOUR_LIGHT_BACKGROUND_1, borderwidth=0
)
style.configure(
"Time.TLabel",
padding=5,
background=COLOUR_LIGHT_BACKGROUND_1,
foreground=COLOUR_LIGHT_TEXT,
font=8
)
style.configure("Avatar.TLabel", background=COLOUR_LIGHT_BACKGROUND_3)
style.configure("Message.TLabel", background=COLOUR_LIGHT_BACKGROUND_2)
root.mainloop()
if __name__ == "__main__":
main()