barscfg: add options to enable and disable @taskbar and @docky

icons32.png: new library icon
other small fixes

git-svn-id: svn://kolibrios.org@7636 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Kirill Lipatov (Leency) 2019-04-22 18:19:43 +00:00
parent f9e2c34b31
commit c4eca65496
6 changed files with 129 additions and 68 deletions

View File

@ -172,6 +172,7 @@ extra_files = {
{"kolibrios/utils/cnc_editor/kolibri.NC", PROGS .. "/other/cnc_editor/kolibri.NC"}, {"kolibrios/utils/cnc_editor/kolibri.NC", PROGS .. "/other/cnc_editor/kolibri.NC"},
{"kolibrios/emul/dosbox/", "common/emul/DosBox/*"}, {"kolibrios/emul/dosbox/", "common/emul/DosBox/*"},
{"kolibrios/emul/e80/readme.txt", PROGS .. "/emulator/e80/trunk/readme.txt"}, {"kolibrios/emul/e80/readme.txt", PROGS .. "/emulator/e80/trunk/readme.txt"},
{"kolibrios/emul/e80/keyboard.png", PROGS .. "/emulator/e80/trunk/keyboard.png"},
{"kolibrios/emul/fceu/fceu", PROGS .. "/emulator/fceu/fceu"}, {"kolibrios/emul/fceu/fceu", PROGS .. "/emulator/fceu/fceu"},
{"kolibrios/emul/fceu/FCEU ReadMe.txt", PROGS .. "/emulator/fceu/FCEU ReadMe.txt"}, {"kolibrios/emul/fceu/FCEU ReadMe.txt", PROGS .. "/emulator/fceu/FCEU ReadMe.txt"},
{"kolibrios/emul/", "common/emul/gameboy"}, {"kolibrios/emul/", "common/emul/gameboy"},

View File

@ -174,25 +174,21 @@ mgb=47
<dir>=45 <dir>=45
<up>=45 <up>=45
<lot>=60 <lot>=60
txt=9 com=1
png=70 bat=1
jpg=70 sh=1
jpeg=70 exe=2
bmp=70
gif=70
pcx=70
log=55
zip=89
7z=89
img=3 img=3
3ds=78 ini=5
txt=9
lif=13
csv=28
xls=28 xls=28
xlsx=28 xlsx=28
pdf=73 vox=30
wav=64 htm=31
mp3=64 html=31
midi=74 sys=38
mnt=90
avi=40 avi=40
mpg=40 mpg=40
mpe=40 mpe=40
@ -206,25 +202,31 @@ mp4=40
vob=40 vob=40
webm=40 webm=40
fb2=44 fb2=44
xm=65 asm=55
ini=5 log=55
wav=64
mp3=64
xm=64
png=70
jpg=70
jpeg=70
bmp=70
gif=70
pcx=70
pdf=73
mid=74
midi=74
mid=74
midi=74
3ds=78
stl=78
zip=89
7z=89
mnt=90
obj=92 obj=92
dll=92 dll=92
skn=80 skn=80
mid=74
midi=74
asm=55
kex=88 kex=88
sys=38
exe=2
com=1
bat=1
sh=1
vox=30
rft=85 rft=85
mobi=85
djvu=85
csv=28
rft=85 rft=85
lif=13 kf=118
stl=78

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 40 KiB

View File

@ -73,6 +73,9 @@ more_less_box tbPanelHeight = { NULL, 6, 99, PANEL_HEIGHT };
more_less_box tbSoftenHeight = { NULL, 0, 99, SOFTEN_HEIGHT }; more_less_box tbSoftenHeight = { NULL, 0, 99, SOFTEN_HEIGHT };
more_less_box tbButtonOffset = { NULL, 0, 99, BUTTON_OFFSET }; more_less_box tbButtonOffset = { NULL, 0, 99, BUTTON_OFFSET };
checkbox taskbar_on = 0;
checkbox docky_on = 0;
int tbAttachment; int tbAttachment;
checkbox tbSoftenUp = { SOFTEN_UP }; checkbox tbSoftenUp = { SOFTEN_UP };
checkbox tbClock = { CLOCK }; checkbox tbClock = { CLOCK };
@ -104,34 +107,37 @@ void main()
case evButton: case evButton:
id=GetButtonID(); id=GetButtonID();
if (1==id) ExitProcess(); if (1==id) ExitProcess();
//taskbar buttons
if (BTN_TB_ATTACHEMENT == id) {
tbAttachment ^= 1;
DrawWindowContent();
SaveSettingsAndRestartProcess(TASKBAR);
}
if (tbSoftenUp.click(id)) || (tbSoftenDown.click(id)) if (taskbar_on.checked) EventTaskbarProcessButton(id);
|| (tbMinLeftButton.click(id)) || (tbMinRightButton.click(id)) if (docky_on.checked) EventDockyProcessButton(id);
|| (tbRunApplButton.click(id)) || (tbClnDeskButton.click(id)) {
SaveSettingsAndRestartProcess(TASKBAR);
}
if (tbClock.click(id)) || (tbCpuUsage.click(id)) if (taskbar_on.click(id)) {
|| (tbChangeLang.click(id)) || (tbMenuButton.click(id)) IF (taskbar_on.checked == true) RunProgram("/sys/@taskbar", 0);
|| (tbPanelHeight.click(id)) || (tbSoftenHeight.click(id)) ELSE KillProcessByName("@TASKBAR", SINGLE);
|| (tbButtonOffset.click(id)) { EAX = taskbar_on.checked ^ 1;
SaveSettingsAndRestartProcess(TASKBAR); tbSoftenUp.disabled = EAX;
} tbSoftenDown.disabled = EAX;
//docky buttons tbMinLeftButton.disabled = EAX;
if (id==200) { tbMinRightButton.disabled = EAX;
dkLocation++; tbRunApplButton.disabled = EAX;
if (dkLocation>3) dkLocation=1; tbClnDeskButton.disabled = EAX;
tbClock.disabled = EAX;
tbCpuUsage.disabled = EAX;
tbChangeLang.disabled = EAX;
tbMenuButton.disabled = EAX;
tbPanelHeight.disabled = EAX;
tbSoftenHeight.disabled = EAX;
tbButtonOffset.disabled = EAX;
tbButtonOffset.disabled = EAX;
DrawWindowContent();
}
if (docky_on.click(id)) {
IF (docky_on.checked == true) RunProgram("/sys/@docky", 0);
ELSE KillProcessByName("@DOCKY", SINGLE);
dkFsize.disabled = docky_on.checked ^ 1;
dkAshow.disabled = docky_on.checked ^ 1;
DrawWindowContent(); DrawWindowContent();
SaveSettingsAndRestartProcess(DOCKY);
} }
if (dkFsize.click(id)) SaveSettingsAndRestartProcess(DOCKY);
if (dkAshow.click(id)) SaveSettingsAndRestartProcess(DOCKY);
break; break;
case evKey: case evKey:
@ -164,7 +170,7 @@ void DrawWindowContent()
y.n = frame_y; y.n = frame_y;
DefineButton(22, y.inc(18), PIMG_W-1, PIMG_H-1, 100 + BT_HIDE, 0); DefineButton(22, y.inc(18), PIMG_W-1, PIMG_H-1, 100 + BT_HIDE, 0);
DrawPanelsImage(y.n, tbAttachment); DrawPanelsImage(y.n, tbAttachment);
WriteText(68, y.inc(7), 0x90, system.color.work_text, CHANGE_POS); WriteTextWithBg(68, y.inc(7), 0xD0, system.color.work_text, CHANGE_POS, system.color.work);
tbSoftenUp.draw(22, y.inc(35)); tbSoftenUp.draw(22, y.inc(35));
tbClock.draw(win_center_x, y.n); tbClock.draw(win_center_x, y.n);
tbSoftenDown.draw(22, y.inc(24)); tbSoftenDown.draw(22, y.inc(24));
@ -177,14 +183,16 @@ void DrawWindowContent()
tbSoftenHeight.draw(22, y.inc(32)); tbSoftenHeight.draw(22, y.inc(32));
tbButtonOffset.draw(22, y.inc(32)); tbButtonOffset.draw(22, y.inc(32));
DrawFrame(PD, frame_y, Form.cwidth-PD-PD, y.inc(32)-frame_y, TASK_FRAME_T); DrawFrame(PD, frame_y, Form.cwidth-PD-PD, y.inc(32)-frame_y, TASK_FRAME_T);
taskbar_on.draw(22, frame_y-7);
//DOCKY //DOCKY
frame_y = calc(y.inc(20)); frame_y = calc(y.inc(20));
DefineButton(22, y.inc(18), PIMG_W-1, PIMG_H-1, 200 + BT_HIDE, 0); DefineButton(22, y.inc(18), PIMG_W-1, PIMG_H-1, 200 + BT_HIDE, 0);
DrawPanelsImage(y.n, dkLocation+1); DrawPanelsImage(y.n, dkLocation+1);
WriteText(68, y.inc(7), 0x90, system.color.work_text, CHANGE_POS); WriteTextWithBg(68, y.inc(7), 0xD0, system.color.work_text, CHANGE_POS, system.color.work);
dkFsize.draw(22, y.inc(35)); dkFsize.draw(22, y.inc(35));
dkAshow.draw(win_center_x, y.n); dkAshow.draw(win_center_x, y.n);
DrawFrame(PD, frame_y, Form.cwidth-PD-PD, Form.cheight-frame_y-PD, DOCK_FRAME_T); DrawFrame(PD, frame_y, Form.cwidth-PD-PD, Form.cheight-frame_y-PD, DOCK_FRAME_T);
docky_on.draw(22, frame_y-7);
} }
void LoadCfg() void LoadCfg()
@ -206,6 +214,9 @@ void LoadCfg()
dkLocation = docky_ini.GetInt("location", 0); dkLocation = docky_ini.GetInt("location", 0);
dkFsize.checked = docky_ini.GetInt("fsize", 0); dkFsize.checked = docky_ini.GetInt("fsize", 0);
dkAshow.checked = docky_ini.GetInt("ashow", 0); dkAshow.checked = docky_ini.GetInt("ashow", 0);
taskbar_on.checked = CheckProcessExists("@TASKBAR");
docky_on.checked = CheckProcessExists("@DOCKY");
} }
void SaveSettingsAndRestartProcess(byte panel_type) void SaveSettingsAndRestartProcess(byte panel_type)
@ -252,6 +263,38 @@ void RestartProcess(byte panel_type)
ActivateWindow(GetProcessSlot(Form.ID)); ActivateWindow(GetProcessSlot(Form.ID));
} }
void EventTaskbarProcessButton(dword id)
{
if (BTN_TB_ATTACHEMENT == id) {
tbAttachment ^= 1;
DrawWindowContent();
SaveSettingsAndRestartProcess(TASKBAR);
}
if (tbSoftenUp.click(id)) || (tbSoftenDown.click(id))
|| (tbMinLeftButton.click(id)) || (tbMinRightButton.click(id))
|| (tbRunApplButton.click(id)) || (tbClnDeskButton.click(id)) {
SaveSettingsAndRestartProcess(TASKBAR);
}
if (tbClock.click(id)) || (tbCpuUsage.click(id))
|| (tbChangeLang.click(id)) || (tbMenuButton.click(id))
|| (tbPanelHeight.click(id)) || (tbSoftenHeight.click(id))
|| (tbButtonOffset.click(id)) {
SaveSettingsAndRestartProcess(TASKBAR);
}
}
void EventDockyProcessButton(dword id)
{
if (BTN_DOCKY_ATTACHEMENT == id) {
dkLocation++;
if (dkLocation>3) dkLocation=1;
DrawWindowContent();
SaveSettingsAndRestartProcess(DOCKY);
}
if (dkFsize.click(id)) || (dkAshow.click(id)) {
SaveSettingsAndRestartProcess(DOCKY);
}
}
stop: stop:

View File

@ -61,26 +61,28 @@ struct checkbox
:void checkbox::draw(dword _x,_y) :void checkbox::draw(dword _x,_y)
{ {
#define SIZE 14 #define SIZE 14
dword text_col = system.color.work_text;
if (!id) id = GetFreeButtonId(); if (!id) id = GetFreeButtonId();
x=_x; y=_y; x=_x; y=_y;
DefineButton(x-1, y-1, strlen(text)*8 + SIZE + 17, SIZE+2, id+BT_HIDE+BT_NOFRAME, 0); DefineButton(x-1, y-1, strlen(text)*8 + SIZE + 17, SIZE+2, id+BT_HIDE+BT_NOFRAME, 0);
WriteTextWithBg(x+SIZE+8, SIZE / 2 + y -7, 0xD0, system.color.work_text, text, system.color.work);
DrawRectangle(x, y, SIZE, SIZE, system.color.work_graph); DrawRectangle(x, y, SIZE, SIZE, system.color.work_graph);
if (disabled) if (disabled)
{ {
DrawRectangle(x+1, y+1, SIZE-2, SIZE-2, 0xffffff); DrawRectangle(x+1, y+1, SIZE-2, SIZE-2, 0xffffff);
DrawBar(x+2, y+2, SIZE-3, SIZE-3, 0xCCCccc); DrawBar(x+2, y+2, SIZE-3, SIZE-3, 0xCCCccc);
text_col = MixColors(system.color.work, system.color.work_text, 128);
} }
else if (checked == 0) else if (checked == false)
{ {
DrawRectangle3D(x+1, y+1, SIZE-2, SIZE-2, 0xDDDddd, 0xffffff); DrawRectangle3D(x+1, y+1, SIZE-2, SIZE-2, 0xDDDddd, 0xffffff);
DrawBar(x+2, y+2, SIZE-3, SIZE-3, 0xffffff); DrawBar(x+2, y+2, SIZE-3, SIZE-3, 0xffffff);
} }
else if (checked == 1) else if (checked == true)
{ {
_PutImage(x+1, y+1, 13, 13, #checkbox_flag); _PutImage(x+1, y+1, 13, 13, #checkbox_flag);
} }
if (text) WriteTextWithBg(x+SIZE+8, SIZE / 2 + y -7, 0xD0, text_col, text, system.color.work);
DrawRectangle3D(x-1,y-1,SIZE+2,SIZE+2,system.color.work_dark,system.color.work_light); DrawRectangle3D(x-1,y-1,SIZE+2,SIZE+2,system.color.work_dark,system.color.work_light);
} }

View File

@ -5,6 +5,7 @@
int click_delta; int click_delta;
int x,y; int x,y;
unsigned id_inc, id_dec; unsigned id_inc, id_dec;
bool disabled;
void check_values(); void check_values();
bool click(); bool click();
bool inc(); bool inc();
@ -41,6 +42,7 @@
{ {
#define VALUE_FIELD_W 34 #define VALUE_FIELD_W 34
#define SIZE 18 #define SIZE 18
dword text_col = system.color.work_text;
dword value_text = itoa(value); dword value_text = itoa(value);
check_values(); check_values();
@ -48,12 +50,23 @@
DrawRectangle(x, y, VALUE_FIELD_W+1, SIZE, system.color.work_graph); DrawRectangle(x, y, VALUE_FIELD_W+1, SIZE, system.color.work_graph);
DrawRectangle3D(x+1, y+1, VALUE_FIELD_W-2, SIZE-2, 0xDDDddd, 0xffffff); DrawRectangle3D(x+1, y+1, VALUE_FIELD_W-2, SIZE-2, 0xDDDddd, 0xffffff);
if (disabled)
{
DrawRectangle(x+1, y+1, VALUE_FIELD_W-2, SIZE-2, 0xffffff);
DrawBar(x+2, y+2, VALUE_FIELD_W-3, SIZE-3, 0xCCCccc);
text_col = MixColors(system.color.work, system.color.work_text, 128);
}
else
{
DrawBar(x+2, y+2, VALUE_FIELD_W-3, SIZE-3, 0xffffff); DrawBar(x+2, y+2, VALUE_FIELD_W-3, SIZE-3, 0xffffff);
}
WriteText( -strlen(value_text)+3*8 + x+6, SIZE / 2 + y -6, 0x90, 0x333333, value_text); WriteText( -strlen(value_text)+3*8 + x+6, SIZE / 2 + y -6, 0x90, 0x333333, value_text);
DrawCaptButton(VALUE_FIELD_W + x + 1, y, SIZE, SIZE, id_inc, system.color.work_button, system.color.work_button_text, "+"); DrawCaptButton(VALUE_FIELD_W + x + 1, y, SIZE, SIZE, id_inc, system.color.work_button, system.color.work_button_text, "+");
DrawCaptButton(VALUE_FIELD_W + x + SIZE, y, SIZE, SIZE, id_dec, system.color.work_button, system.color.work_button_text, "-"); DrawCaptButton(VALUE_FIELD_W + x + SIZE, y, SIZE, SIZE, id_dec, system.color.work_button, system.color.work_button_text, "-");
WriteTextWithBg(x+VALUE_FIELD_W+SIZE+SIZE+10, SIZE / 2 + y -7, 0xD0, system.color.work_text, text, system.color.work); WriteTextWithBg(x+VALUE_FIELD_W+SIZE+SIZE+10, SIZE / 2 + y -7, 0xD0, text_col, text, system.color.work);
DrawRectangle3D(x-1,y-1,VALUE_FIELD_W+SIZE+SIZE+2,SIZE+2,system.color.work_dark,system.color.work_light); DrawRectangle3D(x-1,y-1,VALUE_FIELD_W+SIZE+SIZE+2,SIZE+2,system.color.work_dark,system.color.work_light);
} }