4
4
from utils .highlighter import highlight
5
5
import os
6
6
import tkinter as tk
7
+ import webbrowser # Added for making the credits clickable
7
8
8
9
# Unicode icons (no external files needed)
9
10
ICONS = {
@@ -260,8 +261,60 @@ def toggle_theme():
260
261
)
261
262
theme_btn .pack (side = "right" , padx = 2 )
262
263
264
+ # Add About button
265
+ about_btn = ctk .CTkButton (
266
+ theme_frame ,
267
+ text = "About" ,
268
+ command = lambda : show_about_dialog (parent ),
269
+ ** button_style
270
+ )
271
+ about_btn .pack (side = "right" , padx = 5 )
272
+
263
273
return frame
264
274
275
+ def show_about_dialog (parent ):
276
+ about_window = ctk .CTkToplevel (parent )
277
+ about_window .title ("About ChiX" )
278
+ about_window .geometry ("400x200" )
279
+ about_window .resizable (False , False )
280
+
281
+ # Center on screen
282
+ about_window .update_idletasks ()
283
+ width = about_window .winfo_width ()
284
+ height = about_window .winfo_height ()
285
+ x = (about_window .winfo_screenwidth () // 2 ) - (width // 2 )
286
+ y = (about_window .winfo_screenheight () // 2 ) - (height // 2 )
287
+ about_window .geometry (f'{ width } x{ height } +{ x } +{ y } ' )
288
+
289
+ # Add content
290
+ ctk .CTkLabel (
291
+ about_window ,
292
+ text = "ChiX - C Code Editor & Runner" ,
293
+ font = ("Arial" , 16 , "bold" )
294
+ ).pack (pady = (20 , 5 ))
295
+
296
+ ctk .CTkLabel (
297
+ about_window ,
298
+ text = "Created by Prakhar Doneria" ,
299
+ font = ("Arial" , 14 )
300
+ ).pack (pady = 5 )
301
+
302
+ ctk .CTkLabel (
303
+ about_window ,
304
+ text = "© 2025 - Open Source Project" ,
305
+ font = ("Arial" , 12 )
306
+ ).pack (pady = 5 )
307
+
308
+ # GitHub link
309
+ def open_github ():
310
+ webbrowser .open ("https://github.com/PrakharDoneria/ChiX" )
311
+
312
+ ctk .CTkButton (
313
+ about_window ,
314
+ text = "Visit GitHub Repository" ,
315
+ command = open_github
316
+ ).pack (pady = 15 )
317
+
265
318
class StatusBar (ctk .CTkFrame ):
266
319
def __init__ (self , parent , state , ** kwargs ):
267
320
super ().__init__ (parent , height = 25 , fg_color = "#007acc" , ** kwargs )
@@ -275,15 +328,6 @@ def __init__(self, parent, state, **kwargs):
275
328
)
276
329
self .file_info .pack (side = "left" , padx = 10 )
277
330
278
- # Credits/GitHub link (right side)
279
- self .credits = ctk .CTkLabel (
280
- self ,
281
- text = "" ,
282
- text_color = "#ffffff" ,
283
- font = ("Arial" , 11 )
284
- )
285
- self .credits .pack (side = "right" , padx = 10 )
286
-
287
331
# Line/column indicator (right side)
288
332
self .position_indicator = ctk .CTkLabel (
289
333
self ,
@@ -293,10 +337,32 @@ def __init__(self, parent, state, **kwargs):
293
337
)
294
338
self .position_indicator .pack (side = "right" , padx = 10 )
295
339
340
+ # Create a dedicated credits frame with distinct background
341
+ self .credits_frame = ctk .CTkFrame (self , fg_color = "#333333" , corner_radius = 8 )
342
+ self .credits_frame .pack (side = "right" , padx = 10 , pady = 2 )
343
+
344
+ # Credits/GitHub link with enhanced visibility
345
+ self .credits = ctk .CTkLabel (
346
+ self .credits_frame ,
347
+ text = "" ,
348
+ text_color = "#00FFFF" , # Cyan color for high contrast
349
+ font = ("Arial" , 12 , "bold" ),
350
+ padx = 8 ,
351
+ pady = 2 ,
352
+ cursor = "hand2" # Hand cursor to indicate clickability
353
+ )
354
+ self .credits .pack ()
355
+
356
+ # Make credits clickable
357
+ self .credits .bind ("<Button-1>" , self ._open_github )
358
+
296
359
# Setup cursor position tracking
297
360
if state and "editor" in state and state ["editor" ]:
298
361
state ["editor" ].bind ("<KeyRelease>" , self .update_position )
299
362
state ["editor" ].bind ("<Button-1>" , self .update_position )
363
+
364
+ def _open_github (self , event ):
365
+ webbrowser .open ("https://github.com/PrakharDoneria/ChiX" )
300
366
301
367
def update_file_info (self , filepath = None ):
302
368
if filepath :
0 commit comments