Rev 9602 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
5416 | punk_joker | 1 | |
8947 | leency | 2 | _ini ini; |
3 | |||
4 | |||
7252 | leency | 5 | edit_box path_start_ed = {290,50,57,0xffffff,0x94AECE,0xffffff,0xffffff,0x10000000,4098, |
7227 | leency | 6 | #path_start,0, 100000000000010b,0,0}; |
7252 | leency | 7 | |
6403 | punk_joker | 8 | |
7244 | leency | 9 | more_less_box line_height = { NULL, 16, 64, LIST_LINE_HEIGHT }; |
7243 | leency | 10 | checkbox show_dev_name = { SHOW_DEVICE_CLASS }; |
7244 | leency | 11 | checkbox show_status_bar = { SHOW_STATUS_BAR }; |
12 | checkbox big_icons = { BIG_ICONS }; |
||
13 | checkbox colored_lines = { COLORED_LINES }; |
||
7422 | leency | 14 | |
7243 | leency | 15 | |
16 | |||
5416 | punk_joker | 17 | { |
18 | proc_info Settings; |
||
7254 | leency | 19 | int id; |
7244 | leency | 20 | active_settings = true; |
8764 | leency | 21 | font_size.value = kfont.size.pt; |
7243 | leency | 22 | line_height.value = files.item_h; |
7252 | leency | 23 | SetEventMask(0x27); |
6403 | punk_joker | 24 | loop(){ |
5576 | pavelyakov | 25 | switch(WaitEvent()) |
5591 | pavelyakov | 26 | { |
27 | case evMouse: |
||
6403 | punk_joker | 28 | edit_box_mouse stdcall (#path_start_ed); |
29 | break; |
||
30 | |||
31 | |||
5591 | pavelyakov | 32 | id=GetButtonID(); |
5416 | punk_joker | 33 | if (1==id) { ExitSettings(); break; } |
7244 | leency | 34 | else if (id==5) |
5591 | pavelyakov | 35 | { |
5435 | leency | 36 | RunProgram("/sys/@open", "/sys/settings/assoc.ini"); |
8764 | leency | 37 | break; |
5463 | leency | 38 | } |
5435 | leency | 39 | else if (id==6) |
5833 | pavelyakov | 40 | { |
41 | strcpy(#path_start,path); |
||
8949 | leency | 42 | path_start_ed.size = path_start_ed.pos = strlen(#path_start); |
7245 | leency | 43 | ini.SetString("DefaultPath", path, strlen(path)); |
8949 | leency | 44 | edit_box_draw stdcall (#path_start_ed); |
6403 | punk_joker | 45 | break; |
5833 | pavelyakov | 46 | } |
47 | else if (id==7) |
||
6403 | punk_joker | 48 | { |
49 | SetDefaultPath(#path_start); |
||
7462 | leency | 50 | break; |
6403 | punk_joker | 51 | } |
52 | show_dev_name.click(id); |
||
7244 | leency | 53 | show_status_bar.click(id); |
54 | colored_lines.click(id); |
||
7422 | leency | 55 | if (font_size.click(id)) { |
7244 | leency | 56 | kfont.size.pt = font_size.value; |
7243 | leency | 57 | kfont.changeSIZE(); |
58 | BigFontsChange(); |
||
59 | } |
||
60 | if (line_height.click(id)) files.item_h = files_inactive.item_h = line_height.value; |
||
7375 | leency | 61 | if (big_icons.click(id)) BigIconsSwitch(); |
7244 | leency | 62 | EventRedrawWindow(Form.left,Form.top); |
5606 | pavelyakov | 63 | //RefreshWindow(Form.slot, Settings.slot); |
7266 | leency | 64 | break; |
6403 | punk_joker | 65 | |
5591 | pavelyakov | 66 | |
67 | GetKeys(); |
||
5707 | leency | 68 | if (key_scancode==SCAN_CODE_ESC) ExitSettings(); |
5743 | leency | 69 | edit_box_key_c stdcall (#path_start_ed,key_ascii << 8); |
9727 | Coldy | 70 | break; |
5416 | punk_joker | 71 | |
5591 | pavelyakov | 72 | |
73 | DefineAndDrawWindow(Form.cwidth-300/2+Form.left, Form.cheight-292/2+Form.top, 400, |
||
7242 | leency | 74 | -efm*42+345+skin_h,0x34,sc.work,TITLE_SETT,0); |
9597 | leency | 75 | GetProcessInfo(#Settings, SelfInfo); |
7254 | leency | 76 | DrawSettingsCheckBoxes(); |
5463 | leency | 77 | } |
5591 | pavelyakov | 78 | } |
5416 | punk_joker | 79 | } |
5428 | leency | 80 | |
81 | |||
5743 | leency | 82 | { |
83 | active_settings = false; |
||
8764 | leency | 84 | settings_window = 0; |
5743 | leency | 85 | cmd_free = 4; |
86 | ExitProcess(); |
||
87 | } |
||
88 | |||
89 | |||
5463 | leency | 90 | { |
91 | incn y; |
||
6289 | leency | 92 | int but_x; |
8871 | leency | 93 | #define FRX 26 |
94 | #define XXX 11 |
||
95 | y.n = 0; |
||
6289 | leency | 96 | if (!efm) { |
8949 | leency | 97 | show_dev_name.draw(XXX, y.inc(14)); |
98 | show_status_bar.draw(XXX, y.inc(25)); |
||
99 | } |
||
100 | big_icons.draw(XXX, y.inc(25)); |
||
8871 | leency | 101 | colored_lines.draw(XXX, y.inc(25)); |
102 | font_size.draw(XXX, y.inc(31)); |
||
103 | line_height.draw(XXX, y.inc(31)); |
||
104 | |||
7227 | leency | 105 | |
8871 | leency | 106 | // START_PATH { |
7227 | leency | 107 | DrawEditBoxPos(FRX, y.inc(21), #path_start_ed); |
8871 | leency | 108 | but_x = DrawStandartCaptButton(FRX, y.inc(34), 6, SAVE_PATH_AS_DEFAULT); |
109 | DrawStandartCaptButton(FRX+but_x, y.inc(0), 7, SAVE_START_PATH_AS_DEFAULT); |
||
110 | // } START_PATH |
||
7227 | leency | 111 | |
112 | |||
8871 | leency | 113 | } |
5463 | leency | 114 | |
5428 | leency | 115 | |
5463 | leency | 116 | |
5441 | leency | 117 | { |
5428 | leency | 118 | ini.path = GetIni(#eolite_ini_path, "app.ini"); |
7429 | leency | 119 | if (efm) ini.section = "EFM"; else ini.section = "Eolite"; |
8764 | leency | 120 | |
7202 | leency | 121 | |
8946 | leency | 122 | show_dev_name.checked = ini.GetInt("ShowDeviceName", true); |
7244 | leency | 123 | show_status_bar.checked = ini.GetInt("ShowStatusBar", true); |
124 | big_icons.checked = ini.GetInt("BigIcons", false); BigIconsSwitch(); |
||
7375 | leency | 125 | colored_lines.checked = ini.GetInt("ColoredLines", true); |
8826 | leency | 126 | kfont.size.pt = ini.GetInt("FontSize", 13); |
7202 | leency | 127 | files.item_h = ini.GetInt("LineHeight", 19); |
128 | Form.left = ini.GetInt("WinX", 100); |
||
8764 | leency | 129 | Form.top = ini.GetInt("WinY", 30); |
130 | Form.width = ini.GetInt("WinW", efm*170+550); |
||
131 | Form.height = ini.GetInt("WinH", efm*100+517); |
||
8826 | leency | 132 | ini.GetString("DefaultPath", #path_start, 4096, "/sys"); |
8981 | leency | 133 | path_start_ed.size = path_start_ed.pos = strlen(#path_start); |
7252 | leency | 134 | kfont.init(DEFAULT_FONT); |
8868 | leency | 135 | ini_get_str stdcall ("/sys/SETTINGS/SYSTEM.INI", "system", "font smoothing",#temp,4096,"on"); |
5974 | leency | 136 | if(streq(#temp,"off")) kfont.smooth = false; else kfont.smooth = true; |
8868 | leency | 137 | } |
5428 | leency | 138 | |
139 | |||
5687 | leency | 140 | |
5441 | leency | 141 | { |
142 | ini.SetInt("ShowDeviceName", show_dev_name.checked); |
||
7244 | leency | 143 | ini.SetInt("ShowStatusBar", show_status_bar.checked); |
144 | ini.SetInt("BigIcons", big_icons.checked); |
||
7375 | leency | 145 | ini.SetInt("ColoredLines", colored_lines.checked); |
7422 | leency | 146 | ini.SetInt("FontSize", kfont.size.pt); |
147 | ini.SetInt("LineHeight", files.item_h); |
||
7202 | leency | 148 | if (Form.status_window<=2) { |
8764 | leency | 149 | ini.SetInt("WinX", Form.left); |
150 | ini.SetInt("WinY", Form.top); |
||
151 | ini.SetInt("WinW", Form.width); |
||
152 | ini.SetInt("WinH", Form.height); |
||
153 | } |
||
154 | } |
||
5441 | leency | 155 | |
5428 | leency | 156 | |
5441 | leency | 157 | |
158 | |||
5428 | leency | 159 | { |
160 | char error_message[500]; |
||
161 | sprintf(#error_message,"\"Eolite\n%s\" -tE", get_error(error_number)); |
||
9439 | leency | 162 | notify(#error_message); |
5620 | leency | 163 | } |
5428 | leency | 164 | |
165 | |||
166 | |||
7635 | leency | 167 | { |
168 | dword selected_shadow = MixColors(col.selec, 0, 200); |
||
8780 | leency | 169 | dword non_white_shadow = MixColors(col.list_bg, 0, 200); |
170 | if (big_icons.checked) |
||
171 | { |
||
172 | icons32_default.load("/sys/icons32.png"); |
||
7992 | leency | 173 | icons32_selected.load("/sys/icons32.png"); |
174 | //FUUUUUU... the next ugly code may replace the previous line |
||
8780 | leency | 175 | //we are copying raw data without loading and unpycking PNG |
176 | //memmov(icons32_selected.imgsrc, icons32_default.imgsrc, icons32_default.h*32*4); |
||
177 | //EDI = icons32_selected.image; |
||
178 | //ESDWORD[EDI+04] = 32; |
||
179 | //ESDWORD[EDI+08] = icons32_default.h; |
||
180 | //ESDWORD[EDI+20] = IMAGE_BPP32; |
||
181 | //ESDWORD[EDI+24] = icons32_selected.imgsrc; |
||
182 | icons32_default.replace_color(0x00000000, col.list_bg); |
||
7992 | leency | 183 | icons32_selected.replace_color(0x00000000, col.selec); |
8780 | leency | 184 | } else { |
185 | icons16_default.load("/sys/icons16.png"); |
||
186 | icons16_selected.load("/sys/icons16.png"); |
||
187 | icons16_selected.replace_2colors(0xffFFFfff, col.selec, 0xffCACBD6, selected_shadow); |
||
188 | if (col.list_bg!=0xFFFfff) { |
||
189 | icons16_default.replace_2colors(0xffFFFfff, col.list_bg, 0xffCACBD6, non_white_shadow); |
||
8847 | leency | 190 | } |
8780 | leency | 191 | } |
7992 | leency | 192 | |
8780 | leency | 193 | |
7635 | leency | 194 | |
195 | |||
5428 | leency | 196 | { |
197 | int i; |
||
7462 | leency | 198 | static dword bg_col; |
7806 | leency | 199 | dword old_list_bg_color = col.list_bg; |
200 | sc.get(); |
||
201 | sc.dark = MixColors(0, sc.work, 35); |
||
9602 | leency | 202 | if (sc.work == 0) sc.work = 1; |
7928 | leency | 203 | if (bg_col == sc.work) return; |
7806 | leency | 204 | bg_col = sc.work; |
205 | if (skin_is_dark()) |
||
7780 | leency | 206 | { |
7634 | leency | 207 | //use dark colors |
208 | col.skin_is_dark = true; |
||
8953 | leency | 209 | col.list_bg = sc.work; |
7806 | leency | 210 | col.list_gb_text = sc.work_text; |
211 | col.list_text_hidden = 0xA6A6B7; |
||
7634 | leency | 212 | col.list_vert_line = sc.line; |
9602 | leency | 213 | col.lpanel = MixColors(sc.line, sc.work, 65); |
214 | col.selec = col.selec_active = sc.button; |
||
7806 | leency | 215 | col.selec_text = sc.button_text; |
216 | if (col.list_bg==col.selec) col.selec = sc.line; //for fucking skins |
||
9602 | leency | 217 | col.slider_bg_big = MixColors(0xCED0D0, sc.work, 35); |
7806 | leency | 218 | col.odd_line = MixColors(0xFFFfff, sc.work, 15); |
219 | for (i=0; blue_hl_pal[i]!=0; i++) waves_pal[i] = MixColors(col.lpanel, blue_hl_pal[i], 180); |
||
8240 | leency | 220 | } |
7634 | leency | 221 | else |
7780 | leency | 222 | { |
223 | //use light colors |
||
224 | col.skin_is_dark = false; |
||
8953 | leency | 225 | col.list_bg = 0xFFFfff; |
7780 | leency | 226 | col.list_gb_text = 0x000000; |
227 | col.list_text_hidden = 0xA6A6B7; |
||
228 | col.list_vert_line = 0xDDD7CF; |
||
229 | col.lpanel = 0x00699C; |
||
230 | if (efm) EBX = 0x84BEFB; else EBX = 0x92B1D9; |
||
9581 | leency | 231 | col.selec = col.selec_active = EBX; |
232 | col.selec_text = 0x000000; |
||
7780 | leency | 233 | col.slider_bg_big = 0xCDCFCF; |
234 | col.odd_line = 0xF4F5F5; |
||
8779 | leency | 235 | for (i=0; blue_hl_pal[i]!=0; i++) waves_pal[i] = blue_hl_pal[i]; |
8240 | leency | 236 | } |
7780 | leency | 237 | col.selec_inactive = MixColors(0xBBBbbb, col.list_bg, 65); |
7634 | leency | 238 | col.slider_bg_left = MixColors(sc.line, col.slider_bg_big, 10); |
9602 | leency | 239 | for (i=0; i<20; i++) col.work_gradient[i] = MixColors(sc.light, sc.work, i*5); |
240 | if (old_list_bg_color!=col.list_bg) LoadIcons(); |
||
7635 | leency | 241 | } |
5463 | leency | 242 | |
243 | |||
244 | |||
5687 | leency | 245 | { |
246 | files.item_h = kfont.size.pt + 4; |
||
6806 | leency | 247 | if (files.item_h |
7375 | leency | 248 | files.item_h = icon_size+3; |
249 | line_height.value = files.item_h; |
||
250 | line_height.redraw(); |
||
251 | } |
||
252 | files_active.item_h = files_inactive.item_h = files.item_h; |
||
5825 | leency | 253 | } |
5687 | leency | 254 | |
7244 | leency | 255 | |
256 | { |
||
257 | if (big_icons.checked) { |
||
7992 | leency | 258 | icon_size = 32; |
8789 | leency | 259 | LoadIcons(); |
7992 | leency | 260 | } else { |
261 | icon_size = icons16_default.w; |
||
8789 | leency | 262 | } |
7992 | leency | 263 | BigFontsChange(); |
7375 | leency | 264 | } |
7244 | leency | 265 | |
7462 | leency | 266 | |
267 | { |
||
268 | ini.SetString("DefaultPath", p, strlen(p)); |
||
269 | notify("'Default path has been set' -O"); |
||
270 | }20;>=2)>><> |
||
271 |