Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
5793 | leency | 1 | byte current_theme; |
2 | enum { |
||
3 | THEME_DARK, |
||
4 | THEME_LIGHT |
||
5 | }; |
||
6 | |||
5748 | leency | 7 | char config_section[] = "Config"; |
8 | |||
5465 | leency | 9 | void LoadIniConfig() |
10 | { |
||
5748 | leency | 11 | ini_get_int stdcall (#pixie_ini_path, #config_section, "current_theme", THEME_DARK); current_theme = EAX; |
12 | ini_get_int stdcall (#pixie_ini_path, #config_section, "window_mode", WINDOW_MODE_NORMAL); window_mode = EAX; |
||
13 | ini_get_int stdcall (#pixie_ini_path, #config_section, "win_x_normal", 100); win_x_normal = EAX; |
||
14 | ini_get_int stdcall (#pixie_ini_path, #config_section, "win_y_normal", 90); win_y_normal = EAX; |
||
15 | ini_get_int stdcall (#pixie_ini_path, #config_section, "win_x_small", -1); win_x_small = EAX; |
||
16 | ini_get_int stdcall (#pixie_ini_path, #config_section, "win_y_small", -1); win_y_small = EAX; |
||
17 | ini_get_str stdcall (#pixie_ini_path, #config_section, "last_folder", #work_folder, sizeof(work_folder), 0); |
||
5509 | leency | 18 | |
5465 | leency | 19 | if (current_theme == THEME_DARK) SetColorThemeDark(); else SetColorThemeLight(); |
5509 | leency | 20 | if (win_x_small==-1) win_x_small = 2000; |
21 | if (win_y_small==-1) win_y_small = GetClientHeight() - skin.h + 1; |
||
5465 | leency | 22 | } |
23 | |||
24 | void SaveIniConfig() |
||
25 | { |
||
5509 | leency | 26 | if (window_mode == WINDOW_MODE_NORMAL) |
27 | { |
||
28 | win_x_normal = Form.left; |
||
29 | win_y_normal = Form.top; |
||
30 | } |
||
31 | if (window_mode == WINDOW_MODE_SMALL) |
||
32 | { |
||
33 | win_x_small = Form.left; |
||
34 | win_y_small = Form.top; |
||
35 | } |
||
5748 | leency | 36 | ini_set_int stdcall (#pixie_ini_path, #config_section, "current_theme", current_theme); |
37 | ini_set_int stdcall (#pixie_ini_path, #config_section, "window_mode", window_mode); |
||
38 | ini_set_int stdcall (#pixie_ini_path, #config_section, "win_x_normal", win_x_normal); |
||
39 | ini_set_int stdcall (#pixie_ini_path, #config_section, "win_y_normal", win_y_normal); |
||
40 | ini_set_int stdcall (#pixie_ini_path, #config_section, "win_x_small", win_x_small); |
||
41 | ini_set_int stdcall (#pixie_ini_path, #config_section, "win_y_small", win_y_small); |
||
42 | ini_set_str stdcall (#pixie_ini_path, #config_section, "last_folder", #work_folder, strlen(#work_folder)); |
||
5465 | leency | 43 | } |
44 | |||
45 | struct struct_pixie_colors { |
||
46 | dword color_top_panel_text, |
||
47 | color_list_bg, |
||
48 | color_list_text, |
||
49 | color_list_active_bg, |
||
50 | color_list_active_text, |
||
51 | color_list_active_pointer, |
||
52 | color_list_scroller, |
||
53 | color_list_border; |
||
54 | } theme; |
||
55 | |||
56 | |||
57 | void SetColorThemeDark() |
||
58 | { |
||
59 | current_theme = THEME_DARK; |
||
5468 | leency | 60 | Libimg_LoadImage(#skin, abspath("s_dark.png")); |
5465 | leency | 61 | skin.w = 300; |
62 | theme.color_top_panel_text = 0xFCFFBE; |
||
63 | theme.color_list_bg = 0x313031; |
||
64 | theme.color_list_text = 0xADAEAD; |
||
65 | theme.color_list_active_bg = 0x434343; |
||
66 | theme.color_list_active_text = 0xADAEAD; |
||
67 | theme.color_list_active_pointer = 0xD6D6D6; |
||
68 | theme.color_list_scroller = 0xBBBbbb; |
||
69 | theme.color_list_border = 0x121212; |
||
70 | scroll1.bckg_col = theme.color_list_bg; |
||
71 | scroll1.frnt_col = theme.color_list_border; |
||
72 | scroll1.line_col = theme.color_list_border; |
||
5793 | leency | 73 | draw_window(); |
5465 | leency | 74 | } |
75 | |||
76 | |||
77 | void SetColorThemeLight() |
||
78 | { |
||
79 | current_theme = THEME_LIGHT; |
||
5468 | leency | 80 | Libimg_LoadImage(#skin, abspath("s_light.png")); |
5465 | leency | 81 | skin.w = 300; |
82 | theme.color_top_panel_text = 0x85663F; |
||
83 | theme.color_list_bg = 0xE2E2E2; |
||
84 | theme.color_list_text = 0x595959; |
||
85 | theme.color_list_active_bg = 0xFAF3AF; |
||
86 | theme.color_list_active_text = 0x85663F; |
||
87 | theme.color_list_active_pointer = 0x85663F; |
||
88 | theme.color_list_scroller = 0xBBBbbb; |
||
89 | theme.color_list_border = 0x736D65; |
||
90 | scroll1.bckg_col = theme.color_list_bg; |
||
91 | scroll1.frnt_col = theme.color_list_border; |
||
92 | scroll1.line_col = theme.color_list_border; |
||
5793 | leency | 93 | draw_window(); |
5465 | leency | 94 | } |