From 9a77b80fd054995ce427ed69e55192afe97a05d7 Mon Sep 17 00:00:00 2001 From: "Kirill Lipatov (Leency)" Date: Wed, 23 Nov 2016 23:47:37 +0000 Subject: [PATCH] TextReader: bug fixed, toolbar updated and decreased size, increased size between lines git-svn-id: svn://kolibrios.org@6753 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/cmm/textreader/gui.h | 4 ++-- programs/cmm/textreader/prepare_page.h | 4 ++-- programs/cmm/textreader/textreader.c | 3 ++- programs/cmm/textreader/toolbar.png | Bin 637 -> 566 bytes 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/programs/cmm/textreader/gui.h b/programs/cmm/textreader/gui.h index 5d81fb3c7f..6682fa92da 100644 --- a/programs/cmm/textreader/gui.h +++ b/programs/cmm/textreader/gui.h @@ -1,7 +1,7 @@ void DrawToolbarButton(char image_id, int x) { - DefineButton(x, 5, TOOLBAR_ICON_WIDTH-1, TOOLBAR_ICON_HEIGHT-1, 10+image_id + BT_HIDE, 0); - img_draw stdcall(skin.image, x, 5, TOOLBAR_ICON_WIDTH, TOOLBAR_ICON_HEIGHT, 0, image_id*TOOLBAR_ICON_HEIGHT); + DefineButton(x+1, 7, TOOLBAR_ICON_WIDTH-2, TOOLBAR_ICON_HEIGHT-2, 10+image_id + BT_HIDE, 0); + img_draw stdcall(skin.image, x, 6, TOOLBAR_ICON_WIDTH, TOOLBAR_ICON_HEIGHT, 0, image_id*TOOLBAR_ICON_HEIGHT); } diff --git a/programs/cmm/textreader/prepare_page.h b/programs/cmm/textreader/prepare_page.h index 196a0427c6..f0ebbbe14e 100644 --- a/programs/cmm/textreader/prepare_page.h +++ b/programs/cmm/textreader/prepare_page.h @@ -44,7 +44,7 @@ dword line_start=io.buffer_data; } } } - if (mode==COUNT_BUF_HEIGHT) list.count++; + if (mode==COUNT_BUF_HEIGHT) list.count+=2; if (mode==DRAW_BUF) label.write_buf(8,stroka_y,list.w,label.size.height, 0xFFFFFF, 0, label.size.pt, line_start); } @@ -61,7 +61,7 @@ void PreparePage() Parcer(COUNT_BUF_HEIGHT); //draw text in buffer - list.SetSizes(0, TOOLBAR_H, list.w, Form.cheight-TOOLBAR_H, label.size.pt+1); + list.SetSizes(0, TOOLBAR_H, list.w, Form.cheight-TOOLBAR_H, label.size.pt+3); if (list.count < list.visible) list.count = list.visible; label.size.height = list.count+1*list.item_h; label.raw_size = 0; diff --git a/programs/cmm/textreader/textreader.c b/programs/cmm/textreader/textreader.c index 3262bd424c..73c99727b8 100644 --- a/programs/cmm/textreader/textreader.c +++ b/programs/cmm/textreader/textreader.c @@ -19,7 +19,7 @@ #define DEFAULT_EDITOR "/sys/tinypad" #define INTRO_TEXT "This is a plain Text Reader.\nTry to open some text file." -#define VERSION "Text Reader v1.1" +#define VERSION "Text Reader v1.2" #define ABOUT "Idea: Leency, punk_joker Code: Leency, Veliant, KolibriOS Team @@ -96,6 +96,7 @@ void main() encoding = menu.list.cur_y - 10; OpenFile(#param); PreparePage(); + menu.list.cur_y = NULL; }; draw_window(); } diff --git a/programs/cmm/textreader/toolbar.png b/programs/cmm/textreader/toolbar.png index d442e641c081eb4eae8ab951f4aed0813c93bc23..bd3bc923fb9dbe21100d01c68ab37328e35ca2a4 100644 GIT binary patch delta 552 zcmV+@0@wZh1hxc_8Gi!+001Gsi$VYZ00d`2O+f$vv5yPIpp!NI|XhK84ymv?t}%gf8`?CgMmfLvT$ z8Lr+y0004}NklypAC422;=2)Dlf<8JK5hBh#|tADFA=8t1PXw&302NTe$ zfx%$8s8P_^i&4YdzaWG;P(c7Ec0^)D2f-I0>{sLI{n8OSJu;es*sSfNm+3IXYmH(! zp+Z2IGxASqQAufC9#Sd|qU3K6NhDE#uqUwm*-#{z97Wk>`5|y)CCWkrCf|$tHyorf zNSft(3bkHoN>Z@wI7g>XaslB21Z;MU>Eupbd-HnATW65v2OO9Davj!Xe z8yaIjwx~ml2{R_KF=Jwakgt%CuPR98DJonzmnrV`hQvF2y>W?Zyw9>?&%8C1LQK4mc!hM>q9B>lLIYT& zw8$u3A$i~xQ!@X6|NmtKSuii+m0SRd=ZPxz#G^=UL_MCsPYHNDQA*qtm$GpA@&bPr z)f5%zaPf5n%74)z|A2;xR#}IP8Ft8+VTX(vbSUVrJ2d%#CSQg~PmocEj8$2OCb1R& zE*GELri|#J-<1_Rw|nmy(jj8|B<9xNgCqcaxoa!p@`emz^uT7%4oY3H1 zJ0c$*Q-UTqiOXQU`3iC$SCml*1dlKf>NJ+@y zt`E1lIb{-Z$ib~g5ayOV-1YvD_2`F(x019dA&0HUKC~UDZAfw?MMy^orKrgCWsZtO zV~H9nq-ev})(1n4T$0*0&RUP%i%tuXsoQF`PJBt}6;D_T`{L3-er@=hbq0xh1ulqvRYYp`8&8@@>(rtW_bVr002ov JPDHLkV1gCyEZhJ9