Skip to content

Conversation

Copy link

Copilot AI commented Oct 8, 2025

Overview

This PR fixes inconsistencies in the UI theme configuration by defining the BUTTON_COLORS dictionary and correcting undefined variable references in utils/ui_theme.py.

Problem

  1. The ModernButton class was referencing BUTTON_COLORS dictionary, but it was not defined in utils/ui_theme.py. While a BUTTON_COLORS dictionary existed in assets/logo.py, it was never imported or used by the UI theme module.

  2. The ModernText class was referencing DARK_THEME dictionary which doesn't exist, causing undefined variable errors. The correct dictionary name is DARK_COLORS, which was already defined in the file.

Changes

1. Added BUTTON_COLORS Dictionary

Defined a comprehensive BUTTON_COLORS dictionary in utils/ui_theme.py with color configurations for 6 button styles:

BUTTON_COLORS = {
    'primary': {'bg': '#5E81AC', 'fg': '#ECEFF4', 'active_bg': '#81A1C1'},
    'success': {'bg': '#A3BE8C', 'fg': '#2E3440', 'active_bg': '#B5C9A4'},
    'warning': {'bg': '#EBCB8B', 'fg': '#2E3440', 'active_bg': '#F0D5A0'},
    'danger': {'bg': '#BF616A', 'fg': '#ECEFF4', 'active_bg': '#D08770'},
    'info': {'bg': '#88C0D0', 'fg': '#2E3440', 'active_bg': '#9FCAE0'},
    'secondary': {'bg': '#4C566A', 'fg': '#ECEFF4', 'active_bg': '#5E6B7D'},
}

Each style includes:

  • bg: Background color
  • fg: Foreground (text) color
  • active_bg: Hover/active state background color

2. Fixed DARK_THEME References

Renamed all 5 occurrences of DARK_THEME to DARK_COLORS in the ModernText class:

# Before (undefined variable)
'bg': DARK_THEME['entry_bg'],

# After (correct reference)
'bg': DARK_COLORS['entry_bg'],

Impact

  • ModernButton class now has proper access to button color schemes
  • ModernText class no longer references undefined variables
  • ✅ Code is more consistent and maintainable
  • ✅ No breaking changes to existing functionality

Testing

  • All syntax checks pass
  • No DARK_THEME references remain in the codebase
  • Existing imports in app.py and test_dark_theme.py remain fully compatible
Original prompt

Define BUTTON_COLORS dictionary with button color configurations for different styles (primary, success, warning, danger, info, secondary) and rename DARK_THEME references to DARK_COLORS which is already defined.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: mlbkumar9 <42941846+mlbkumar9@users.noreply.github.com>
Copilot AI changed the title [WIP] Add button color configurations for various styles Define BUTTON_COLORS dictionary and rename DARK_THEME references to DARK_COLORS Oct 8, 2025
Copilot AI requested a review from mlbkumar9 October 8, 2025 09:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants