Skip to content

Commit

Permalink
Rename reusable components for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
jake158 committed Apr 5, 2024
1 parent 02d1c1d commit fdee998
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pomodorodiscord/src/frames/settings_frame.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import os
import customtkinter as ctk
from src.reusable.entry_frame import EntryFrame
from src.reusable.settings_reusable import EntryFrame
from src.utils import load_config, save_config, reload_app, beep, DEF_POMODORO_MINS, DEF_SB_MINS, DEF_LB_MINS, DEF_SB_BEFORE_L


Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,17 +1,27 @@
import customtkinter as ctk


class StatisticDisplay(ctk.CTkFrame):
class StatisticFrame(ctk.CTkFrame):
def __init__(self, master, title, initial_value="0", title_font=18, val_font=24, **kwargs):
super().__init__(master, **kwargs)
self.pack(pady=(10, 15), fill="x")

self.title_label = ctk.CTkLabel(self, text=title, font=("Helvetica", title_font), anchor="n")
self.title_label.pack(fill="x")

self.value_var = ctk.StringVar(value=initial_value)
self.value_label = ctk.CTkLabel(self, textvariable=self.value_var, font=("Helvetica", val_font), anchor="center")
self.value_label.pack(pady=(5, 0), fill="x")

def set_value(self, value):
self.value_var.set(value)


class ButtonFrame(ctk.CTkFrame):
def __init__(self, master, title, btntext, callback, **kwargs):
super().__init__(master, **kwargs)
self.pack()
self.label = ctk.CTkLabel(self, text=title, font=("Helvetica", 18))
self.label.pack(pady=(20, 8))
self.button = ctk.CTkButton(self, text=btntext, width=90, font=("Roboto", 16), command=callback)
self.button.pack()

0 comments on commit fdee998

Please sign in to comment.