Rev 5793 | Go to most recent revision | Details | Compare with Previous | 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 | |||
7051 | leency | 7 | char pathini[4096]; |
8 | _ini ini = { "/sys/media/pixie/pixie.ini", "Config" }; |
||
5748 | leency | 9 | |
5465 | leency | 10 | void LoadIniConfig() |
11 | { |
||
7051 | leency | 12 | dword temp = abspath("pixie.ini"); |
13 | strcpy(#pathini, temp); |
||
14 | ini.path = #pathini; |
||
15 | current_theme = ini.GetInt("current_theme", THEME_DARK); |
||
16 | window_mode = ini.GetInt("window_mode", WINDOW_MODE_NORMAL); |
||
17 | win_x_normal = ini.GetInt("win_x_normal", 100); |
||
18 | win_y_normal = ini.GetInt("win_y_normal", 90); |
||
19 | win_x_small = ini.GetInt("win_x_small", -1); |
||
20 | win_y_small = ini.GetInt("win_y_small", -1); |
||
21 | ini.GetString("last_folder", #work_folder, sizeof(work_folder), 0); |
||
5509 | leency | 22 | |
5465 | leency | 23 | if (current_theme == THEME_DARK) SetColorThemeDark(); else SetColorThemeLight(); |
5509 | leency | 24 | if (win_x_small==-1) win_x_small = 2000; |
25 | if (win_y_small==-1) win_y_small = GetClientHeight() - skin.h + 1; |
||
5465 | leency | 26 | } |
27 | |||
28 | void SaveIniConfig() |
||
29 | { |
||
5509 | leency | 30 | if (window_mode == WINDOW_MODE_NORMAL) |
31 | { |
||
32 | win_x_normal = Form.left; |
||
33 | win_y_normal = Form.top; |
||
34 | } |
||
35 | if (window_mode == WINDOW_MODE_SMALL) |
||
36 | { |
||
37 | win_x_small = Form.left; |
||
38 | win_y_small = Form.top; |
||
39 | } |
||
7051 | leency | 40 | ini.SetInt("current_theme", current_theme); |
41 | ini.SetInt("window_mode", window_mode); |
||
42 | ini.SetInt("win_x_normal", win_x_normal); |
||
43 | ini.SetInt("win_y_normal", win_y_normal); |
||
44 | ini.SetInt("win_x_small", win_x_small); |
||
45 | ini.SetInt("win_y_small", win_y_small); |
||
46 | ini.SetString("last_folder", #work_folder, strlen(#work_folder)); |
||
5465 | leency | 47 | } |
48 | |||
49 | struct struct_pixie_colors { |
||
50 | dword color_top_panel_text, |
||
51 | color_list_bg, |
||
52 | color_list_text, |
||
53 | color_list_active_bg, |
||
54 | color_list_active_text, |
||
55 | color_list_active_pointer, |
||
56 | color_list_scroller, |
||
57 | color_list_border; |
||
58 | } theme; |
||
59 | |||
60 | |||
61 | void SetColorThemeDark() |
||
62 | { |
||
63 | current_theme = THEME_DARK; |
||
5468 | leency | 64 | Libimg_LoadImage(#skin, abspath("s_dark.png")); |
5465 | leency | 65 | skin.w = 300; |
66 | theme.color_top_panel_text = 0xFCFFBE; |
||
67 | theme.color_list_bg = 0x313031; |
||
68 | theme.color_list_text = 0xADAEAD; |
||
69 | theme.color_list_active_bg = 0x434343; |
||
70 | theme.color_list_active_text = 0xADAEAD; |
||
71 | theme.color_list_active_pointer = 0xD6D6D6; |
||
72 | theme.color_list_scroller = 0xBBBbbb; |
||
73 | theme.color_list_border = 0x121212; |
||
74 | scroll1.bckg_col = theme.color_list_bg; |
||
75 | scroll1.frnt_col = theme.color_list_border; |
||
76 | scroll1.line_col = theme.color_list_border; |
||
5793 | leency | 77 | draw_window(); |
5465 | leency | 78 | } |
79 | |||
80 | |||
81 | void SetColorThemeLight() |
||
82 | { |
||
83 | current_theme = THEME_LIGHT; |
||
5468 | leency | 84 | Libimg_LoadImage(#skin, abspath("s_light.png")); |
5465 | leency | 85 | skin.w = 300; |
86 | theme.color_top_panel_text = 0x85663F; |
||
87 | theme.color_list_bg = 0xE2E2E2; |
||
88 | theme.color_list_text = 0x595959; |
||
89 | theme.color_list_active_bg = 0xFAF3AF; |
||
90 | theme.color_list_active_text = 0x85663F; |
||
91 | theme.color_list_active_pointer = 0x85663F; |
||
92 | theme.color_list_scroller = 0xBBBbbb; |
||
93 | theme.color_list_border = 0x736D65; |
||
94 | scroll1.bckg_col = theme.color_list_bg; |
||
95 | scroll1.frnt_col = theme.color_list_border; |
||
96 | scroll1.line_col = theme.color_list_border; |
||
5793 | leency | 97 | draw_window(); |
5465 | leency | 98 | } |