Skip to content

Commit

Permalink
release
Browse files Browse the repository at this point in the history
  • Loading branch information
MaybeMaru committed Jun 27, 2023
1 parent 77e4cc2 commit ffd9ec5
Show file tree
Hide file tree
Showing 58 changed files with 10,635 additions and 148 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ name: Upload Release Asset

jobs:
build_windows:
name: Build .exe file
name: Build Windows
runs-on: windows-latest
steps:
- name: Set up Python 3.x
Expand All @@ -19,9 +19,10 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install pyinstaller
pyinstaller main.py --onefile
pip3 install customtkinter
pyinstaller main.py --onedir --noconsole --add-data "customtkinter;customtkinter"
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: windows
path: ./dist/main.exe
path: ./dist/main/
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
__pycache__/
export/
build/
dist/
Binary file modified __pycache__/jsonxml.cpython-310.pyc
Binary file not shown.
Binary file removed __pycache__/main.cpython-310.pyc
Binary file not shown.
82 changes: 82 additions & 0 deletions customtkinter/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
__version__ = "5.2.0"

import os
import sys
from tkinter import Variable, StringVar, IntVar, DoubleVar, BooleanVar
from tkinter.constants import *
import tkinter.filedialog as filedialog

# import manager classes
from .windows.widgets.appearance_mode import AppearanceModeTracker
from .windows.widgets.font import FontManager
from .windows.widgets.scaling import ScalingTracker
from .windows.widgets.theme import ThemeManager
from .windows.widgets.core_rendering import DrawEngine

# import base widgets
from .windows.widgets.core_rendering import CTkCanvas
from .windows.widgets.core_widget_classes import CTkBaseClass

# import widgets
from .windows.widgets import CTkButton
from .windows.widgets import CTkCheckBox
from .windows.widgets import CTkComboBox
from .windows.widgets import CTkEntry
from .windows.widgets import CTkFrame
from .windows.widgets import CTkLabel
from .windows.widgets import CTkOptionMenu
from .windows.widgets import CTkProgressBar
from .windows.widgets import CTkRadioButton
from .windows.widgets import CTkScrollbar
from .windows.widgets import CTkSegmentedButton
from .windows.widgets import CTkSlider
from .windows.widgets import CTkSwitch
from .windows.widgets import CTkTabview
from .windows.widgets import CTkTextbox
from .windows.widgets import CTkScrollableFrame

# import windows
from .windows import CTk
from .windows import CTkToplevel
from .windows import CTkInputDialog

# import font classes
from .windows.widgets.font import CTkFont

# import image classes
from .windows.widgets.image import CTkImage

_ = Variable, StringVar, IntVar, DoubleVar, BooleanVar, CENTER, filedialog # prevent IDE from removing unused imports


def set_appearance_mode(mode_string: str):
""" possible values: light, dark, system """
AppearanceModeTracker.set_appearance_mode(mode_string)


def get_appearance_mode() -> str:
""" get current state of the appearance mode (light or dark) """
if AppearanceModeTracker.appearance_mode == 0:
return "Light"
elif AppearanceModeTracker.appearance_mode == 1:
return "Dark"


def set_default_color_theme(color_string: str):
""" set color theme or load custom theme file by passing the path """
ThemeManager.load_theme(color_string)


def set_widget_scaling(scaling_value: float):
""" set scaling for the widget dimensions """
ScalingTracker.set_widget_scaling(scaling_value)


def set_window_scaling(scaling_value: float):
""" set scaling for window dimensions """
ScalingTracker.set_window_scaling(scaling_value)


def deactivate_automatic_dpi_awareness():
""" deactivate DPI awareness of current process (windll.shcore.SetProcessDpiAwareness(0)) """
ScalingTracker.deactivate_automatic_dpi_awareness = True
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
155 changes: 155 additions & 0 deletions customtkinter/assets/themes/blue.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
{
"CTk": {
"fg_color": ["gray92", "gray14"]
},
"CTkToplevel": {
"fg_color": ["gray92", "gray14"]
},
"CTkFrame": {
"corner_radius": 6,
"border_width": 0,
"fg_color": ["gray86", "gray17"],
"top_fg_color": ["gray81", "gray20"],
"border_color": ["gray65", "gray28"]
},
"CTkButton": {
"corner_radius": 6,
"border_width": 0,
"fg_color": ["#3B8ED0", "#1F6AA5"],
"hover_color": ["#36719F", "#144870"],
"border_color": ["#3E454A", "#949A9F"],
"text_color": ["#DCE4EE", "#DCE4EE"],
"text_color_disabled": ["gray74", "gray60"]
},
"CTkLabel": {
"corner_radius": 0,
"fg_color": "transparent",
"text_color": ["gray10", "#DCE4EE"]
},
"CTkEntry": {
"corner_radius": 6,
"border_width": 2,
"fg_color": ["#F9F9FA", "#343638"],
"border_color": ["#979DA2", "#565B5E"],
"text_color":["gray10", "#DCE4EE"],
"placeholder_text_color": ["gray52", "gray62"]
},
"CTkCheckBox": {
"corner_radius": 6,
"border_width": 3,
"fg_color": ["#3B8ED0", "#1F6AA5"],
"border_color": ["#3E454A", "#949A9F"],
"hover_color": ["#3B8ED0", "#1F6AA5"],
"checkmark_color": ["#DCE4EE", "gray90"],
"text_color": ["gray10", "#DCE4EE"],
"text_color_disabled": ["gray60", "gray45"]
},
"CTkSwitch": {
"corner_radius": 1000,
"border_width": 3,
"button_length": 0,
"fg_color": ["#939BA2", "#4A4D50"],
"progress_color": ["#3B8ED0", "#1F6AA5"],
"button_color": ["gray36", "#D5D9DE"],
"button_hover_color": ["gray20", "gray100"],
"text_color": ["gray10", "#DCE4EE"],
"text_color_disabled": ["gray60", "gray45"]
},
"CTkRadioButton": {
"corner_radius": 1000,
"border_width_checked": 6,
"border_width_unchecked": 3,
"fg_color": ["#3B8ED0", "#1F6AA5"],
"border_color": ["#3E454A", "#949A9F"],
"hover_color": ["#36719F", "#144870"],
"text_color": ["gray10", "#DCE4EE"],
"text_color_disabled": ["gray60", "gray45"]
},
"CTkProgressBar": {
"corner_radius": 1000,
"border_width": 0,
"fg_color": ["#939BA2", "#4A4D50"],
"progress_color": ["#3B8ED0", "#1F6AA5"],
"border_color": ["gray", "gray"]
},
"CTkSlider": {
"corner_radius": 1000,
"button_corner_radius": 1000,
"border_width": 6,
"button_length": 0,
"fg_color": ["#939BA2", "#4A4D50"],
"progress_color": ["gray40", "#AAB0B5"],
"button_color": ["#3B8ED0", "#1F6AA5"],
"button_hover_color": ["#36719F", "#144870"]
},
"CTkOptionMenu": {
"corner_radius": 6,
"fg_color": ["#3B8ED0", "#1F6AA5"],
"button_color": ["#36719F", "#144870"],
"button_hover_color": ["#27577D", "#203A4F"],
"text_color": ["#DCE4EE", "#DCE4EE"],
"text_color_disabled": ["gray74", "gray60"]
},
"CTkComboBox": {
"corner_radius": 6,
"border_width": 2,
"fg_color": ["#F9F9FA", "#343638"],
"border_color": ["#979DA2", "#565B5E"],
"button_color": ["#979DA2", "#565B5E"],
"button_hover_color": ["#6E7174", "#7A848D"],
"text_color": ["gray10", "#DCE4EE"],
"text_color_disabled": ["gray50", "gray45"]
},
"CTkScrollbar": {
"corner_radius": 1000,
"border_spacing": 4,
"fg_color": "transparent",
"button_color": ["gray55", "gray41"],
"button_hover_color": ["gray40", "gray53"]
},
"CTkSegmentedButton": {
"corner_radius": 6,
"border_width": 2,
"fg_color": ["#979DA2", "gray29"],
"selected_color": ["#3B8ED0", "#1F6AA5"],
"selected_hover_color": ["#36719F", "#144870"],
"unselected_color": ["#979DA2", "gray29"],
"unselected_hover_color": ["gray70", "gray41"],
"text_color": ["#DCE4EE", "#DCE4EE"],
"text_color_disabled": ["gray74", "gray60"]
},
"CTkTextbox": {
"corner_radius": 6,
"border_width": 0,
"fg_color": ["#F9F9FA", "#1D1E1E"],
"border_color": ["#979DA2", "#565B5E"],
"text_color":["gray10", "#DCE4EE"],
"scrollbar_button_color": ["gray55", "gray41"],
"scrollbar_button_hover_color": ["gray40", "gray53"]
},
"CTkScrollableFrame": {
"label_fg_color": ["gray78", "gray23"]
},
"DropdownMenu": {
"fg_color": ["gray90", "gray20"],
"hover_color": ["gray75", "gray28"],
"text_color": ["gray10", "gray90"]
},
"CTkFont": {
"macOS": {
"family": "SF Display",
"size": 13,
"weight": "normal"
},
"Windows": {
"family": "Roboto",
"size": 13,
"weight": "normal"
},
"Linux": {
"family": "Roboto",
"size": 13,
"weight": "normal"
}
}
}
Loading

0 comments on commit ffd9ec5

Please sign in to comment.