clThemedChoice::clThemedChoice(wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, const wxArrayString& choices, long style, const wxValidator& validator, const wxString& name) : clChoice(parent, id, pos, size, choices, style, validator, name) { EventNotifier::Get()->Bind(wxEVT_CL_THEME_CHANGED, &clThemedChoice::OnThemeChanged, this); ApplyTheme(); }
status_t WinampSkinThemesAddon::ApplyDefaultTheme(uint32 flags) { BMessage theme; BMessage skin; skin.AddString("skin", "none"); theme.AddMessage(Z_THEME_WINAMP_SKIN_SETTINGS, &skin); return ApplyTheme(theme, flags); }
status_t ScreensaverThemesAddon::ApplyDefaultTheme(uint32 flags) { BMessage theme; BMessage screensaver; screensaver.AddString("screensaver:modulename", "Blackness"); theme.AddMessage(A_MSGNAME, &screensaver); return ApplyTheme(theme, flags); }
status_t SoundplayThemesAddon::ApplyDefaultTheme(uint32 flags) { BMessage theme; BMessage uisettings; rgb_color bg = {216, 216, 216, 255}; AddRGBColor(uisettings, B_UI_PANEL_BACKGROUND_COLOR, bg); theme.AddMessage(Z_THEME_UI_SETTINGS, &uisettings); return ApplyTheme(theme, flags); }
status_t BackgroundThemesAddon::ApplyDefaultTheme(uint32 flags) { BMessage theme; BMessage backgrounds; rgb_color col = {51,102,152,255}; // Be Blues... ;) backgrounds.AddBool(B_BACKGROUND_ERASE_TEXT, true); AddRGBColor(backgrounds, B__DESKTOP_COLOR, col); theme.AddMessage(A_MSGNAME, &backgrounds); return ApplyTheme(theme, flags); }
/* Apply a theme from a given theme, color and size combo box item index. */ static void do_apply_theme (HWND dialog, int themeIndex, int colorIndex, int sizeIndex) { static char b[] = "\0"; if (themeIndex == 0) { /* no theme */ ApplyTheme (NULL, b, NULL); } else { ThemeFile* theme = DSA_GetItemPtr (themeFiles, themeIndex-1); const WCHAR* themeFileName = theme->themeFileName; const WCHAR* colorName = NULL; const WCHAR* sizeName = NULL; HTHEMEFILE hTheme; ThemeColorOrSize* item; item = color_or_size_dsa_get (&theme->colors, colorIndex); colorName = item->name; item = color_or_size_dsa_get (&theme->sizes, sizeIndex); sizeName = item->name; if (SUCCEEDED (OpenThemeFile (themeFileName, colorName, sizeName, &hTheme, 0))) { ApplyTheme (hTheme, b, NULL); CloseThemeFile (hTheme); } else { ApplyTheme (NULL, b, NULL); } } refresh_sysparams(dialog); }
status_t PeThemesAddon::ApplyDefaultTheme(uint32 flags) { BMessage theme; BMessage uisettings; rgb_color bg = {255, 255, 255, 255}; rgb_color fg = {0, 0, 0, 255}; rgb_color selbg = {180, 200, 240, 255}; AddRGBColor(uisettings, B_UI_DOCUMENT_BACKGROUND_COLOR, bg); AddRGBColor(uisettings, B_UI_DOCUMENT_TEXT_COLOR, fg); AddRGBColor(uisettings, B_UI_DOCUMENT_SELECTION_BACKGROUND_COLOR, selbg); theme.AddMessage(Z_THEME_UI_SETTINGS, &uisettings); return ApplyTheme(theme, flags); }
bool CThemeManager::ApplyTheme(LPCWSTR pszFileName) { if (m_pApplier==nullptr) return false; CThemeSettings Theme; if (!TSTask::IsStringEmpty(pszFileName)) { if (!LoadTheme(pszFileName,&Theme)) return false; } return ApplyTheme(Theme); }
status_t TerminalThemesAddon::ApplyDefaultTheme(uint32 flags) { BMessage theme; BMessage termpref; // XXX: add font and stuff... AddRGBColor(termpref, "term:c:bg",make_color(255,255,255,0)); AddRGBColor(termpref, "term:c:fg",make_color(0,0,0,0)); AddRGBColor(termpref, "term:c:curbg",make_color(0,0,0,0)); AddRGBColor(termpref, "term:c:curfg",make_color(255,255,255,0)); AddRGBColor(termpref, "term:c:selbg",make_color(0,0,0,0)); AddRGBColor(termpref, "term:c:selfg",make_color(255,255,255,0)); theme.AddMessage(Z_THEME_TERMINAL_SETTINGS, &termpref); return ApplyTheme(theme, flags); }
status_t TerminalThemesAddon::ApplyDefaultTheme(uint32 flags) { BMessage theme; BMessage termpref; int32 i; // XXX: add font and stuff... for (i = 0; i < NENTS(sHaikuPrefsMapInt32); i++) { termpref.AddInt32(sHaikuPrefsMapInt32[i].name, sHaikuPrefsMapInt32[i].def); } for (i = 0; i < NENTS(sHaikuPrefsMapColors); i++) { AddRGBColor(termpref, sHaikuPrefsMapColors[i].name, sHaikuPrefsMapColors[i].def); } theme.AddMessage(Z_THEME_TERMINAL_SETTINGS, &termpref); return ApplyTheme(theme, flags); }
status_t UISettingsThemesAddon::ApplyDefaultTheme(uint32 flags) { BMessage theme; BMessage uisettings; BFont fnt; status_t err; err = get_default_settings(&uisettings); if (err) return err; // hack for legacy fonts err = BFont::GetStandardFont((font_which)(B_PLAIN_FONT-100), &fnt); uisettings.AddFlat("be:f:be_plain_font", &fnt); err = BFont::GetStandardFont((font_which)(B_BOLD_FONT-100), &fnt); uisettings.AddFlat("be:f:be_bold_font", &fnt); err = BFont::GetStandardFont((font_which)(B_FIXED_FONT-100), &fnt); uisettings.AddFlat("be:f:be_fixed_font", &fnt); theme.AddMessage(A_MSGNAME, &uisettings); return ApplyTheme(theme, flags); }
INT_PTR CALLBACK AppearancePageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { GLOBALS *g; LPNMHDR lpnm; g = (GLOBALS*)GetWindowLongPtr(hwndDlg, DWLP_USER); switch (uMsg) { case WM_INITDIALOG: return AppearancePage_OnInit(hwndDlg); case WM_DESTROY: AppearancePage_OnDestroy(hwndDlg, g); break; case WM_COMMAND: switch (LOWORD(wParam)) { case IDC_APPEARANCE_EFFECTS: if (DialogBoxParam(hApplet, MAKEINTRESOURCE(IDD_EFFAPPEARANCE), hwndDlg, EffAppearanceDlgProc, (LPARAM)g) == IDOK) { PropSheet_Changed(GetParent(hwndDlg), hwndDlg); g->Theme = g->ThemeAdv; g->bHasChanged = TRUE; // Effects dialog doesn't change the color scheme, therefore the following lines are commented out, until fixed finally //g->ThemeId = -1; /* Customized */ //SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_COLORSCHEME, CB_SETCURSEL, (WPARAM)-1, 0); //SetDlgItemText(hwndDlg, IDC_APPEARANCE_COLORSCHEME, TEXT("")); SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_PREVIEW, PVM_UPDATETHEME, 0, (LPARAM)&g->Theme); } break; case IDC_APPEARANCE_ADVANCED: if (DialogBoxParam(hApplet, MAKEINTRESOURCE(IDD_ADVAPPEARANCE), hwndDlg, AdvAppearanceDlgProc, (LPARAM)g) == IDOK) { PropSheet_Changed(GetParent(hwndDlg), hwndDlg); g->bHasChanged = TRUE; g->Theme = g->ThemeAdv; g->ThemeId = -1; /* Customized */ g_GlobalData.desktop_color = g->Theme.crColor[COLOR_DESKTOP]; SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_COLORSCHEME, CB_SETCURSEL, (WPARAM)-1, 0); SetDlgItemText(hwndDlg, IDC_APPEARANCE_COLORSCHEME, TEXT("")); SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_PREVIEW, PVM_UPDATETHEME, 0, (LPARAM)&g->Theme); } break; case IDC_APPEARANCE_COLORSCHEME: if (HIWORD(wParam) == CBN_SELCHANGE && !g->bInitializing) { THEME Theme; INT ThemeId = GetSelectedThemeId(hwndDlg); PropSheet_Changed(GetParent(hwndDlg), hwndDlg); g->bHasChanged = TRUE; if (ThemeId != -1 && LoadThemeFromReg(&Theme, ThemeId)) { g->Theme = Theme; g->ThemeId = ThemeId; g_GlobalData.desktop_color = g->Theme.crColor[COLOR_DESKTOP]; SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_PREVIEW, PVM_UPDATETHEME, 0, (LPARAM)&Theme); } } break; } break; case WM_NOTIFY: lpnm = (LPNMHDR)lParam; switch (lpnm->code) { case PSN_APPLY: if (g->bHasChanged) { INT ThemeId = GetSelectedThemeId(hwndDlg); ApplyTheme(&g->Theme, ThemeId); g->ThemeId = ThemeId; SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_PREVIEW, PVM_UPDATETHEME, 0, (LPARAM)&g->Theme); g->bHasChanged = FALSE; } SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, (LONG_PTR)PSNRET_NOERROR); return TRUE; case PSN_KILLACTIVE: SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, (LONG_PTR)FALSE); return TRUE; case PSN_SETACTIVE: if (g->Theme.crColor[COLOR_DESKTOP] != g_GlobalData.desktop_color) { g->Theme.crColor[COLOR_DESKTOP] = g_GlobalData.desktop_color; SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_PREVIEW, PVM_UPDATETHEME, 0, (LPARAM)&g->Theme); } break; } break; } return FALSE; }
status_t ThemesAddon::RestoreCurrent(BMessage &theme) { FENTRY; return ApplyTheme(theme); }
void clThemedChoice::OnThemeChanged(wxCommandEvent& event) { event.Skip(); ApplyTheme(); }