From d0ef324ddbe1681d538d1e2c6ff0bc069d618295 Mon Sep 17 00:00:00 2001 From: wp_xxyyzz Date: Sat, 17 Jun 2017 11:44:15 +0000 Subject: [PATCH] callite: New component palette icon, in particular for hi res screens. Replace lrs resource by res. Fix form scaling at high res. Remove folder icons (it is in image_sources now). Version 0.3.1. git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@5943 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- components/callite/README.txt | 7 ++++++- components/callite/callight_pkg.lpk | 5 ++++- components/callite/demo1/CalLiteTest.lpi | 2 +- components/callite/icon/TCALENDARLITE.PNG | Bin 886 -> 0 bytes components/callite/icon/icon-source.txt | 5 ----- components/callite/icon/make_lrs.bat | 1 - components/callite/source/calendarlite.pas | 12 +++++++----- components/callite/source/calendarlite_icon.res | Bin 0 -> 1641 bytes image_sources/ccr/components/callite/readme.txt | 2 +- 9 files changed, 19 insertions(+), 15 deletions(-) delete mode 100644 components/callite/icon/TCALENDARLITE.PNG delete mode 100644 components/callite/icon/icon-source.txt delete mode 100644 components/callite/icon/make_lrs.bat create mode 100644 components/callite/source/calendarlite_icon.res diff --git a/components/callite/README.txt b/components/callite/README.txt index 72eb305c1..18f01dcea 100644 --- a/components/callite/README.txt +++ b/components/callite/README.txt @@ -3,4 +3,9 @@ descendant which consequently is not dependent on any widgetset. It is not a fixed-size component, as are most calendars, but will align and resize as needed. -License: modified LGPL (with linking exception) \ No newline at end of file +License: modified LGPL (with linking exception) (the license same as Lazarus) + +The palette icon is taken from icons8.com +Download link: https://icons8.com/icon/12776/Calendar +The icons of icon8 have a "Creative Commons Attribution-NoDerivs 3.0 Unported" +license. \ No newline at end of file diff --git a/components/callite/callight_pkg.lpk b/components/callite/callight_pkg.lpk index e8498effb..81a9475d1 100644 --- a/components/callite/callight_pkg.lpk +++ b/components/callite/callight_pkg.lpk @@ -13,7 +13,7 @@ - + @@ -32,5 +32,8 @@ + + <_ExternHelp Items="Count"/> + diff --git a/components/callite/demo1/CalLiteTest.lpi b/components/callite/demo1/CalLiteTest.lpi index f990be5eb..2671a64f8 100644 --- a/components/callite/demo1/CalLiteTest.lpi +++ b/components/callite/demo1/CalLiteTest.lpi @@ -1,7 +1,7 @@ - + diff --git a/components/callite/icon/TCALENDARLITE.PNG b/components/callite/icon/TCALENDARLITE.PNG deleted file mode 100644 index 81ea0a4e9fb932bcf1664d7af9ee24c4f809545c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 886 zcmV-+1Bv{JP)w2nso@CahxA1w#@K zQP}rPr@CflvpYUAfh{O|+Uokgs;=rf~!qUThAE#1~%jhpC}T%QdE7@;-8p!4!IokuB<>T7K7eUD0ru@ zFKCD0f{&uW;rO^LY)V!?t`H1 zlYt!SgZ6f4XlQ`)iVE7>5vz|P%Ye8Joq%)7K*J1F)biO`a4s%FDjbI7@-qDH?1bvc z$!iG|tfSB8qi=yB;U01I42&3^nvucb&=7db${;Z_L#wv10J)kP_#crmgN%7aMhz5k zMS|p}5s9l{)ofmsDI5t9SD{Tn*O$D+A}|9KxlSt4!{8iBAq;DPND^I*@jppJa81)n zLLf)#Ohh3?w4!UonXT<@n4O;|+cb`pCpcan z4-V$f3oNsXiZW0wkz_Ht=S~~mzkuqtBceUl|2GoJw)&w|KKq8I2;Zd&!rH7 zB?x{9f)wYzBxCWQ+x-?wDENzZgxEJk0mO6l7%M9gzG%m!;Q1rK0AQyk%2*h))c^nh M07*qoM6N<$f_g`humAu6 diff --git a/components/callite/icon/icon-source.txt b/components/callite/icon/icon-source.txt deleted file mode 100644 index 6e404f59b..000000000 --- a/components/callite/icon/icon-source.txt +++ /dev/null @@ -1,5 +0,0 @@ -The TCalendarLite palette icon is the image - - calendar-day.png - -of the Fugue Icons collection (http://p.yusukekamiyamane.com/) \ No newline at end of file diff --git a/components/callite/icon/make_lrs.bat b/components/callite/icon/make_lrs.bat deleted file mode 100644 index e134d6b3e..000000000 --- a/components/callite/icon/make_lrs.bat +++ /dev/null @@ -1 +0,0 @@ -lazres ..\source\calendarlite_icon.lrs TCALENDARLITE.PNG diff --git a/components/callite/source/calendarlite.pas b/components/callite/source/calendarlite.pas index f60e14571..57181c4fd 100644 --- a/components/callite/source/calendarlite.pas +++ b/components/callite/source/calendarlite.pas @@ -397,11 +397,14 @@ procedure Register; implementation +{$R calendarlite_icon.res} + uses LCLType, LazUTF8, dateutils, math; const DBLCLICK_INTERVAL = 300; // Interval (ms) for detection of a double-click + DESIGNTIME_PPI = 96; { Holiday helpers } @@ -1284,8 +1287,8 @@ begin FStartingDayOfWeek:= dowSunday; with GetControlClassDefaultSize do SetInitialBounds(0, 0, cx, cy); - Constraints.MinHeight := DefMinHeight; - Constraints.MinWidth := DefMinWidth; + Constraints.MinHeight := ScaleX(DefMinHeight, DESIGNTIME_PPI); + Constraints.MinWidth := ScaleY(DefMinWidth, DESIGNTIME_PPI); Canvas.Brush.Style := bsSolid; TabStop := true; FDayNames := TStringList.Create; @@ -1421,8 +1424,8 @@ end; class function TCalendarLite.GetControlClassDefaultSize: TSize; begin - Result.cx := DefCalWidth; - Result.cy := DefCalHeight; + Result.cx := ScaleX(DefCalWidth, DESIGNTIME_PPI); + Result.cy := ScaleY(DefCalHeight, DESIGNTIME_PPI); end; function TCalendarLite.GetDayName(ADayOfWeek: TDayOfWeek): String; @@ -1913,7 +1916,6 @@ end; procedure Register; begin - {$I calendarlite_icon.lrs} RegisterComponents('Misc', [TCalendarLite]); end; diff --git a/components/callite/source/calendarlite_icon.res b/components/callite/source/calendarlite_icon.res new file mode 100644 index 0000000000000000000000000000000000000000..bf94c84fccd2d1f4ca15dd768154b063e7697ad1 GIT binary patch literal 1641 zcma)6eLT~79RJS4$ite*Ytf;j@T!HyFqU}=xt3-zMN?dcT~<0fdD_h5Q6q(@KI>+}6Q|MC62->(k<02sjvL7x?N|0SLX z0PNrl1gQZka0Slb8{iJezzy~&u5 z-##``4gg}gmzy)yGczO@V82 zL?W8cs(wCi(Y7CwK7I1BS2+3(QrEPB8tjVqN@$No(Cd9&Q14x?vUp6|*00r4G^1Pa zx$CxMtsS`uli|J$Q)-xx2l&t1*NS0 zeep^!`-ItaUv;o`#ugp}jcl*q%{H#wfA?s&6-L(*mcY8$u!&iH_GaH;`GC6Z2)VZ* z$!UM;CN&lUgv>>)zSG)j0dEL+xs%;~b_q`AC;&i$onk$5a(d2tsS`tfuLW!>eyGnHLO{EtJ!h9MvV_ zV2vM*emGc;ATF!*a<9PUWrcg(!e7oYEV3lF_=RTIQyr(qhE6c+n$LHnT23_1Oo*g2 z_f^gg0VkkP(({w9Q&ib*FyUD~2bQDgM(>gkQAze*8@zzMZtdXT46bbu#Osf{A zPx5S$^31YQ)T(lg<1HAI+#US`jOv5odG`3p1!`C5v27(dCy(M;xSnku|4=L2dBq?( z`CZHkr9#3fGWU65+;(wE)YC!ntJn0G9f7N zTn}>TWpdrzUCRW#OBCz*+*y*X^6N+}ZI@Ksam0X8t5haXe3W0cnjUE{80Q8mPV}I5 zqC(AB3OaU(m=wJX0m{MU(E~W;VFQh}II6s<&y77$Nwmcowp2S%3u@}RN#6%lL-z|z z%zveR@V*gTBuF&(I=-+fWiO`Fhu={qU0^o2cN-Xba+5+%PwP_E{7y?xj~T}v8;RQ!{pO)-c_7{Y!64>sxy03#N8+PUhvQ>I z+YSZP`_&=v^u(xV71RukvnSLTApTev2{2?0$#eD0P?l4HyW%e`2dx04;dgFQK1ICl zn~;`B<^oNQ)Jv%m+h2OA*ZG!Tddy|ii+L4RR_v5vMqZvO>0G4c#+8i}+*rOnkKd|J zdm*@*k15Vm<#=jy7}1J$20UMDL-I8)vmh@2^p44~Ra0)qv# zBVdq^MxYzHpu=K(P*MJHWe|Q}$vAz4@UqHWG<0;$xL`OZf4fqyp1i&x-Ov?RQP%duS0CAHYEUO@u!HuEVaS literal 0 HcmV?d00001 diff --git a/image_sources/ccr/components/callite/readme.txt b/image_sources/ccr/components/callite/readme.txt index c14bb4951..5d961e66b 100644 --- a/image_sources/ccr/components/callite/readme.txt +++ b/image_sources/ccr/components/callite/readme.txt @@ -2,7 +2,7 @@ This folder contains the png images used by the callite component in the component palette The icon is taken from icons8.com -Download link: +Download link: https://icons8.com/icon/12776/Calendar Except for renaming to fit the requirements as a FPC/Lazarus resource it has not been modified.