Browse Source

Windows 10 support, no tooltip shadow

Taskbar icons for first 7 chat tabs (Vista+)
File upload progress in taskbar (Vista+)
Updated Clients.zip, JPEG Turbo, translation
Fix for another files.icq.net links format
More image types for detection
Resample image for fullscreen preview
Ask to disable encryption if recipient is offline
oldchat
Mikanoshi 6 years ago
parent
commit
45b01dc797
36 changed files with 496 additions and 290 deletions
  1. +8
    -4
      Distro/RnQ1124_rus.utflng
  2. BIN
      Distro/Themes/Clients.zip
  3. BIN
      Distro/x32/jpegturbo.dll
  4. BIN
      Distro/x64/jpegturbo.dll
  5. +19
    -4
      README.html
  6. +4
    -6
      RnQ/ICQ/ICQv9.pas
  7. +7
    -4
      RnQ/ICQ/RQ_ICQ.pas
  8. +11
    -16
      RnQ/Prefs/design_fr.dfm
  9. +7
    -1
      RnQ/Prefs/design_fr.pas
  10. +6
    -4
      RnQ/Prefs/start_fr.dfm
  11. +2
    -2
      RnQ/RnQBuiltTime.inc
  12. BIN
      RnQ/RnQx64.res
  13. +9
    -6
      RnQ/aboutDlg.dfm
  14. +6
    -0
      RnQ/aboutDlg.pas
  15. +3
    -1
      RnQ/addContactDlg.dfm
  16. +1
    -2
      RnQ/addContactDlg.pas
  17. +24
    -1
      RnQ/chatDlg.dfm
  18. +112
    -6
      RnQ/chatDlg.pas
  19. +4
    -0
      RnQ/events.pas
  20. +2
    -2
      RnQ/globalLib.pas
  21. +3
    -0
      RnQ/iniLib.pas
  22. +9
    -9
      RnQ/mainDlg.dfm
  23. +13
    -24
      RnQ/outboxDlg.dfm
  24. +0
    -3
      RnQ/outboxDlg.pas
  25. +10
    -13
      RnQ/prefDlg.dfm
  26. +7
    -23
      RnQ/prefDlg.pas
  27. +9
    -13
      RnQ/pwdDlg.dfm
  28. +1
    -2
      RnQ/pwdDlg.pas
  29. +17
    -10
      RnQ/usersDlg.dfm
  30. +18
    -66
      RnQ/usersDlg.pas
  31. +85
    -34
      RnQ/utilLib.pas
  32. +0
    -3
      for.RnQ/RQmsgs.pas
  33. +88
    -30
      for.RnQ/RTL/RnQGraphics32.pas
  34. +9
    -1
      for.RnQ/RnQNet.pas
  35. +2
    -0
      for.RnQ/clear.bat
  36. BIN
      for.RnQ/for_rnq.res

+ 8
- 4
Distro/RnQ1124_rus.utflng View File

@ -1016,6 +1016,8 @@ UIN-листы
Рекомендуется не использовать эту функцию. Она еще тестируется.\nПродолжить?
[You did not entered any password, so encryption will be disabled!]
Вы не ввели пароль, поэтому шифрование не будет включено!
[Encrypted messages cannot be delivered to offline contacts. Send without encryption?]
Зашифрованные сообщения не могут быть получены контактом в офлайне. Отправить без шифрования?
[If you don't save your password, only who knows the password will be able to connect.\nPassword is asked all time you trying to connect.]
Пароль запрашивается при каждом подключении к серверу.
[If you don't save your password, only who knows the password will be able to connect.\nPassword is asked only once, so be sure that you lock or quit R&Q when you're off the screen.]
@ -1506,6 +1508,8 @@ R&Q может устанавливать статус <Ушел>, если Вы
Показывать аватары во вспл.сообщениях
[Max avatar size in tips]
Макс. размер аватар во вспл. сообщениях
[Show avatar instead of contact status on additional taskbar buttons]
Показывать аватары вместо иконки статуса контакта на доп. кнопках в панели задач
$[ICQ]
Общие
@ -1524,13 +1528,13 @@ $[ICQ]
Файл не существует
[Start minimized]
Запускать свернутой в трей
[Lock on start (hum, to stop your little sister)]
[Lock on start]
Блокировать R&&Q при запуске
[Retrieve offline messages on start]
Получать офлайн-сообщения при запуске
Получать офлайн сообщения при запуске
[Delete offline messages (from server) on start]
Удалять принятые офлайн-сообщения с сервера
[Reopen open chats on start]
Удалять принятые офлайн сообщения с сервера
[Reopen previous chats on start]
Открывать чаты при запуске
[Auto start with UIN]
Запуск с UIN'ом


BIN
Distro/Themes/Clients.zip View File


BIN
Distro/x32/jpegturbo.dll View File


BIN
Distro/x64/jpegturbo.dll View File


+ 19
- 4
README.html View File

@ -1,13 +1,13 @@
<div style="line-height: 150%;">
<h1>R&Q 1125 Кастомная сборка</h1>
Номер сборки: 23<br>
Последнее обновление: 25.09.2015
Номер сборки: 24<br>
Последнее обновление: 01.10.2015
<br /><div style="width: 100%; height: 1px; border-top: #D3D3D3 solid 1px;"></div><br />
<u>Особенности сборки</u><br>
- Предназначена для Windows 8.1<br>
- Интерфейс доработан, чтобы визаульно соответствовать 8.1 (плоские элементы без градиентов, минимум бордюров)<br>
- Предназначена для Windows 10<br>
- Интерфейс доработан, чтобы визаульно соответствовать 10 (плоские элементы без градиентов, минимум бордюров)<br>
- Добавлена закачка файлов на сервер и получение ссылки для отправки собеседнику<br>
- Добавлена поддержка стикеров<br>
- Исправлены сохранение и загрузка многих полей в профиле и настройках<br>
@ -44,6 +44,21 @@ smiles.selected.frame.color=969696</pre></blockquote>
<br><br>
<h2>История версий</h2>
1125 Сборка 24<br>
- Поддержка Windows 10, обновлены некоторые элементы интерфейса, убрана тень у всплывающих подсказок<br>
- Отображение 7 первых открытых чатов в виде кнопок во всплывающем окне на панели задач<br>
По умолчанию на кнопке иконка текущего статуса контакта, в Настройках - Внешний вид - Аватары можно включить отображение аватара вместо статуса<br>
Иконка также меняется при появлении любого события (выход в онлайн, входящее сообщение и т.д.)<br>
Только для Windows Vista и выше<br>
- Отображение прогресса закачки файла в панели задач (Windows Vista и выше)<br>
- Обновлён пак определения клиентов (ICQ 6 и 8.4, QIP 2005)<br>
- Обновлены библиотеки JPEG Turbo<br>
- Показ изображений в чате по ссылкам на files.icq.net, отправленным из ICQ для Windows 8 (другой формат)<br>
- Исправлено определение некоторых форматов изображений в чате<br>
- Более качественное уменьшение изображений при просмотре во весь экран (используя выбранный в настройках чата фильтр масштабирования)<br>
- Добавлен запрос на отправку сообщения без шифрования если получатель офлайн (иначе сообщения не доходят)<br><br>
1125 Сборка 23<br>
- Увеличена скорость загрузки больших паков для определения клиентов<br>
- Добавлено определение времени закрытия клиента собеседника, отображается во всплывающих подсказках<br>


+ 4
- 6
RnQ/ICQ/ICQv9.pas View File

@ -3769,15 +3769,14 @@ begin
if c.SendTransl and not isBin then
Msg2 := Translit(msg)
else
else
Msg2 := msg;
sutf := '';
lShouldEncr := UseCryptMsg and c.Crypt.supportCryptMsg and not isBin;
if (useMsgType2For(c) or lShouldEncr)
and not (IF_Simple and flags > 0) then
if (useMsgType2For(c) or lShouldEncr) and not (IF_Simple and flags > 0) then
begin
requiredACK:=TRUE;
requiredACK := True;
if SendingUTF and ((CAPS_sm_UTF8 in c.capabilitiesSm)or c.isAIM or (c.status = SC_OFFLINE))
and not isBin then
begin
@ -3886,8 +3885,7 @@ begin
flags := flags or IF_Encrypt;
end
else
if UseCryptMsg and (CAPS_big_QIP_Secure in c.capabilitiesBig)
and (c.Crypt.qippwd > 0) and not isBin then
if UseCryptMsg and (CAPS_big_QIP_Secure in c.capabilitiesBig) and (c.Crypt.qippwd > 0) and not isBin then
begin // QIP crypt message
Msg2Send := qip_msg_crypt(msg2, c.Crypt.qippwd);
// sutf := Length_DLE(GUIDToString(msgQIPpass));


+ 7
- 4
RnQ/ICQ/RQ_ICQ.pas View File

@ -514,7 +514,7 @@ end;
procedure parseImgLinks(var msg: RawByteString);
var
msgTmp, sA, imgStr: RawByteString;
msgTmp, sA, imgStr, mime, fileIdStr: RawByteString;
buf: TMemoryStream;
strs : TStringDynArray;
i, j, p: Integer;
@ -527,10 +527,12 @@ begin
for i := Low(strs) to High(strs) do
if StartsText('http://', strs[i]) or StartsText('https://', strs[i]) or StartsText('www.', strs[i]) then
begin
if ContainsText(strs[i], 'files.icq.net/get/') then
if ContainsText(strs[i], 'files.icq.net/') then
begin
buf := TMemoryStream.Create;
LoadFromURL(ReplaceText(Trim(strs[i]), 'files.icq.net/get/', 'files.icq.com/getinfo?file_id='), buf);
fileIdStr := ReplaceText(Trim(strs[i]), 'files.icq.net/get/', 'files.icq.com/getinfo?file_id=');
fileIdStr := ReplaceText(fileIdStr, 'files.icq.net/files/get?fileId=', 'files.icq.com/getinfo?file_id=');
LoadFromURL(fileIdStr, buf);
SetLength(imgStr, buf.Size);
buf.ReadBuffer(imgStr[1], buf.Size);
buf.Free;
@ -540,12 +542,13 @@ begin
try
JSONObject := TJSONObject.ParseJSONValue(TJSONArray(JSONObject.GetValue('file_list')).Items[0].ToJSON) as TJSONObject;
sA := JSONObject.GetValue('dlink').Value + '?no-download=1';
mime := JSONObject.GetValue('mime').Value;
JSONObject.Free;
except end;
end else
sA := Trim(strs[i]);
if MatchText(HeaderFromURL(sA), ImageContentTypes) then
if MatchText(mime, ImageContentTypes) or MatchText(HeaderFromURL(sA), ImageContentTypes) then
begin
buf := TMemoryStream.Create;
LoadFromURL(sA, buf);


+ 11
- 16
RnQ/Prefs/design_fr.dfm View File

@ -258,10 +258,6 @@ object designFr: TdesignFr
object RstrSheet: TTabSheet
Caption = 'Roaster'
ImageIndex = 3
ExplicitLeft = 0
ExplicitTop = 0
ExplicitWidth = 0
ExplicitHeight = 0
DesignSize = (
400
412)
@ -384,10 +380,6 @@ object designFr: TdesignFr
object TabSheet2: TTabSheet
Caption = 'Contact list'
ImageIndex = 1
ExplicitLeft = 0
ExplicitTop = 0
ExplicitWidth = 0
ExplicitHeight = 0
DesignSize = (
400
412)
@ -519,10 +511,6 @@ object designFr: TdesignFr
object TabSheet3: TTabSheet
Caption = 'Transparency'
ImageIndex = 2
ExplicitLeft = 0
ExplicitTop = 0
ExplicitWidth = 0
ExplicitHeight = 0
DesignSize = (
400
412)
@ -620,10 +608,6 @@ object designFr: TdesignFr
object avtTS: TTabSheet
Caption = 'Avatars'
ImageIndex = 4
ExplicitLeft = 0
ExplicitTop = 0
ExplicitWidth = 0
ExplicitHeight = 0
object AvtShwChtChk: TCheckBox
Left = 6
Top = 6
@ -669,6 +653,17 @@ object designFr: TdesignFr
Value = 100.000000000000000000
AsInteger = 100
end
object AvtShwTaskBar: TCheckBox
Left = 6
Top = 98
Width = 260
Height = 33
Caption =
'Show avatar instead of contact status on additional taskbar butt' +
'ons'
TabOrder = 5
WordWrap = True
end
end
end
end


+ 7
- 1
RnQ/Prefs/design_fr.pas View File

@ -80,6 +80,7 @@ type
AutoSzUpChk: TCheckBox;
snapToEdges: TCheckBox;
ChkNewExtSts: TCheckBox;
AvtShwTaskBar: TCheckBox;
procedure transpChange(Sender: TObject);
procedure transpExit(Sender: TObject);
procedure IconsListDrawNode(Sender: TBaseVirtualTree; const PaintInfo: TVTPaintInfo);
@ -108,7 +109,7 @@ implementation
uses
utilLib, RQThemes, themesLib, mainDlg, RnQLangs, RnQGlobal,
roasterLib, globalLib,
roasterLib, globalLib, chatDlg,
RnQGraphics32, RnQPics
// ICQContacts
;
@ -416,6 +417,7 @@ begin
avatarShowInChat := AvtShwChtChk.checked;
avatarShowInHint := AvtShwHntChk.checked;
avatarShowInTray := AvtShwTraChk.checked;
avatarShowInTaskBar := AvtShwTaskBar.checked;
TipsMaxAvtSizeUse := AvtMaxSzChk.checked;
TipsMaxAvtSize := AvtMaxSzSpin.AsInteger;
@ -440,6 +442,9 @@ begin
rosterRebuildDelayed := True
else if needRepaintCL then
rosterRepaintDelayed := True;
if Assigned(chatFrm) then
chatFrm.RefreshTaskbarButtons;
end;
procedure TdesignFr.BlinkPBoxPaint(Sender: TObject);
@ -516,6 +521,7 @@ begin
AvtShwChtChk.checked := avatarShowInChat;
AvtShwHntChk.checked := avatarShowInHint;
AvtShwTraChk.checked := avatarShowInTray;
AvtShwTaskBar.checked := avatarShowInTaskBar;
AvtMaxSzChk.checked := TipsMaxAvtSizeUse;
AvtMaxSzSpin.AsInteger := TipsMaxAvtSize;
end;


+ 6
- 4
RnQ/Prefs/start_fr.dfm View File

@ -45,7 +45,7 @@ object startFr: TstartFr
end
object Label24: TLabel
Left = 25
Top = 211
Top = 212
Width = 71
Height = 13
Alignment = taRightJustify
@ -53,7 +53,7 @@ object startFr: TstartFr
end
object Label25: TLabel
Left = 18
Top = 269
Top = 268
Width = 78
Height = 13
Alignment = taRightJustify
@ -100,7 +100,7 @@ object startFr: TstartFr
Width = 352
Height = 17
HelpKeyword = 'lock-on-start'
Caption = 'Lock on start (hum, to stop your little sister)'
Caption = 'Lock on start'
TabOrder = 4
end
object getofflinemsgsChk: TCheckBox
@ -126,7 +126,7 @@ object startFr: TstartFr
Width = 369
Height = 17
HelpKeyword = 'reopen-chats-on-start'
Caption = 'Reopen open chats on start'
Caption = 'Reopen previous chats on start'
TabOrder = 7
end
object autostart1: TEdit
@ -188,6 +188,8 @@ object startFr: TstartFr
Width = 91
Height = 25
Caption = 'current UIN'
DoubleBuffered = True
ParentDoubleBuffered = False
TabOrder = 9
OnClick = Button1Click
ImageName = 'uin'


+ 2
- 2
RnQ/RnQBuiltTime.inc View File

@ -1,2 +1,2 @@
{ 01.10.2015 1:33:05 }
BuiltTime = 42278.0646516898;
{ 01.10.2015 18:50:10 }
BuiltTime = 42278.7848394329;

BIN
RnQ/RnQx64.res View File


+ 9
- 6
RnQ/aboutDlg.dfm View File

@ -1,20 +1,19 @@
object aboutFrm: TaboutFrm
Left = 314
Top = 189
BorderIcons = [biSystemMenu, biMinimize]
BorderStyle = bsToolWindow
BorderIcons = [biSystemMenu]
BorderStyle = bsSingle
Caption = 'About'
ClientHeight = 231
ClientWidth = 299
Color = 15790320
ParentFont = True
GlassFrame.Enabled = True
GlassFrame.Bottom = 40
OldCreateOrder = True
Position = poScreenCenter
OnClose = FormClose
OnCreate = FormCreate
OnKeyPress = FormKeyPress
OnShow = FormShow
PixelsPerInch = 96
TextHeight = 13
object versionLbl: TLabel
@ -1504,16 +1503,18 @@ object aboutFrm: TaboutFrm
end
object CrdBtn: TRnQButton
Left = 12
Top = 203
Top = 197
Width = 100
Height = 25
Caption = 'Credits >'
DoubleBuffered = True
ParentDoubleBuffered = False
TabOrder = 2
OnClick = CrdBtnClick
end
object OkBtn: TRnQButton
Left = 206
Top = 203
Top = 197
Width = 83
Height = 25
Align = alCustom
@ -1521,7 +1522,9 @@ object aboutFrm: TaboutFrm
Cancel = True
Caption = 'OK'
Default = True
DoubleBuffered = True
ModalResult = 1
ParentDoubleBuffered = False
TabOrder = 3
OnClick = OkBtnClick
end


+ 6
- 0
RnQ/aboutDlg.pas View File

@ -44,6 +44,7 @@ type
procedure OkBtnClick(Sender: TObject);
procedure FormKeyPress(Sender: TObject; var Key: Char);
procedure BuiltLblClick(Sender: TObject);
procedure FormShow(Sender: TObject);
public
procedure view;
procedure CreateParams(var Params: TCreateParams); override;
@ -137,6 +138,11 @@ begin
close;
end;
procedure TaboutFrm.FormShow(Sender: TObject);
begin
theme.pic2ico(RQteFormIcon, PIC_RNQ, Icon);
end;
// procedure TaboutFrm.destroyHandle; begin inherited end;
procedure TaboutFrm.lblMouseEnter(Sender: TObject);


+ 3
- 1
RnQ/addContactDlg.dfm View File

@ -4,7 +4,7 @@ object addContactFrm: TaddContactFrm
BorderIcons = [biSystemMenu]
BorderStyle = bsSingle
Caption = 'Add contact'
ClientHeight = 90
ClientHeight = 95
ClientWidth = 269
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
@ -50,6 +50,8 @@ object addContactFrm: TaddContactFrm
Height = 25
Caption = 'Add'
Default = True
DoubleBuffered = True
ParentDoubleBuffered = False
TabOrder = 1
OnClick = addBtnClick
ImageName = 'add.contact'


+ 1
- 2
RnQ/addContactDlg.pas View File

@ -48,8 +48,7 @@ uses
procedure TaddContactFrm.FormPaint(Sender: TObject);
begin
if not GlassFrame.FrameExtended then
wallpaperize(canvas)
wallpaperize(canvas)
end;
procedure TaddContactFrm.FormClose(Sender: TObject; var Action: TCloseAction);


+ 24
- 1
RnQ/chatDlg.dfm View File

@ -6,7 +6,6 @@ object chatFrm: TchatFrm
ClientWidth = 620
Color = clBtnFace
ParentFont = True
GlassFrame.Bottom = 55
KeyPreview = True
OldCreateOrder = True
ScreenSnap = True
@ -417,6 +416,8 @@ object chatFrm: TchatFrm
Width = 75
Height = 25
Caption = 'Search'
DoubleBuffered = True
ParentDoubleBuffered = False
TabOrder = 0
Visible = False
OnClick = SBSearchClick
@ -593,4 +594,26 @@ object chatFrm: TchatFrm
OnExecute = SelectAllExecute
end
end
object TaskBar: TTaskbar
TaskBarButtons = <
item
end
item
end
item
end
item
end
item
end
item
end
item
end>
ProgressMaxValue = 100
TabProperties = []
OnThumbButtonClick = TaskBarThumbButtonClick
Left = 328
Top = 96
end
end

+ 112
- 6
RnQ/chatDlg.pas View File

@ -22,7 +22,7 @@ uses
RnQProtocol, RnQNet,
incapsulate, events,
pluginLib, RQMenuItem, System.Actions,
GR32, GR32_Backends;
GR32, GR32_Backends, System.Win.TaskbarCore, Vcl.Taskbar;
{$I NoRTTI.inc}
@ -37,6 +37,7 @@ type
FParent: TForm;
animTimer: TTimer;
alphaValue: Integer;
procedure CreateParams(var Params: TCreateParams); override;
procedure WMNCPaint(var Message: TWMNCPaint); message WM_NCPAINT;
procedure onAnimTimer(Sender: TObject);
public
@ -194,6 +195,7 @@ type
ShowSearch: TAction;
SelectAll: TAction;
BuzzBtn: TRnQSpeedButton;
TaskBar: TTaskbar;
procedure closemenuPopup(Sender: TObject);
procedure prefBtnMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
procedure SBSearchClick(Sender: TObject);
@ -306,6 +308,7 @@ type
procedure OnBeforeHeaderSend(Sender: TObject; const Method : String; Headers: TStrings);
procedure OnSendData(Sender: TObject; Buffer: Pointer; Len: Integer);
procedure RnQFileBtnClick(Sender: TObject);
procedure TaskBarThumbButtonClick(Sender: TObject; AButtonID: Integer);
protected
procedure WndProc(var Message: TMessage); override;
// procedure StartWheelPanning(Position: TPoint); virtual;
@ -416,6 +419,8 @@ type
procedure setLeftSB(visible: boolean);
procedure addcontactAction(Sender: TObject);
procedure AvtPBoxPaint(Sender: TObject);
procedure RefreshTaskbarButtons();
end; // TchatFrm
function CHAT_TAB_ADD(Control: Integer; iIcon: HIcon; const TabCaption: string): Integer;
@ -779,7 +784,7 @@ begin
ch.repaint();
}
// ch.repaintAndUpdateAutoscroll();
end
end;
end; // addEvent
function TchatFrm.pageIndex: Integer;
@ -981,6 +986,7 @@ begin
if i = pageIndex then
ch.repaint();
// ch.repaintAndUpdateAutoscroll();
RefreshTaskbarButtons;
end; // userChanged
procedure TchatFrm.openOn(c: TRnQContact; focus: boolean = true; pShow: boolean = true);
@ -1227,6 +1233,7 @@ begin
theme.ClearAniParams;
{$ENDIF RNQ_FULL}
chat.historyBox.updateRSB(false);
RefreshTaskbarButtons;
end; // newIMchannel
procedure TchatFrm.lsbScroll(Sender: TObject; ScrollCode: TScrollCode; var ScrollPos: Integer);
@ -1511,7 +1518,7 @@ begin
if chatFrm.visible and not IsIconic(chatFrm.handle) then
ch.historyBox.repaint;
panel.Realign;
panel.repaint;
panel.Repaint;
i := 21;
with theme.getPicSize(RQteButton, status2imgName(byte(SC_ONLINE)), icon_size) do
@ -1529,6 +1536,7 @@ begin
closeBtn.height := i;
sendBtn.Top := (panel.ClientHeight - sendBtn.height) div 2;
closeBtn.Top := (panel.ClientHeight - closeBtn.height) div 2;
RefreshTaskbarButtons;
end; // updateGraphics
procedure TchatFrm.pagectrlChanging(Sender: TObject; var AllowChange: boolean);
@ -1636,6 +1644,7 @@ begin
RnQPicBtn.Enabled := sendBtn.Enabled;
// SimplMsgBtn.Enabled := sendBtn.Enabled;
// panel.visible := ch.who.uin <> 5000;
RefreshTaskbarButtons;
end; // pageCtrlChange
procedure TchatFrm.inputKeydown(Sender: TObject; var Key: Word; Shift: TShiftState);
@ -2375,6 +2384,7 @@ begin
if userTime > 0 then
// savePages;
saveListsDelayed := true;
RefreshTaskbarButtons;
end; // closePageAt
procedure TchatFrm.closeChatWith(c: TRnQContact);
@ -2983,7 +2993,22 @@ begin
if isUploading then
Items[Count - 1].text := GetTranslation('Uploading file') + ': ' + IntToStr(Trunc(uploadedSize / uploadSize * 100)) + '%'
else
Items[Count - 1].text := s
Items[Count - 1].text := s;
if CheckWin32Version(6) then
with TaskBar do begin
if (uploadedSize < uploadSize) and isUploading then
begin
ProgressState := TTaskBarProgressState.Normal;
ProgressValue := Trunc(uploadedSize / uploadSize * 100);
end
else
begin
ProgressState := TTaskBarProgressState.None;
ProgressValue := 0;
end;
ApplyProgressChanges;
end;
end;
procedure TchatFrm.FormMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
@ -3269,14 +3294,25 @@ var
Max: Integer;
flag: Integer;
ch: TchatInfo;
lShouldEncr, isBin: Boolean;
begin
enterCount := 0;
flag := 0;
// if SimplMsgBtn.Down then
// flag := IF_Simple;
ch := thisChat;
if (ch = nil) or (ch.who = nil) THEN
exit;
if (ch = nil) or (ch.who = nil) then
Exit;
isBin := (AnsiPos(RnQImageTag, ch.input.text) > 0) or ((AnsiPos(RnQImageExTag, ch.input.text) > 0)) or (IF_Bin and flag > 0);
lShouldEncr := TICQSession(ch.who.fProto).UseCryptMsg and TICQContact(ch.who).Crypt.supportCryptMsg and not isBin;
if lShouldEncr and ch.who.isOffline then
begin
if MessageDlg(getTranslation('Encrypted messages cannot be delivered to offline contacts. Send without encryption?'), mtInformation, [mbYes, mbNo], 0) = mrYes then
TICQContact(ch.who).Crypt.supportCryptMsg := false
else
Exit;
end;
Max := ch.who.fProto.maxCharsFor(ch.who);
if Length(ch.input.text) > Max then
@ -4096,6 +4132,13 @@ begin
stopTimer();
end;
procedure THintWindowEx.CreateParams(var Params: TCreateParams);
begin
inherited CreateParams(Params);
with Params do
WindowClass.Style := WindowClass.style and not CS_DROPSHADOW;
end;
procedure THintWindowEx.WMNCPaint(var Message: TWMNCPaint);
var
DC: HDC;
@ -5089,6 +5132,7 @@ begin
}
end;
end;
{ procedure TchatFrm.checkGifTime;
//var
// i : Integer;
@ -5312,4 +5356,66 @@ begin
setStatusbar('');
end;
procedure TchatFrm.TaskBarThumbButtonClick(Sender: TObject; AButtonID: Integer);
begin
setTab(AButtonID);
open(true);
end;
procedure TchatFrm.RefreshTaskbarButtons();
var
taskBtn: TThumbBarButton;
ci: TchatInfo;
hi: HICON;
i, cnt: Integer;
bmp: TRnQBitmap;
ev: Thevent;
begin
if not CheckWin32Version(6) then Exit;
if not Assigned(TaskBar.TaskBarButtons) then Exit;
TaskBar.TaskBarButtons.BeginUpdate;
cnt := Min(7, chats.Count);
for i := 0 to 6 do
begin
taskBtn := TaskBar.TaskBarButtons[i];
taskBtn.Icon := Graphics.TIcon.Create;
if (i > cnt - 1) then
begin
taskBtn.Hint := '';
taskBtn.ButtonState := [TThumbButtonState.Hidden];
end
else
begin
taskBtn.ButtonState := [TThumbButtonState.Enabled, TThumbButtonState.DismissOnClick];
ci := chats.byIdx(i);
taskBtn.Hint := ci.who.displayed;
// show event icon
if ci.chatType = CT_IM then
begin
ev := eventQ.firstEventFor(ci.who);
if (ev <> nil) then
begin
theme.pic2ico(RQteFormIcon, ev.pic, taskBtn.Icon);
Continue;
end;
end;
// or avatar
if avatarShowInTaskBar and Assigned(ci.who.icon.Bmp) then
begin
bmp := ci.who.icon.Bmp.CloneAll;
StretchPic(bmp, 16, 16);
Bmp.GetHICON(hi);
taskBtn.Icon.Handle := hi;
bmp.Free;
end else // or current status
theme.pic2ico(RQteFormIcon, ci.who.statusImg, taskBtn.Icon);
end;
end;
TaskBar.TaskBarButtons.EndUpdate;
TaskBar.ApplyButtonsChanges;
end;
end.

+ 4
- 0
RnQ/events.pas View File

@ -872,6 +872,8 @@ else
if assigned(OnNewTop) then OnNewTop;
saveInboxDelayed:=TRUE;
end;
if Assigned(chatFrm) then
chatFrm.RefreshTaskbarButtons;
end; // add
function TeventQ.add(kind_:integer; c:TRnQContact; when:Tdatetime; flags_:integer):Thevent;
@ -930,6 +932,8 @@ if result then
if i=0 then
if assigned(OnNewTop) then OnNewTop;
roasterLib.redraw(c);
if Assigned(chatFrm) then
chatFrm.RefreshTaskbarButtons;
end;
end; // removeAt


+ 2
- 2
RnQ/globalLib.pas View File

@ -56,7 +56,7 @@ Longword = $000A01FF; // remember: it's hex
RnQBuild =;
{$ELSE ~DB_ENABLED}
RnQBuild = 1125;
RnQBuildCustom = 23;
RnQBuildCustom = 24;
PIC_CLIENT_LOGO = TPicName('rnq');
{$ENDIF ~DB_ENABLED}
// {$Include RnQBuiltTime.inc}
@ -634,7 +634,7 @@ var
showOnlyOnline, showOnlyImVisibleTo, showUnkAsOffline, OnlOfflInOne, autosizeFullRoster, autoSizeRoster, autosizeUp,
snapToScreenEdges, useSingleClickTray,
// SupportTyping, // In ICQv9.pas
avatarShowInChat, avatarShowInHint, avatarShowInTray, showXStatusMnu, showNewXStatuses, showRQP, UseContactThemes, xxx,
avatarShowInChat, avatarShowInHint, avatarShowInTray, avatarShowInTaskBar, showXStatusMnu, showNewXStatuses, showRQP, UseContactThemes, xxx,
masterUseSSI, usePlugPanel, useMainPlugPanel, useCtrlNumInstAlt, useSystemCodePage, askPassOnBossKeyOn, helpExists: boolean;
// AutoCheckGoOfflineUsers : Boolean;


+ 3
- 0
RnQ/iniLib.pas View File

@ -309,6 +309,7 @@ begin
avatarShowInChat := True;
avatarShowInHint := True;
avatarShowInTray := True;
avatarShowInTaskBar := False;
useSingleClickTray := True;
autoDeselect := False;
warnVisibilityExploit := True;
@ -546,6 +547,7 @@ begin
pp.addPrefBool('chat-show-avatars-chat', avatarShowInChat);
pp.addPrefBool('chat-show-avatars-hint', avatarShowInHint);
pp.addPrefBool('chat-show-avatars-tray', avatarShowInTray);
pp.addPrefBool('chat-show-avatars-taskbar', avatarShowInTaskBar);
pp.addPrefBool('use-single-click-tray', useSingleClickTray);
pp.addPrefBool('warn-visibility-automsgreq', warnVisibilityAutoMsgReq);
pp.addPrefInt('split-y', splitY);
@ -970,6 +972,7 @@ begin
pp.getPrefBool('chat-show-avatars-chat', avatarShowInChat);
pp.getPrefBool('chat-show-avatars-hint', avatarShowInHint);
pp.getPrefBool('chat-show-avatars-tray', avatarShowInTray);
pp.getPrefBool('chat-show-avatars-taskbar', avatarShowInTaskBar);
pp.getPrefBool('use-single-click-tray', useSingleClickTray);
pp.getPrefBool('check-betas', checkupdate.betas);
pp.getPrefBool('send-added-you', sendTheAddedYou);


+ 9
- 9
RnQ/mainDlg.dfm View File

@ -42,7 +42,7 @@ object RnQmain: TRnQmain
object TopLbl: TLabel
Left = 0
Top = 0
Width = 166
Width = 168
Height = 13
Align = alTop
Alignment = taCenter
@ -55,8 +55,8 @@ object RnQmain: TRnQmain
end
object bar: TPanel
Left = 0
Top = 357
Width = 166
Top = 359
Width = 168
Height = 23
Align = alBottom
BevelEdges = []
@ -115,7 +115,7 @@ object RnQmain: TRnQmain
object FilterBar: TPanel
Left = 0
Top = 13
Width = 166
Width = 168
Height = 24
Align = alTop
BevelEdges = []
@ -127,7 +127,7 @@ object RnQmain: TRnQmain
TabOrder = 3
object FilterClearBtn: TRnQSpeedButton
AlignWithMargins = True
Left = 142
Left = 144
Top = 3
Width = 21
Height = 18
@ -144,7 +144,7 @@ object RnQmain: TRnQmain
AlignWithMargins = True
Left = 3
Top = 3
Width = 135
Width = 137
Height = 18
Margins.Right = 1
Align = alClient
@ -157,8 +157,8 @@ object RnQmain: TRnQmain
object roster: TVirtualDrawTree
Left = 0
Top = 58
Width = 166
Height = 299
Width = 168
Height = 301
Align = alClient
BevelEdges = []
BevelInner = bvNone
@ -216,7 +216,7 @@ object RnQmain: TRnQmain
object MlCntBtn: TRnQButton
Left = 0
Top = 37
Width = 166
Width = 168
Height = 21
Align = alTop
DoubleBuffered = True


+ 13
- 24
RnQ/outboxDlg.dfm View File

@ -13,7 +13,6 @@ object outboxFrm: ToutboxFrm
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
GlassFrame.Bottom = 40
OldCreateOrder = True
Position = poScreenCenter
OnClose = FormClose
@ -27,18 +26,17 @@ object outboxFrm: ToutboxFrm
Left = 0
Top = 0
Width = 746
Height = 412
Height = 418
Align = alClient
BevelOuter = bvNone
BorderWidth = 5
TabOrder = 0
ExplicitWidth = 551
ExplicitHeight = 328
ExplicitHeight = 412
object Splitter2: TSplitter
Left = 145
Top = 5
Width = 5
Height = 402
Height = 408
ExplicitLeft = 150
ExplicitHeight = 322
end
@ -46,7 +44,7 @@ object outboxFrm: ToutboxFrm
Left = 150
Top = 5
Width = 591
Height = 402
Height = 408
Align = alClient
BevelOuter = bvNone
DoubleBuffered = True
@ -58,7 +56,7 @@ object outboxFrm: ToutboxFrm
Left = 0
Top = 105
Width = 591
Height = 297
Height = 303
Align = alClient
BevelInner = bvNone
BevelKind = bkFlat
@ -125,7 +123,7 @@ object outboxFrm: ToutboxFrm
Left = 5
Top = 5
Width = 140
Height = 402
Height = 408
Align = alLeft
BevelInner = bvNone
BevelOuter = bvRaised
@ -153,27 +151,18 @@ object outboxFrm: ToutboxFrm
end
object Panel2: TPanel
Left = 0
Top = 412
Top = 418
Width = 746
Height = 39
Height = 33
Align = alBottom
BevelOuter = bvNone
TabOrder = 1
DesignSize = (
746
39)
object Bevel: TBevel
Left = 5
Top = 0
Width = 736
Height = 3
Anchors = [akLeft, akTop, akRight]
Shape = bsBottomLine
ExplicitWidth = 541
end
33)
object deleteBtn: TRnQButton
Left = 4
Top = 9
Top = 3
Width = 76
Height = 25
Anchors = [akLeft, akBottom]
@ -185,7 +174,7 @@ object outboxFrm: ToutboxFrm
end
object saveBtn: TRnQButton
Left = 86
Top = 9
Top = 3
Width = 81
Height = 25
Anchors = [akLeft, akBottom]
@ -196,8 +185,8 @@ object outboxFrm: ToutboxFrm
ImageName = 'save'
end
object closeBtn: TRnQButton
Left = 666
Top = 9
Left = 667
Top = 3
Width = 75
Height = 25
Anchors = [akRight, akBottom]


+ 0
- 3
RnQ/outboxDlg.pas View File

@ -43,7 +43,6 @@ type
charsLbl: TLabel;
infoLbl: TLabel;
processChk00: TCheckBox;
Bevel: TBevel;
list: TVirtualDrawTree;
deleteBtn: TRnQButton;
saveBtn: TRnQButton;
@ -388,8 +387,6 @@ end;
procedure ToutboxFrm.FormCreate(Sender: TObject);
begin
list.NodeDataSize := SizeOf(TOevent);
Bevel.Visible := not(StyleServices.enabled and DwmCompositionEnabled);
GlassFrame.enabled := (Win32MajorVersion <= 6) and (Win32MinorVersion <= 1);
end;
function ToutboxFrm.selectedContact: TRnQContact;


+ 10
- 13
RnQ/prefDlg.dfm View File

@ -1,15 +1,14 @@
object prefFrm: TprefFrm
Left = 452
Top = 201
BorderIcons = [biSystemMenu, biMinimize]
BorderStyle = bsDialog
BorderIcons = [biSystemMenu]
BorderStyle = bsSingle
Caption = 'Preferences'
ClientHeight = 431
ClientWidth = 596
Color = clBtnFace
DefaultMonitor = dmMainForm
ParentFont = True
GlassFrame.Enabled = True
KeyPreview = True
OldCreateOrder = True
Position = poScreenCenter
@ -25,16 +24,6 @@ object prefFrm: TprefFrm
431)
PixelsPerInch = 96
TextHeight = 13
object Bevel: TBevel
Left = 6
Top = 271
Width = 551
Height = 4
Anchors = [akLeft, akRight, akBottom]
Shape = bsBottomLine
ExplicitTop = 272
ExplicitWidth = 549
end
object framePnl: TPanel
Left = 195
Top = 5
@ -97,6 +86,8 @@ object prefFrm: TprefFrm
Height = 25
Anchors = [akLeft, akBottom]
Caption = 'Reset'
DoubleBuffered = True
ParentDoubleBuffered = False
TabOrder = 2
OnClick = resetBtnClick
ImageName = 'refresh'
@ -109,7 +100,9 @@ object prefFrm: TprefFrm
Anchors = [akLeft, akBottom]
Caption = 'Ok'
Default = True
DoubleBuffered = True
ModalResult = 1
ParentDoubleBuffered = False
TabOrder = 3
OnClick = okBtnClick
ImageName = 'ok'
@ -121,6 +114,8 @@ object prefFrm: TprefFrm
Height = 25
Anchors = [akLeft, akBottom]
Caption = 'Close'
DoubleBuffered = True
ParentDoubleBuffered = False
TabOrder = 4
OnClick = closeBtnClick
ImageName = 'close'
@ -132,6 +127,8 @@ object prefFrm: TprefFrm
Height = 25
Anchors = [akLeft, akBottom]
Caption = 'Apply'
DoubleBuffered = True
ParentDoubleBuffered = False
TabOrder = 5
OnClick = applyBtnClick
ImageName = 'apply'


+ 7
- 23
RnQ/prefDlg.pas View File

@ -10,7 +10,7 @@ interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Forms,
Controls, ExtCtrls,
RnQPrefsLib, RnQButtons, RnQDialogs, VirtualTrees, StdCtrls;
RnQPrefsLib, RnQButtons, RnQDialogs, RnQPics, VirtualTrees, StdCtrls;
{$I NoRTTI.inc}
@ -18,7 +18,6 @@ type
TprefFrm = class(TForm)
framePnl: TPanel;
Bevel: TBevel;
PrefList: TVirtualDrawTree;
resetBtn: TRnQButton;
okBtn: TRnQButton;
@ -193,7 +192,7 @@ begin
else
caption:=getTranslation('Preferences for %s', [RnQUser]); }
// theme.pic2ico(PIC_PREFERENCES, icon);
theme.pic2ico(RQteFormIcon, PIC_RNQ, Icon);
end;
procedure TprefFrm.resetBtnClick(Sender: TObject);
@ -433,11 +432,11 @@ begin
end;
clientWidth := GAP_SIZE + PrefList.Width + GAP_SIZE + FRM_WIDTH + GAP_SIZE;
clientHeight := GAP_SIZE + FRM_HEIGHT + GAP_SIZE + Bevel.Height + GAP_SIZE + okBtn.Height + GAP_SIZE;
clientHeight := GAP_SIZE + FRM_HEIGHT + GAP_SIZE + okBtn.Height + GAP_SIZE ;
PrefList.Visible := True;
resetBtn.Visible := True;
resetBtn.top := clientHeight - resetBtn.Height - GAP_SIZE + 3;
resetBtn.top := clientHeight - resetBtn.Height - GAP_SIZE;
resetBtn.Left := GAP_SIZE - 1;
applyBtn.top := resetBtn.top;
@ -449,17 +448,11 @@ begin
okBtn.top := resetBtn.top;
okBtn.Left := closeBtn.Left - okBtn.Width - GAP_SIZE;
Bevel.Left := GAP_SIZE;
Bevel.Width := clientWidth - GAP_SIZE - GAP_SIZE;
Bevel.top := resetBtn.top - Bevel.Height - GAP_SIZE;
self.GlassFrame.Bottom := resetBtn.Height + GAP_SIZE shl 1 + 2;
PrefList.Height := Bevel.top - GAP_SIZE - GAP_SIZE;
PrefList.Height := resetBtn.top - GAP_SIZE - GAP_SIZE;
PrefList.top := GAP_SIZE;
PrefList.Left := GAP_SIZE;
framePnl.Height := Bevel.top;
framePnl.Height := resetBtn.top;
framePnl.top := 0;
framePnl.Left := PrefList.Left + PrefList.Width + GAP_SIZE;
framePnl.Width := clientWidth - framePnl.Left;
@ -472,7 +465,7 @@ begin
arrPages[i] := pages[i].Clone;
end;
clientWidth := GAP_SIZE + FRM_WIDTH + GAP_SIZE;
clientHeight := GAP_SIZE + FRM_HEIGHT + GAP_SIZE + Bevel.Height + GAP_SIZE + okBtn.Height + GAP_SIZE;
clientHeight := GAP_SIZE + FRM_HEIGHT + GAP_SIZE + okBtn.Height + GAP_SIZE;
PrefList.Visible := False;
resetBtn.Visible := False;
@ -489,16 +482,8 @@ begin
framePnl.Left := GAP_SIZE;
framePnl.Height := FRM_HEIGHT;
framePnl.Width := clientWidth - framePnl.Left - GAP_SIZE;
Bevel.Left := GAP_SIZE;
Bevel.Width := clientWidth - GAP_SIZE - GAP_SIZE;
Bevel.top := applyBtn.top - Bevel.Height - GAP_SIZE;
self.GlassFrame.Bottom := resetBtn.Height + GAP_SIZE shl 1 + 2;
end;
Bevel.Visible := not(StyleServices.Enabled and DwmCompositionEnabled);
sortPrefPages;
try
for i := 0 to Length(arrPages) - 1 do
@ -547,7 +532,6 @@ begin
end;
reset;
end;
procedure TprefFrm.SetBtnEnable(Value: Boolean);


+ 9
- 13
RnQ/pwdDlg.dfm View File

@ -1,18 +1,12 @@
object msgFrm: TmsgFrm
Left = 161
Top = 99
BorderIcons = [biSystemMenu, biMinimize]
BorderIcons = [biSystemMenu]
BorderStyle = bsSingle
ClientHeight = 68
ClientWidth = 179
Color = clBtnFace
ParentFont = True
GlassFrame.Enabled = True
GlassFrame.Left = 6
GlassFrame.Top = 6
GlassFrame.Right = 6
GlassFrame.Bottom = 6
GlassFrame.SheetOfGlass = True
OldCreateOrder = True
Position = poScreenCenter
OnActivate = FormActivate
@ -26,8 +20,8 @@ object msgFrm: TmsgFrm
PixelsPerInch = 96
TextHeight = 13
object Label1: TLabel
Left = 21
Top = 11
Left = 13
Top = 12
Width = 46
Height = 13
Alignment = taRightJustify
@ -36,8 +30,8 @@ object msgFrm: TmsgFrm
Transparent = True
end
object KBBtn: TRnQSpeedButton
Left = 155
Top = 8
Left = 147
Top = 9
Width = 23
Height = 22
Anchors = [akTop, akRight]
@ -46,8 +40,8 @@ object msgFrm: TmsgFrm
OnClick = KBBtnClick
end
object txtBox: TEdit
Left = 72
Top = 7
Left = 64
Top = 8
Width = 81
Height = 23
Anchors = [akLeft, akRight, akBottom]
@ -69,6 +63,8 @@ object msgFrm: TmsgFrm
Anchors = [akBottom]
Caption = '&Ok'
Default = True
DoubleBuffered = True
ParentDoubleBuffered = False
TabOrder = 1
OnClick = okBtnClick
ImageName = 'ok'


+ 1
- 2
RnQ/pwdDlg.pas View File

@ -95,8 +95,7 @@ procedure TmsgFrm.FormPaint(Sender: TObject);
begin
// Canvas.
// R := Canvas.ClipRect;
if not GlassFrame.FrameExtended then
wallpaperize(canvas)
wallpaperize(canvas)
end;
procedure TmsgFrm.FormActivate(Sender: TObject);


+ 17
- 10
RnQ/usersDlg.dfm View File

@ -2,7 +2,7 @@ object usersFrm: TusersFrm
Left = 338
Top = 161
ActiveControl = UsersBox
BorderIcons = [biSystemMenu, biMinimize]
BorderIcons = [biSystemMenu]
Caption = 'Users'
ClientHeight = 258
ClientWidth = 321
@ -12,8 +12,6 @@ object usersFrm: TusersFrm
Constraints.MinHeight = 280
Constraints.MinWidth = 280
ParentFont = True
GlassFrame.Enabled = True
GlassFrame.Right = 130
KeyPreview = True
OldCreateOrder = True
Position = poScreenCenter
@ -44,7 +42,7 @@ object usersFrm: TusersFrm
Shape = bsRightLine
end
object deleteaccountBtn: TRnQSpeedButton
Left = 202
Left = 198
Top = 140
Width = 35
Height = 25
@ -59,7 +57,7 @@ object usersFrm: TusersFrm
OnClick = deleteaccountBtnClick
end
object importBtn: TRnQSpeedButton
Left = 202
Left = 198
Top = 171
Width = 35
Height = 25
@ -72,7 +70,7 @@ object usersFrm: TusersFrm
ImageName = 'import'
end
object PntBox: TPaintBox
Left = 202
Left = 198
Top = 140
Width = 116
Height = 100
@ -114,54 +112,63 @@ object usersFrm: TusersFrm
OnFreeNode = UsersBoxFreeNode
OnKeyDown = FormKeyDown
OnKeyPress = usersBoxKeyPress
ExplicitWidth = 105
Columns = <>
end
object deleteuserBtn: TRnQButton
Left = 202
Left = 198
Top = 70
Width = 116
Height = 25
Hint = 'delete your user from this PC'
Anchors = [akTop, akRight]
Caption = 'Delete user'
DoubleBuffered = True
ParentDoubleBuffered = False
TabOrder = 1
OnClick = deleteuserBtnClick
ImageName = 'delete'
end
object newaccountBtn: TRnQButton
Left = 202
Left = 198
Top = 101
Width = 116
Height = 25
Hint = 'create a new UIN on the server'
Anchors = [akTop, akRight]
Caption = 'Get new ICQ account'
DoubleBuffered = True
ParentDoubleBuffered = False
TabOrder = 2
OnClick = newaccountBtnClick
ImageName = 'new.account'
end
object newuserBtn: TRnQButton
Left = 202
Left = 198
Top = 39
Width = 116
Height = 25
Hint = 'input your UIN and create a new user'
Anchors = [akTop, akRight]
Caption = 'New user'
DoubleBuffered = True
ParentDoubleBuffered = False
TabOrder = 3
OnClick = newuserBtnClick
ImageName = 'new.user'
end
object okBtn: TRnQButton
Left = 202
Left = 198
Top = 8
Width = 116
Height = 25
Anchors = [akTop, akRight]
Caption = 'Ok'
Default = True
DoubleBuffered = True
Enabled = False
ModalResult = 1
ParentDoubleBuffered = False
TabOrder = 4
OnClick = okBtnClick
ImageName = 'ok'


+ 18
- 66
RnQ/usersDlg.pas View File

@ -332,8 +332,7 @@ end;
procedure TusersFrm.FormPaint(Sender: TObject);
begin
if not GlassFrame.FrameExtended then
wallpaperize(Canvas)
wallpaperize(Canvas)
end;
function TusersFrm.selectUIN(uin: TUID): Boolean;
@ -472,7 +471,6 @@ var
TextRect, R: TRect;
TextFlags: Cardinal;
Options: TDTTOpts;
PaintOnGlass: Boolean;
MemDC: HDC;
PaintBuffer: HPAINTBUFFER;
// br : HBRUSH;
@ -482,11 +480,6 @@ var
begin
cnv := (Sender as TPaintBox).Canvas;
R := (Sender as TPaintBox).ClientRect;
PaintOnGlass := StyleServices.enabled and DwmCompositionEnabled and not(csDesigning in ComponentState);
if PaintOnGlass then
begin
PaintOnGlass := self.GlassFrame.enabled and self.GlassFrame.FrameExtended;
end;
PaintBuffer := 0;
begin
try
@ -504,12 +497,7 @@ begin
with cnv.Font do
Style := Style - [fsUnderline];
end;
if PaintOnGlass then
begin
PaintBuffer := BeginBufferedPaint(cnv.Handle, TextRect, BPBF_TOPDOWNDIB, nil, MemDC);
end
else
MemDC := cnv.Handle;
MemDC := cnv.Handle;
// br := CreateSolidBrush(ColorToRGB(clHighlight));
// br := GetSysColorBrush(COLOR_HIGHLIGHT);
// FillRect(MemDC, TextRect, br);
@ -518,48 +506,21 @@ begin
// TextRect.Left := r.Right - x - 4;
dec(TextRect.bottom, (Sender as TPaintBox).Height - sizeM - 5);
// inc(TextRect.Bottom, 1);
if PaintOnGlass then
begin
BufferedPaintClear(PaintBuffer, @R);
TextLen := length(RnQVer);
TextFlags := DT_CENTER or DT_VCENTER;
FillChar(Options, SizeOf(Options), 0);
Options.dwSize := SizeOf(Options);
Options.dwFlags := DTT_COMPOSITED or DTT_GLOWSIZE or DTT_TEXTCOLOR;
if MouseOnLabel then
Options.iGlowSize := 20
else
Options.iGlowSize := 2;
// Options.
Options.crText := ColorToRGB(cnv.Font.Color);
// with StyleServices.GetElementDetails(twCaptionActive) do
with StyleServices.GetElementDetails(tttBaloonLink) do
DrawThemeTextEx(StyleServices.Theme[element], MemDC, Part, State,
// with StyleServices.GetElementDetails(teEditTextNormal) do
// DrawThemeTextEx(StyleServices.Theme[teEdit], Memdc, Part, State,
// PWideChar(WideString(RnQVer)), TextLen, TextFlags, @TextRect, Options);
PWideChar(RnQVer), TextLen, TextFlags, TextRect, Options);
end
else
begin
oldMode := SetBkMode(MemDC, TRANSPARENT);
oldF := SelectObject(MemDC, cnv.Font.Handle);
SetTextAlign(MemDC, GetTextAlign(MemDC) or (TA_CENTER) or VTA_CENTER);
// SetTextAlign (MemDC, (TA_CENTER));
// TextRect.Top := TextRect.bottom - 30;
GetTextExtentPoint32(cnv.Handle, PChar(RnQVer0), length(RnQVer0), sz);
// newLineHeight(sz.cy);
ExtTextOut(MemDC, (TextRect.Right + TextRect.Left) shr 1, (TextRect.Top + TextRect.bottom) shr 1 - sz.cy, ETO_CLIPPED,
@TextRect, PChar(RnQVer0), length(RnQVer0), NIL);
if RnQVerT > '' then
ExtTextOut(MemDC, (TextRect.Right + TextRect.Left) shr 1, (TextRect.Top + TextRect.bottom) shr 1, ETO_CLIPPED,
@TextRect, PChar(RnQVerT), length(RnQVerT), NIL);
// cnv.TextRect(TextRect, TextRect.Left, TextRect.Top, RnQVer);
// SetBkMode(MemDC, oldMode);
SelectObject(MemDC, oldF);
end;
oldMode := SetBkMode(MemDC, TRANSPARENT);
oldF := SelectObject(MemDC, cnv.Font.Handle);
SetTextAlign(MemDC, GetTextAlign(MemDC) or (TA_CENTER) or VTA_CENTER);
// SetTextAlign (MemDC, (TA_CENTER));
// TextRect.Top := TextRect.bottom - 30;
GetTextExtentPoint32(cnv.Handle, PChar(RnQVer0), length(RnQVer0), sz);
// newLineHeight(sz.cy);
ExtTextOut(MemDC, (TextRect.Right + TextRect.Left) shr 1, (TextRect.Top + TextRect.bottom) shr 1 - sz.cy, ETO_CLIPPED,
@TextRect, PChar(RnQVer0), length(RnQVer0), NIL);
if RnQVerT > '' then
ExtTextOut(MemDC, (TextRect.Right + TextRect.Left) shr 1, (TextRect.Top + TextRect.bottom) shr 1, ETO_CLIPPED,
@TextRect, PChar(RnQVerT), length(RnQVerT), NIL);
// cnv.TextRect(TextRect, TextRect.Left, TextRect.Top, RnQVer);
// SetBkMode(MemDC, oldMode);
SelectObject(MemDC, oldF);
// br := 0;
// DeleteObject(br);
@ -576,13 +537,7 @@ begin
// TextOut(MemDC, r.left+2,y, PAnsiChar(s), Length(s));
// SetBkMode(MemDC, oldMode);
// SelectObject(MemDC, oldF);
finally
if PaintOnGlass then
begin
// BufferedPaintMakeOpaque(PaintBuffer, @TextRect);
EndBufferedPaint(PaintBuffer, True);
end;
end;
finally end;
end
end;
@ -750,9 +705,6 @@ begin
// L1.DoubleBuffered := True;
// self.DoubleBuffered := True;
// UsersBox.DoubleBuffered := True;
self.GlassFrame.Right := ClientWidth - UsersBox.Width;
self.GlassFrame.enabled := self.GlassFrame.enabled // and not PrefsPnl.Visible
and StyleServices.enabled;
// PrefsPnl.DoubleBuffered := True;
// Panel1.DoubleBuffered := True;
end;


+ 85
- 34
RnQ/utilLib.pas View File

@ -1373,7 +1373,7 @@ begin
inherited;
end;
function loadImageEx(var img: TImageEx; var RnQPicStream: TMemoryStream): String;
function loadImageEx(var img: TImageEx; var RnQPicStream: TMemoryStream; fitScreen: Boolean = False): String;
var
ff: TPAFormat;
png: TPNGImage;
@ -1384,29 +1384,44 @@ var
pic: IPicture;
a, b: integer;
h, w: integer;
r: Trect;
r, bRect: TRect;
begin
img.ImageStream := TMemoryStream.Create;
img.ImageStream.LoadFromStream(RnQPicStream);
if Assigned(chatFrm) then
bRect := Screen.MonitorFromWindow(chatFrm.Handle).BoundsRect
else
bRect := Screen.Monitors[0].BoundsRect;
ff := DetectFileFormatStream(RnQPicStream);
RnQPicStream.Seek(0, soBeginning);
case ff of
PA_FORMAT_BMP:
try
img.Picture.Bitmap.LoadFromStream(RnQPicStream);
if fitScreen then
begin
bmp := TBitmap.Create;
bmp.LoadFromStream(RnQPicStream);
ResampleFullscreen(bmp, bRect);
img.Picture.Bitmap.Assign(bmp);
bmp.Free;
end else
img.Picture.Bitmap.LoadFromStream(RnQPicStream);
Result := 'BMP';
img.Tag := 1;
except
end;
PA_FORMAT_JPEG:
try
bmp := TBitmap.Create;
bmp.PixelFormat := pf24bit;
if JPEGTurbo then
begin
jpg := TJPEGImage.Create;
jpg.LoadFromStream(RnQPicStream);
bmp := TBitmap.Create;
bmp.PixelFormat := pf24bit;
bmp.Assign(jpg);
jpg.Free;
end
@ -1418,8 +1433,6 @@ begin
pic.get_Width(a);
pic.get_Height(b);
bmp := TBitmap.Create;
bmp.PixelFormat := pf24bit;
w := MulDiv(a, GetDeviceCaps(bmp.canvas.Handle, LOGPIXELSX), 2540);
h := MulDiv(b, GetDeviceCaps(bmp.canvas.Handle, LOGPIXELSY), 2540);
r.Left := 0;
@ -1433,48 +1446,57 @@ begin
end;
if Assigned(bmp) then
begin
if fitScreen then
ResampleFullscreen(bmp, bRect);
img.Picture.Bitmap.Assign(bmp);
end;
bmp.Free;
Result := 'JPEG';
img.Tag := 2;
except
end;
PA_FORMAT_GIF:
try
gif := TGIFImage.Create;
gif.LoadFromStream(RnQPicStream);
img.Picture.Assign(gif);
(img.Picture.Graphic as TGIFImage).Animate := True;
img.Transparent := True;
Result := 'GIF';
img.Tag := 3;
gif.Free;
except
end;
PA_FORMAT_PNG:
try
png := TPNGImage.Create;
png.LoadFromStream(RnQPicStream);
img.Picture.Assign(png);
if fitScreen and not png.Empty then
begin
if png.Header.ColorType = COLOR_PALETTE then
ConvertToRGBA(png);
bmp := TBitmap.Create;
bmp.PixelFormat := pf32bit;
bmp.Assign(png);
ResampleFullscreen(bmp, bRect);
img.Picture.Bitmap.Assign(bmp);
bmp.Free;
end else
img.Picture.Assign(png);
Result := 'PNG';
img.Tag := 4;
png.Free;