diff --git a/ChangeLog b/ChangeLog index 750627de..6dbcc9a3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +2020-05-29 Markus Gans + * Adding a dark theme. Can be activated with the --dark-theme parameter. + 2020-05-28 Markus Gans * FColorPalette now also uses polymorphism, so you can now easily create your own color palette theme diff --git a/src/fapplication.cpp b/src/fapplication.cpp index 984ac34e..9087cbd9 100644 --- a/src/fapplication.cpp +++ b/src/fapplication.cpp @@ -311,6 +311,8 @@ void FApplication::showParameterUsage() << " Set the standard vga 8x16 font\n" << " --newfont " << " Enables the graphical font\n" + << " --dark-theme " + << " Enables the dark theme\n" #if defined(__FreeBSD__) || defined(__DragonFly__) << "\n" @@ -406,6 +408,7 @@ void FApplication::cmd_options (const int& argc, char* argv[]) {"no-sgr-optimizer", no_argument, nullptr, 0 }, {"vgafont", no_argument, nullptr, 0 }, {"newfont", no_argument, nullptr, 0 }, + {"dark-theme", no_argument, nullptr, 0 }, #if defined(__FreeBSD__) || defined(__DragonFly__) {"no-esc-for-alt-meta", no_argument, nullptr, 0 }, @@ -470,6 +473,9 @@ void FApplication::cmd_options (const int& argc, char* argv[]) if ( std::strcmp(long_options[idx].name, "newfont") == 0 ) getStartOptions().newfont = true; + if ( std::strcmp(long_options[idx].name, "dark-theme") == 0 ) + getStartOptions().dark_theme = true; + #if defined(__FreeBSD__) || defined(__DragonFly__) if ( std::strcmp(long_options[idx].name, "no-esc-for-alt-meta") == 0 ) getStartOptions().meta_sends_escape = false; diff --git a/src/fcolorpalette.cpp b/src/fcolorpalette.cpp index 15f5d8b9..bbcdf73a 100644 --- a/src/fcolorpalette.cpp +++ b/src/fcolorpalette.cpp @@ -31,7 +31,7 @@ namespace finalcut // constructors and destructor //---------------------------------------------------------------------- -FColorPalette::FColorPalette (FSetPalette f) +FColorPalette::FColorPalette (const FSetPalette& f) : set_palette{f} { } @@ -47,6 +47,26 @@ void FColorPalette::setPalette (FColor index, int r, int g, int b) set_palette (index, r, g, b); } +//---------------------------------------------------------------------- +void FColorPalette::setVGAdefaultPalette() +{ + setPalette (fc::Black, 0x00, 0x00, 0x00); + setPalette (fc::Blue, 0x00, 0x00, 0xaa); + setPalette (fc::Green, 0x00, 0xaa, 0x00); + setPalette (fc::Cyan, 0x00, 0x55, 0xaa); + setPalette (fc::Red, 0xaa, 0x00, 0x00); + setPalette (fc::Magenta, 0xaa, 0x00, 0xaa); + setPalette (fc::Brown, 0xaa, 0xaa, 0x00); + setPalette (fc::LightGray, 0xaa, 0xaa, 0xaa); + setPalette (fc::DarkGray, 0x55, 0x55, 0x55); + setPalette (fc::LightBlue, 0x55, 0x55, 0xff); + setPalette (fc::LightGreen, 0x55, 0xff, 0x55); + setPalette (fc::LightCyan, 0x55, 0xff, 0xff); + setPalette (fc::LightRed, 0xff, 0x55, 0x55); + setPalette (fc::LightMagenta, 0xff, 0x55, 0xff); + setPalette (fc::Yellow, 0xff, 0xff, 0x55); + setPalette (fc::White, 0xff, 0xff, 0xff); +} //---------------------------------------------------------------------- // class default8ColorPalette @@ -54,7 +74,7 @@ void FColorPalette::setPalette (FColor index, int r, int g, int b) // constructors and destructor //---------------------------------------------------------------------- -default8ColorPalette::default8ColorPalette (FSetPalette f) +default8ColorPalette::default8ColorPalette (const FSetPalette& f) : FColorPalette(f) { } @@ -88,22 +108,7 @@ void default8ColorPalette::setColorPalette() //---------------------------------------------------------------------- void default8ColorPalette::resetColorPalette() { - set_palette (fc::Black, 0x00, 0x00, 0x00); - set_palette (fc::Blue, 0x00, 0x00, 0xaa); - set_palette (fc::Green, 0x00, 0xaa, 0x00); - set_palette (fc::Cyan, 0x00, 0x55, 0xaa); - set_palette (fc::Red, 0xaa, 0x00, 0x00); - set_palette (fc::Magenta, 0xaa, 0x00, 0xaa); - set_palette (fc::Brown, 0xaa, 0xaa, 0x00); - set_palette (fc::LightGray, 0xaa, 0xaa, 0xaa); - set_palette (fc::DarkGray, 0x55, 0x55, 0x55); - set_palette (fc::LightBlue, 0x55, 0x55, 0xff); - set_palette (fc::LightGreen, 0x55, 0xff, 0x55); - set_palette (fc::LightCyan, 0x55, 0xff, 0xff); - set_palette (fc::LightRed, 0xff, 0x55, 0x55); - set_palette (fc::LightMagenta, 0xff, 0x55, 0xff); - set_palette (fc::Yellow, 0xff, 0xff, 0x55); - set_palette (fc::White, 0xff, 0xff, 0xff); + setVGAdefaultPalette(); } @@ -113,7 +118,7 @@ void default8ColorPalette::resetColorPalette() // constructors and destructor //---------------------------------------------------------------------- -default16ColorPalette::default16ColorPalette (FSetPalette f) +default16ColorPalette::default16ColorPalette (const FSetPalette& f) : FColorPalette(f) { } @@ -146,24 +151,51 @@ void default16ColorPalette::setColorPalette() //---------------------------------------------------------------------- void default16ColorPalette::resetColorPalette() { - set_palette (fc::Black, 0x00, 0x00, 0x00); - set_palette (fc::Blue, 0x00, 0x00, 0xaa); - set_palette (fc::Green, 0x00, 0xaa, 0x00); - set_palette (fc::Cyan, 0x00, 0x55, 0xaa); - set_palette (fc::Red, 0xaa, 0x00, 0x00); - set_palette (fc::Magenta, 0xaa, 0x00, 0xaa); - set_palette (fc::Brown, 0xaa, 0xaa, 0x00); - set_palette (fc::LightGray, 0xaa, 0xaa, 0xaa); - set_palette (fc::DarkGray, 0x55, 0x55, 0x55); - set_palette (fc::LightBlue, 0x55, 0x55, 0xff); - set_palette (fc::LightGreen, 0x55, 0xff, 0x55); - set_palette (fc::LightCyan, 0x55, 0xff, 0xff); - set_palette (fc::LightRed, 0xff, 0x55, 0x55); - set_palette (fc::LightMagenta, 0xff, 0x55, 0xff); - set_palette (fc::Yellow, 0xff, 0xff, 0x55); - set_palette (fc::White, 0xff, 0xff, 0xff); + setVGAdefaultPalette(); } +//---------------------------------------------------------------------- +// class default16DarkColorPalette +//---------------------------------------------------------------------- + +// constructors and destructor +//---------------------------------------------------------------------- +default16DarkColorPalette::default16DarkColorPalette (const FSetPalette& f) + : FColorPalette(f) +{ } + +//---------------------------------------------------------------------- +default16DarkColorPalette::~default16DarkColorPalette() +{ } + +// public methods of default8ColorPalette +//---------------------------------------------------------------------- +void default16DarkColorPalette::setColorPalette() +{ + setPalette (fc::Black, 0x00, 0x00, 0x00); + setPalette (fc::Blue, 0x41, 0x58, 0xb3); + setPalette (fc::Green, 0x18, 0x78, 0x18); + setPalette (fc::Cyan, 0x4e, 0x66, 0x72); + setPalette (fc::Red, 0xba, 0x49, 0x49); + setPalette (fc::Magenta, 0xb2, 0x18, 0xb2); + setPalette (fc::Brown, 0xe8, 0x87, 0x1f); + setPalette (fc::LightGray, 0xd2, 0xd2, 0xd2); + setPalette (fc::DarkGray, 0x27, 0x33, 0x39); + setPalette (fc::LightBlue, 0xb0, 0xb0, 0xb8); + setPalette (fc::LightGreen, 0x5e, 0xeb, 0x5c); + setPalette (fc::LightCyan, 0x62, 0xbf, 0xf8); + setPalette (fc::LightRed, 0xdd, 0x51, 0x45); + setPalette (fc::LightMagenta, 0xe9, 0xad, 0xff); + setPalette (fc::Yellow, 0xfb, 0xe8, 0x67); + setPalette (fc::White, 0xff, 0xff, 0xff); +} + +//---------------------------------------------------------------------- +void default16DarkColorPalette::resetColorPalette() +{ + setVGAdefaultPalette(); +} + } // namespace finalcut diff --git a/src/fstartoptions.cpp b/src/fstartoptions.cpp index 1fd35f97..864b5033 100644 --- a/src/fstartoptions.cpp +++ b/src/fstartoptions.cpp @@ -51,6 +51,7 @@ FStartOptions::FStartOptions() #elif defined(__NetBSD__) || defined(__OpenBSD__) , meta_sends_escape{true} #endif + , dark_theme{false} { } //---------------------------------------------------------------------- diff --git a/src/fstatusbar.cpp b/src/fstatusbar.cpp index a27b09c0..afbe3649 100644 --- a/src/fstatusbar.cpp +++ b/src/fstatusbar.cpp @@ -627,7 +627,7 @@ void FStatusBar::drawKey (keyList::const_iterator iter) if ( FTerm::hasHalfBlockCharacter() ) { - setColor (wc->statusbar_active_fg, wc->statusbar_active_bg); + setColor (wc->statusbar_bg, wc->statusbar_active_hotkey_bg); print (fc::LeftHalfBlock); // ▐ } else @@ -674,6 +674,7 @@ void FStatusBar::drawActiveKey (keyList::const_iterator iter) { print (item->getText()); x++; + setColor (wc->statusbar_bg, wc->statusbar_active_hotkey_bg); print (fc::RightHalfBlock); // ▌ } else diff --git a/src/fterm.cpp b/src/fterm.cpp index 25dd888b..931aec5e 100644 --- a/src/fterm.cpp +++ b/src/fterm.cpp @@ -1888,10 +1888,17 @@ void FTerm::redefineColorPalette() resetColorMap(); saveColorMap(); - if ( getMaxColor() >= 16 ) - setColorPaletteTheme(&FTerm::setPalette); - else // 8 colors - setColorPaletteTheme(&FTerm::setPalette); + if ( FStartOptions::getFStartOptions().dark_theme ) + { + setColorPaletteTheme(&FTerm::setPalette); + } + else + { + if ( getMaxColor() >= 16 ) + setColorPaletteTheme(&FTerm::setPalette); + else // 8 colors + setColorPaletteTheme(&FTerm::setPalette); + } getColorPaletteTheme()->setColorPalette(); } diff --git a/src/fwidget.cpp b/src/fwidget.cpp index 083ca1a7..ff87ccd8 100644 --- a/src/fwidget.cpp +++ b/src/fwidget.cpp @@ -26,6 +26,7 @@ #include "final/fevent.h" #include "final/flog.h" #include "final/fmenubar.h" +#include "final/fstartoptions.h" #include "final/fstatusbar.h" #include "final/fstring.h" #include "final/ftermdata.h" @@ -1992,10 +1993,20 @@ void FWidget::initColorTheme() { // Sets the default color theme - if ( FTerm::getMaxColor() < 16 ) // for 8 color mode - setColorTheme(); + if ( FStartOptions::getFStartOptions().dark_theme ) + { + if ( FTerm::getMaxColor() < 16 ) // for 8 color mode + setColorTheme(); + else + setColorTheme(); + } else - setColorTheme(); + { + if ( FTerm::getMaxColor() < 16 ) // for 8 color mode + setColorTheme(); + else + setColorTheme(); + } } //---------------------------------------------------------------------- diff --git a/src/fwidgetcolors.cpp b/src/fwidgetcolors.cpp index 4bc0a6f2..3617eced 100644 --- a/src/fwidgetcolors.cpp +++ b/src/fwidgetcolors.cpp @@ -259,4 +259,219 @@ void default16ColorTheme::setColorTheme() term_bg = fc::SkyBlue2; } +//---------------------------------------------------------------------- +// class default8ColorDarkTheme +//---------------------------------------------------------------------- + +// constructors and destructor +//---------------------------------------------------------------------- +default8ColorDarkTheme::default8ColorDarkTheme() +{ + default8ColorDarkTheme::setColorTheme(); +} + +//---------------------------------------------------------------------- +default8ColorDarkTheme::~default8ColorDarkTheme() +{ } + +// public methods of default8ColorDarkTheme +//---------------------------------------------------------------------- +void default8ColorDarkTheme::setColorTheme() +{ + term_fg = fc::LightGray; + term_bg = fc::Cyan; + list_fg = fc::Black; + list_bg = fc::LightGray; + selected_list_fg = fc::Cyan; + selected_list_bg = fc::LightGray; + dialog_fg = fc::Black; + dialog_resize_fg = fc::Blue; + dialog_emphasis_fg = fc::Blue; + dialog_bg = fc::LightGray; + error_box_fg = fc::LightGray; + error_box_emphasis_fg = fc::Black; + error_box_bg = fc::Red; + tooltip_fg = fc::LightGray; + tooltip_bg = fc::Black; + shadow_fg = fc::Black; + shadow_bg = fc::LightGray; // only for transparent shadow + current_element_focus_fg = fc::LightGray; + current_element_focus_bg = fc::Cyan; + current_element_fg = fc::Black; + current_element_bg = fc::Cyan; + current_inc_search_element_fg = fc::Red; + selected_current_element_focus_fg = fc::Cyan; + selected_current_element_focus_bg = fc::Cyan; + selected_current_element_fg = fc::Blue; + selected_current_element_bg = fc::Cyan; + label_fg = fc::Black; + label_bg = fc::LightGray; + label_inactive_fg = fc::Cyan; + label_inactive_bg = fc::LightGray; + label_hotkey_fg = fc::Red; + label_hotkey_bg = fc::LightGray; + label_emphasis_fg = fc::Blue; + label_ellipsis_fg = fc::Cyan; + inputfield_active_focus_fg = fc::LightGray; + inputfield_active_focus_bg = fc::Cyan; + inputfield_active_fg = fc::LightGray; + inputfield_active_bg = fc::Cyan; + inputfield_inactive_fg = fc::Cyan; + inputfield_inactive_bg = fc::LightGray; + toggle_button_active_focus_fg = fc::LightGray; + toggle_button_active_focus_bg = fc::Cyan; + toggle_button_active_fg = fc::Black; + toggle_button_active_bg = fc::LightGray; + toggle_button_inactive_fg = fc::Cyan; + toggle_button_inactive_bg = fc::LightGray; + button_active_focus_fg = fc::LightGray; + button_active_focus_bg = fc::Cyan; + button_active_fg = fc::LightGray; + button_active_bg = fc::Black; + button_inactive_fg = fc::Black; + button_inactive_bg = fc::Cyan; + button_hotkey_fg = fc::LightGray; + titlebar_active_fg = fc::LightGray; + titlebar_active_bg = fc::Black; + titlebar_inactive_fg = fc::Black; + titlebar_inactive_bg = fc::LightGray; + titlebar_button_fg = fc::Black; + titlebar_button_bg = fc::LightGray; + titlebar_button_focus_fg = fc::LightGray; + titlebar_button_focus_bg = fc::Black; + menu_active_focus_fg = fc::LightGray; + menu_active_focus_bg = fc::Blue; + menu_active_fg = fc::LightGray; + menu_active_bg = fc::Black; + menu_inactive_fg = fc::LightGray; + menu_inactive_bg = fc::Black; + menu_hotkey_fg = fc::Red; + menu_hotkey_bg = fc::Black; + statusbar_fg = fc::LightGray; + statusbar_bg = fc::Black; + statusbar_hotkey_fg = fc::Red; + statusbar_hotkey_bg = fc::Black; + statusbar_separator_fg = fc::LightGray; + statusbar_active_fg = fc::LightGray; + statusbar_active_bg = fc::Blue; + statusbar_active_hotkey_fg = fc::Red; + statusbar_active_hotkey_bg = fc::Blue; + scrollbar_fg = fc::Cyan; + scrollbar_bg = fc::LightGray; + scrollbar_button_fg = fc::Black; + scrollbar_button_bg = fc::LightGray; + scrollbar_button_inactive_fg = fc::Cyan; + scrollbar_button_inactive_bg = fc::LightGray; + progressbar_fg = fc::Cyan; + progressbar_bg = fc::LightGray; +} + + +//---------------------------------------------------------------------- +// class default16ColorDarkTheme +//---------------------------------------------------------------------- + +// constructors and destructor +//---------------------------------------------------------------------- +default16ColorDarkTheme::default16ColorDarkTheme() +{ + default16ColorDarkTheme::setColorTheme(); +} + +//---------------------------------------------------------------------- +default16ColorDarkTheme::~default16ColorDarkTheme() +{ } + +// public methods of default16ColorDarkTheme +//---------------------------------------------------------------------- +void default16ColorDarkTheme::setColorTheme() +{ + term_fg = fc::White; + term_bg = fc::Cyan; + list_fg = fc::Black; + list_bg = fc::LightGray; + selected_list_fg = fc::Red; + selected_list_bg = fc::LightGray; + dialog_fg = fc::Black; + dialog_resize_fg = fc::LightBlue; + dialog_emphasis_fg = fc::Blue; + dialog_bg = fc::LightGray; + error_box_fg = fc::White; + error_box_emphasis_fg = fc::Yellow; + error_box_bg = fc::Red; + tooltip_fg = fc::White; + tooltip_bg = fc::Black; + shadow_fg = fc::Black; + shadow_bg = fc::LightGray; // only for transparent shadow + current_element_focus_fg = fc::White; + current_element_focus_bg = fc::Cyan; + current_element_fg = fc::LightBlue; + current_element_bg = fc::Cyan; + current_inc_search_element_fg = fc::LightRed; + selected_current_element_focus_fg = fc::LightRed; + selected_current_element_focus_bg = fc::Cyan; + selected_current_element_fg = fc::Red; + selected_current_element_bg = fc::Cyan; + label_fg = fc::Black; + label_bg = fc::LightGray; + label_inactive_fg = fc::DarkGray; + label_inactive_bg = fc::LightGray; + label_hotkey_fg = fc::Red; + label_hotkey_bg = fc::LightGray; + label_emphasis_fg = fc::Blue; + label_ellipsis_fg = fc::DarkGray; + inputfield_active_focus_fg = fc::White; + inputfield_active_focus_bg = fc::Cyan; + inputfield_active_fg = fc::White; + inputfield_active_bg = fc::DarkGray; + inputfield_inactive_fg = fc::DarkGray; + inputfield_inactive_bg = fc::LightGray; + toggle_button_active_focus_fg = fc::White; + toggle_button_active_focus_bg = fc::Cyan; + toggle_button_active_fg = fc::Black; + toggle_button_active_bg = fc::LightGray; + toggle_button_inactive_fg = fc::DarkGray; + toggle_button_inactive_bg = fc::LightGray; + button_active_focus_fg = fc::LightGray; + button_active_focus_bg = fc::Cyan; + button_active_fg = fc::LightGray; + button_active_bg = fc::DarkGray; + button_inactive_fg = fc::DarkGray; + button_inactive_bg = fc::LightBlue; + button_hotkey_fg = fc::White; + titlebar_active_fg = fc::White; + titlebar_active_bg = fc::DarkGray; + titlebar_inactive_fg = fc::DarkGray; + titlebar_inactive_bg = fc::LightGray; + titlebar_button_fg = fc::DarkGray; + titlebar_button_bg = fc::LightGray; + titlebar_button_focus_fg = fc::LightGray; + titlebar_button_focus_bg = fc::Black; + menu_active_focus_fg = fc::White; + menu_active_focus_bg = fc::Blue; + menu_active_fg = fc::White; + menu_active_bg = fc::DarkGray; + menu_inactive_fg = fc::LightGray; + menu_inactive_bg = fc::DarkGray; + menu_hotkey_fg = fc::LightRed; + menu_hotkey_bg = fc::DarkGray; + statusbar_fg = fc::White; + statusbar_bg = fc::DarkGray; + statusbar_hotkey_fg = fc::LightRed; + statusbar_hotkey_bg = fc::DarkGray; + statusbar_separator_fg = fc::LightGray; + statusbar_active_fg = fc::White; + statusbar_active_bg = fc::Blue; + statusbar_active_hotkey_fg = fc::LightRed; + statusbar_active_hotkey_bg = fc::Blue; + scrollbar_fg = fc::DarkGray; + scrollbar_bg = fc::LightBlue; + scrollbar_button_fg = fc::Black; + scrollbar_button_bg = fc::LightBlue; + scrollbar_button_inactive_fg = fc::DarkGray; + scrollbar_button_inactive_bg = fc::LightGray; + progressbar_fg = fc::DarkGray; + progressbar_bg = fc::LightBlue; +} + } // namespace finalcut diff --git a/src/fwindow.cpp b/src/fwindow.cpp index 79e09eb4..3d01dfe0 100644 --- a/src/fwindow.cpp +++ b/src/fwindow.cpp @@ -882,7 +882,8 @@ void closeDropDown (FWidget* widget, const FPoint& mouse_position) if ( ! openmenu ) return; - if ( openmenu->isInstanceOf("FMenu") ) + if ( openmenu->isInstanceOf("FMenu") + || openmenu->isInstanceOf("FDialogListMenu") ) { bool contains_menu_structure; auto menu = static_cast(openmenu); diff --git a/src/include/final/fcolorpalette.h b/src/include/final/fcolorpalette.h index 4830102e..bda92d9c 100644 --- a/src/include/final/fcolorpalette.h +++ b/src/include/final/fcolorpalette.h @@ -53,7 +53,7 @@ class FColorPalette typedef std::function FSetPalette; // Constructor - FColorPalette(FSetPalette); + explicit FColorPalette (const FSetPalette&); // Destructor virtual ~FColorPalette(); @@ -67,7 +67,9 @@ class FColorPalette protected: void setPalette (FColor, int, int, int); + void setVGAdefaultPalette(); + private: // Data members FSetPalette set_palette; }; @@ -99,13 +101,13 @@ class default8ColorPalette final : public FColorPalette { public: // Constructor - default8ColorPalette (FSetPalette); + explicit default8ColorPalette (const FSetPalette&); // Destructor ~default8ColorPalette(); // Accessor - virtual const FString getClassName() const; + const FString getClassName() const override; // Methods void setColorPalette(); @@ -139,13 +141,13 @@ class default16ColorPalette final : public FColorPalette { public: // Constructor - default16ColorPalette (FSetPalette); + explicit default16ColorPalette (const FSetPalette&); // Destructor ~default16ColorPalette(); // Accessor - virtual const FString getClassName() const; + const FString getClassName() const override; // Methods void setColorPalette(); @@ -157,6 +159,33 @@ class default16ColorPalette final : public FColorPalette inline const FString default16ColorPalette::getClassName() const { return "default16ColorPalette"; } + +//---------------------------------------------------------------------- +// class default16DarkColorPalette +//---------------------------------------------------------------------- + +class default16DarkColorPalette final : public FColorPalette +{ + public: + // Constructor + explicit default16DarkColorPalette (const FSetPalette&); + + // Destructor + ~default16DarkColorPalette(); + + // Accessor + const FString getClassName() const override; + + // Methods + void setColorPalette(); + void resetColorPalette(); +}; + +// default16ColorPalette inline functions +//---------------------------------------------------------------------- +inline const FString default16DarkColorPalette::getClassName() const +{ return "default16DarkColorPalette"; } + } // namespace finalcut #endif // FCOLORPALETTE_H diff --git a/src/include/final/fstartoptions.h b/src/include/final/fstartoptions.h index b5ca6bb9..c541559e 100644 --- a/src/include/final/fstartoptions.h +++ b/src/include/final/fstartoptions.h @@ -93,6 +93,8 @@ class FStartOptions final uInt8 : 7; // padding bits #endif + uInt16 dark_theme : 1; + uInt16 : 15; // padding bits static FStartOptions* start_options; }; diff --git a/src/include/final/fterm.h b/src/include/final/fterm.h index 955b9af1..7d9a0950 100644 --- a/src/include/final/fterm.h +++ b/src/include/final/fterm.h @@ -163,6 +163,7 @@ class FTerm final // Typedef typedef std::function defaultPutChar; typedef std::shared_ptr FColorPalettePtr; + typedef FColorPalette::FSetPalette FSetPalette; // Constructor explicit FTerm (bool = false); @@ -276,7 +277,7 @@ class FTerm final static void resetColorMap(); static void setPalette (FColor, int, int, int); template - static void setColorPaletteTheme (FColorPalette::FSetPalette); + static void setColorPaletteTheme (const FSetPalette&); static void setBeep (int, int); static void resetBeep(); static void beep(); @@ -440,7 +441,7 @@ inline bool FTerm::unsetUTF8() //---------------------------------------------------------------------- template -inline void FTerm::setColorPaletteTheme (FColorPalette::FSetPalette f) +inline void FTerm::setColorPaletteTheme (const FSetPalette& f) { getColorPaletteTheme() = std::make_shared(f); } diff --git a/src/include/final/fwidgetcolors.h b/src/include/final/fwidgetcolors.h index 2777cd99..425cffa9 100644 --- a/src/include/final/fwidgetcolors.h +++ b/src/include/final/fwidgetcolors.h @@ -207,6 +207,68 @@ class default16ColorTheme final : public FWidgetColors void setColorTheme() override; }; + +/* Inheritance diagram + * ═══════════════════ + * + * ▕▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▏ + * ▕ FWidgetColors ▏ + * ▕▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▏ + * ▲ + * │ + * ▕▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▏ + * ▕ default8ColorDarkTheme ▏ + * ▕▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▏ + */ + +//---------------------------------------------------------------------- +// class default8ColorDarkTheme +//---------------------------------------------------------------------- + +class default8ColorDarkTheme final : public FWidgetColors +{ + public: + // Constructor + default8ColorDarkTheme(); + + // Destructor + ~default8ColorDarkTheme() override; + + // Method + void setColorTheme() override; +}; + + +/* Inheritance diagram + * ═══════════════════ + * + * ▕▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▏ + * ▕ FWidgetColors ▏ + * ▕▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▏ + * ▲ + * │ + * ▕▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▏ + * ▕ default16ColorDarkTheme ▏ + * ▕▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▏ + */ + +//---------------------------------------------------------------------- +// class default16ColorDarkTheme +//---------------------------------------------------------------------- + +class default16ColorDarkTheme final : public FWidgetColors +{ + public: + // Constructor + default16ColorDarkTheme(); + + // Destructor + ~default16ColorDarkTheme() override; + + // Method + void setColorTheme() override; +}; + } // namespace finalcut #endif // FWIDGETCOLORS_H