Article-22495-Dispatch-Driv.../AI Canvas Theme.mqh

308 lines
14 KiB
MQL5
Raw Permalink Normal View History

//+------------------------------------------------------------------+
//| AI Canvas Theme.mqh |
//| Copyright 2026, Allan Munene Mutiiria. |
//| https://t.me/Forex_Algo_Trader |
//+------------------------------------------------------------------+
#property copyright "Copyright 2026, Allan Munene Mutiiria."
#property link "https://t.me/Forex_Algo_Trader"
//--- Include guard
#ifndef AI_CANVAS_THEME_MQH
#define AI_CANVAS_THEME_MQH
//+------------------------------------------------------------------+
//| Layout Dimensions |
//+------------------------------------------------------------------+
#define AI_SIDEBAR_W_EXPANDED 150 // Expanded sidebar width
#define AI_SIDEBAR_W_COLLAPSED 50 // Collapsed sidebar width
#define AI_MAIN_W 550 // Main content area width
#define AI_HEADER_H 40 // Header bar height
#define AI_FOOTER_H 46 // Footer bar height
#define AI_DISPLAY_H 280 // Chat display pane height
#define AI_PROMPT_H 130 // Prompt input pane height
#define AI_PAD 10 // Section vertical padding
#define AI_SIDE_PAD 6 // Side horizontal padding
#define AI_TEXT_PAD 10 // Text inset padding
#define AI_MARGIN 5 // Generic margin
#define AI_BUTTON_H 32 // Standard button height
#define AI_LINE_GAP 5 // Inter-line gap
#define AI_SS 4 // Super-sampling factor
#define AI_DASHBOARD_X_DEFAULT 10 // Default dashboard X anchor
#define AI_DASHBOARD_Y_DEFAULT 20 // Default dashboard Y anchor
//+------------------------------------------------------------------+
//| Font Sizes |
//+------------------------------------------------------------------+
#define AI_FONT_TITLE 14 // Title font size
#define AI_FONT_BODY 10 // Body text font size
#define AI_FONT_LABEL 10 // Button label font size
#define AI_FONT_SNIPPET 9 // Snippet preview font size
#define AI_FONT_TIMESTAMP 8 // Timestamp font size
#define AI_FONT_BUTTON 11 // Toolbar button font size
#define AI_FONT_HEADING 12 // Heading font size
//+------------------------------------------------------------------+
//| Glyph Codes (Webdings/Wingdings character mappings) |
//+------------------------------------------------------------------+
#define AI_GLYPH_CLOSE "r" // Close X glyph
#define AI_GLYPH_SEARCH "L" // Search magnifier glyph
#define AI_GLYPH_TOGGLE_LEFT "9" // Sidebar collapse arrow
#define AI_GLYPH_TOGGLE_RIGHT ":" // Sidebar expand arrow
#define AI_GLYPH_REGEN "q" // Regenerate icon
#define AI_GLYPH_SEND "@" // Send icon
#define AI_GLYPH_CHART "?" // Chart icon
#define AI_GLYPH_DELETE "V" // Delete X glyph
#define AI_GLYPH_EXPORT "7" // Export icon
#define AI_GLYPH_SCROLL_UP "5" // Scroll up arrow
#define AI_GLYPH_SCROLL_DOWN "6" // Scroll down arrow
#define AI_GLYPH_THEME "[" // Theme toggle glyph
//+------------------------------------------------------------------+
//| Active Theme Flag |
//+------------------------------------------------------------------+
bool g_ai_darkTheme = false; // True when dark theme is active
//+------------------------------------------------------------------+
//| Panel and Background Colors |
//+------------------------------------------------------------------+
color g_ai_bg, g_ai_panelAlt, g_ai_headerBg, g_ai_sidebarBg, g_ai_promptBg;
//+------------------------------------------------------------------+
//| Border Colors |
//+------------------------------------------------------------------+
color g_ai_border, g_ai_borderAccent;
//+------------------------------------------------------------------+
//| Text Colors |
//+------------------------------------------------------------------+
color g_ai_titleText, g_ai_subText, g_ai_bodyText;
//+------------------------------------------------------------------+
//| Bubble Colors |
//+------------------------------------------------------------------+
color g_ai_userBubbleText, g_ai_aiBubbleText, g_ai_userBubbleBg, g_ai_aiBubbleBg;
color g_ai_timestampText;
//+------------------------------------------------------------------+
//| Accent Colors |
//+------------------------------------------------------------------+
color g_ai_accent, g_ai_accentHover;
//+------------------------------------------------------------------+
//| Button Colors |
//+------------------------------------------------------------------+
color g_ai_buttonSendBg, g_ai_buttonSendBgHover;
color g_ai_buttonDisabledBg, g_ai_buttonDisabledIcon;
color g_ai_buttonChartBg, g_ai_buttonChartBgHover;
color g_ai_buttonSignalBg, g_ai_buttonSignalBgHover;
color g_ai_buttonClearBg, g_ai_buttonClearBgHover;
color g_ai_buttonNewChatBg, g_ai_buttonNewChatBgHover;
color g_ai_buttonHistoryBg, g_ai_buttonHistoryBgHover;
color g_ai_buttonSearchBg, g_ai_buttonSearchBgHover;
color g_ai_buttonToggleBg, g_ai_buttonToggleBgHover;
//+------------------------------------------------------------------+
//| Close Button Colors |
//+------------------------------------------------------------------+
color g_ai_closeBg, g_ai_closeBgHover, g_ai_closeColor, g_ai_closeColorHover;
//+------------------------------------------------------------------+
//| Chat Item Colors |
//+------------------------------------------------------------------+
color g_ai_chatItemBg, g_ai_chatItemBgHover, g_ai_chatItemActiveText, g_ai_chatItemDelHover;
//+------------------------------------------------------------------+
//| Scrollbar Colors |
//+------------------------------------------------------------------+
color g_ai_scrollSlider, g_ai_scrollSliderHover, g_ai_scrollSliderDrag;
//+------------------------------------------------------------------+
//| Editor Colors |
//+------------------------------------------------------------------+
color g_ai_caretColor, g_ai_selectionBg;
//+------------------------------------------------------------------+
//| Loading and Note Colors |
//+------------------------------------------------------------------+
color g_ai_loadingPrep, g_ai_loadingThink, g_ai_responseTimeNote;
//+------------------------------------------------------------------+
//| Toast Notification Palette |
//+------------------------------------------------------------------+
color g_ai_toastBg, g_ai_toastBorder, g_ai_toastSuccess, g_ai_toastError;
//+------------------------------------------------------------------+
//| Apply theme palette - true for dark, false for light |
//+------------------------------------------------------------------+
void Ai_ApplyTheme(bool dark)
{
//--- Store active theme flag
g_ai_darkTheme = dark;
//--- Dark theme palette
if(dark)
{
//--- Panel and background colors
g_ai_bg = C'22,26,36';
g_ai_panelAlt = C'28,33,46';
g_ai_headerBg = C'30,35,48';
g_ai_sidebarBg = C'24,29,40';
g_ai_promptBg = C'34,30,24';
//--- Border colors lifted above panel for visibility
g_ai_border = C'95,105,125';
g_ai_borderAccent = C'130,140,160';
//--- Text colors
g_ai_titleText = C'225,230,240';
g_ai_subText = C'140,150,170';
g_ai_bodyText = C'215,220,232';
//--- Bubble colors
g_ai_userBubbleText = C'200,210,225';
g_ai_aiBubbleText = C'140,180,255';
g_ai_userBubbleBg = C'40,48,65';
g_ai_aiBubbleBg = C'35,55,90';
g_ai_timestampText = C'105,115,135';
//--- Accent and send button colors
g_ai_accent = C'88,160,255';
g_ai_accentHover = C'120,180,255';
g_ai_buttonSendBg = C'58,130,246';
g_ai_buttonSendBgHover = C'90,150,255';
g_ai_buttonDisabledBg = C'70,75,85';
g_ai_buttonDisabledIcon = C'130,135,145';
//--- Action button colors
g_ai_buttonChartBg = C'40,90,55';
g_ai_buttonChartBgHover = C'55,115,75';
g_ai_buttonSignalBg = C'40,60,100';
g_ai_buttonSignalBgHover = C'55,80,130';
g_ai_buttonClearBg = C'95,40,40';
g_ai_buttonClearBgHover = C'120,55,55';
g_ai_buttonNewChatBg = C'40,55,90';
g_ai_buttonNewChatBgHover= C'55,75,115';
g_ai_buttonHistoryBg = C'45,50,65';
g_ai_buttonHistoryBgHover= C'60,68,85';
g_ai_buttonSearchBg = C'45,52,72';
g_ai_buttonSearchBgHover = C'60,70,95';
g_ai_buttonToggleBg = C'45,52,68';
g_ai_buttonToggleBgHover = C'58,68,88';
//--- Close button colors
g_ai_closeBg = C'30,35,48';
g_ai_closeBgHover = C'196,43,28';
g_ai_closeColor = C'160,170,190';
g_ai_closeColorHover = clrWhite;
//--- Chat item colors
g_ai_chatItemBg = C'34,40,55';
g_ai_chatItemBgHover = C'48,56,75';
g_ai_chatItemActiveText = C'120,180,255';
g_ai_chatItemDelHover = C'235,75,75';
//--- Scrollbar colors
g_ai_scrollSlider = C'90,100,120';
g_ai_scrollSliderHover = C'140,150,170';
g_ai_scrollSliderDrag = C'88,160,255';
//--- Editor colors
g_ai_caretColor = C'140,180,255';
g_ai_selectionBg = C'60,90,160';
//--- Loading and note colors
g_ai_loadingPrep = C'88,160,255';
g_ai_loadingThink = C'235,130,130';
g_ai_responseTimeNote = C'105,115,135';
//--- Toast palette
g_ai_toastBg = C'34,40,55';
g_ai_toastBorder = C'85,92,115';
g_ai_toastSuccess = clrBlue;
g_ai_toastError = clrRed;
}
//--- Light theme palette
else
{
//--- Panel and background colors
g_ai_bg = clrWhite;
g_ai_panelAlt = C'250,252,255';
g_ai_headerBg = C'245,247,251';
g_ai_sidebarBg = C'232,236,242';
g_ai_promptBg = C'253,248,238';
//--- Border colors darker than panel for crisp lines
g_ai_border = C'180,188,200';
g_ai_borderAccent = C'150,160,180';
//--- Text colors
g_ai_titleText = C'30,40,55';
g_ai_subText = C'120,130,150';
g_ai_bodyText = C'40,48,66';
//--- Bubble colors
g_ai_userBubbleText = C'80,90,110';
g_ai_aiBubbleText = C'30,80,180';
g_ai_userBubbleBg = C'238,243,250';
g_ai_aiBubbleBg = C'235,242,252';
g_ai_timestampText = C'150,160,180';
//--- Accent and send button colors
g_ai_accent = C'58,130,246';
g_ai_accentHover = C'90,150,255';
g_ai_buttonSendBg = C'58,130,246';
g_ai_buttonSendBgHover = C'90,150,255';
g_ai_buttonDisabledBg = C'215,218,222';
g_ai_buttonDisabledIcon = C'150,155,160';
//--- Action button colors
g_ai_buttonChartBg = C'180,225,180';
g_ai_buttonChartBgHover = C'200,240,200';
g_ai_buttonSignalBg = C'190,215,255';
g_ai_buttonSignalBgHover = C'215,230,255';
g_ai_buttonClearBg = C'250,205,200';
g_ai_buttonClearBgHover = C'255,225,220';
g_ai_buttonNewChatBg = C'200,225,255';
g_ai_buttonNewChatBgHover= C'220,235,255';
g_ai_buttonHistoryBg = C'250,250,250';
g_ai_buttonHistoryBgHover= C'235,235,235';
g_ai_buttonSearchBg = C'205,210,225';
g_ai_buttonSearchBgHover = C'225,228,240';
g_ai_buttonToggleBg = C'215,220,228';
g_ai_buttonToggleBgHover = C'195,200,210';
//--- Close button colors
g_ai_closeBg = C'245,245,245';
g_ai_closeBgHover = C'196,43,28';
g_ai_closeColor = C'120,130,150';
g_ai_closeColorHover = clrWhite;
//--- Chat item colors
g_ai_chatItemBg = C'250,247,235';
g_ai_chatItemBgHover = C'238,232,210';
g_ai_chatItemActiveText = C'58,130,246';
g_ai_chatItemDelHover = clrCrimson;
//--- Scrollbar colors
g_ai_scrollSlider = C'140,150,170';
g_ai_scrollSliderHover = C'90,100,120';
g_ai_scrollSliderDrag = C'58,130,246';
//--- Editor colors
g_ai_caretColor = C'30,80,180';
g_ai_selectionBg = C'180,210,255';
//--- Loading and note colors
g_ai_loadingPrep = C'58,130,246';
g_ai_loadingThink = C'196,80,80';
g_ai_responseTimeNote = C'150,160,180';
//--- Toast palette
g_ai_toastBg = clrWhite;
g_ai_toastBorder = C'200,205,215';
g_ai_toastSuccess = clrBlue;
g_ai_toastError = clrRed;
}
}
#endif // AI_CANVAS_THEME_MQH