diff options
Diffstat (limited to 'src/mir_app')
-rw-r--r-- | src/mir_app/res/resource.rc | 18 | ||||
-rw-r--r-- | src/mir_app/src/chat.h | 2 | ||||
-rw-r--r-- | src/mir_app/src/chat_ui.cpp | 74 | ||||
-rw-r--r-- | src/mir_app/src/resource.h | 5 |
4 files changed, 98 insertions, 1 deletions
diff --git a/src/mir_app/res/resource.rc b/src/mir_app/res/resource.rc index 423dbc7941..900613ed3b 100644 --- a/src/mir_app/res/resource.rc +++ b/src/mir_app/res/resource.rc @@ -963,6 +963,24 @@ BEGIN PUSHBUTTON "Set password",IDC_USERPASS1,200,153,111,17
END
+IDD_OPTIONSPOPUP DIALOGEX 0, 0, 277, 177
+STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
+EXSTYLE WS_EX_CONTROLPARENT
+FONT 8, "MS Shell Dlg", 0, 0, 0x1
+BEGIN
+ GROUPBOX "Group chats",IDC_STATIC,0,0,277,174
+ CONTROL "Use same style as in the message log",IDC_RADIO1,"Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,33,29,225,10
+ CONTROL "Use default colors",IDC_RADIO2,"Button",BS_AUTORADIOBUTTON,33,62,217,10
+ CONTROL "Use custom colors",IDC_RADIO3,"Button",BS_AUTORADIOBUTTON,33,95,105,10
+ CONTROL "",IDC_TEXT,"ColourPicker",WS_TABSTOP,141,93,50,14,WS_EX_NOACTIVATE | 0x10000000L
+ CONTROL "",IDC_BKG,"ColourPicker",WS_TABSTOP,201,93,50,14,WS_EX_NOACTIVATE | 0x10000000L
+ EDITTEXT IDC_TIMEOUT,132,134,38,14,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER
+ CONTROL "",IDC_SPIN1,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_HOTTRACK,169,135,11,14
+ LTEXT "Timeout (s)",IDC_STATIC,33,138,92,8
+ LTEXT "Text",IDC_STATIC,141,83,49,8
+ LTEXT "Background",IDC_STATIC,201,83,67,8
+ LTEXT "(Setting timeout to 0 means default setting and -1 means indefinite time)",IDC_STATIC,33,151,207,17
+END
/////////////////////////////////////////////////////////////////////////////
//
diff --git a/src/mir_app/src/chat.h b/src/mir_app/src/chat.h index 8be9224d3d..ed4e28aa22 100644 --- a/src/mir_app/src/chat.h +++ b/src/mir_app/src/chat.h @@ -36,7 +36,7 @@ extern wchar_t *g_szFontGroup; extern mir_cs csChat;
extern HICON g_hChatIcons[20];
-extern uint32_t g_dwDiskLogFlags;
+extern uint32_t g_dwDiskLogFlags;
extern HCURSOR g_hCurHyperlinkHand;
extern char* pLogIconBmpBits[14];
extern HANDLE hevSendEvent, hevBuildMenuEvent;
diff --git a/src/mir_app/src/chat_ui.cpp b/src/mir_app/src/chat_ui.cpp index 551444f323..789f6fd075 100644 --- a/src/mir_app/src/chat_ui.cpp +++ b/src/mir_app/src/chat_ui.cpp @@ -133,6 +133,73 @@ public: void onClick_Log(CCtrlButton *) { InvertColumn(IDC_L1); } }; +///////////////////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////////////////// +// Popup options + +class COptPopupDlg : public CDlgBase +{ + CCtrlSpin spinTimeout; + CCtrlCheck chkRadio1, chkRadio2, chkRadio3; + CCtrlColor clrBack, clrText; + +public: + COptPopupDlg() : + CDlgBase(g_plugin, IDD_OPTIONSPOPUP), + clrBack(this, IDC_BKG), + clrText(this, IDC_TEXT), + chkRadio1(this, IDC_RADIO1), + chkRadio2(this, IDC_RADIO2), + chkRadio3(this, IDC_RADIO3), + spinTimeout(this, IDC_SPIN1, 100, -1) + { + chkRadio1.OnChange = chkRadio2.OnChange = chkRadio3.OnChange = Callback(this, &COptPopupDlg::onChange_Radio); + } + + bool OnInitDialog() override + { + clrBack.SetColor(g_Settings->crPUBkgColour); + clrText.SetColor(g_Settings->crPUTextColour); + + if (g_Settings->iPopupStyle == 2) + CheckDlgButton(m_hwnd, IDC_RADIO2, BST_CHECKED); + else if (g_Settings->iPopupStyle == 3) + CheckDlgButton(m_hwnd, IDC_RADIO3, BST_CHECKED); + else + CheckDlgButton(m_hwnd, IDC_RADIO1, BST_CHECKED); + onChange_Radio(0); + + spinTimeout.SetPosition(g_Settings->iPopupTimeout); + return true; + } + + bool OnApply() override + { + if (IsDlgButtonChecked(m_hwnd, IDC_RADIO2) == BST_CHECKED) + g_Settings->iPopupStyle = 2; + else if (IsDlgButtonChecked(m_hwnd, IDC_RADIO3) == BST_CHECKED) + g_Settings->iPopupStyle = 3; + else + g_Settings->iPopupStyle = 1; + db_set_b(0, CHAT_MODULE, "PopupStyle", g_Settings->iPopupStyle); + + db_set_w(0, CHAT_MODULE, "PopupTimeout", g_Settings->iPopupTimeout = spinTimeout.GetPosition()); + db_set_dw(0, CHAT_MODULE, "PopupColorBG", g_Settings->crPUBkgColour = clrBack.GetColor()); + db_set_dw(0, CHAT_MODULE, "PopupColorText", g_Settings->crPUTextColour = clrText.GetColor()); + return true; + } + + void onChange_Radio(CCtrlCheck *) + { + bool bStatus = chkRadio3.GetState(); + clrBack.Enable(bStatus); + clrText.Enable(bStatus); + } +}; + +///////////////////////////////////////////////////////////////////////////////////////// + void ChatOptionsInit(WPARAM wParam) { OPTIONSDIALOGPAGE odp = {}; @@ -143,4 +210,11 @@ void ChatOptionsInit(WPARAM wParam) odp.szTab.a = LPGEN("Events and filters"); odp.pDialog = new CChatEventOptionDlg(); g_plugin.addOptions(wParam, &odp); + + odp.position = 910000002; + odp.szTitle.a = LPGEN("Group chats"); + odp.szGroup.a = LPGEN("Popups"); + odp.szTab.a = nullptr; + odp.pDialog = new COptPopupDlg(); + g_plugin.addOptions(wParam, &odp); } diff --git a/src/mir_app/src/resource.h b/src/mir_app/src/resource.h index 8fda4efe5c..880bc69078 100644 --- a/src/mir_app/src/resource.h +++ b/src/mir_app/src/resource.h @@ -43,6 +43,7 @@ #define IDD_OPT_SOUND 134
#define IDR_LOGMENU 135
#define IDI_RECVMSG 136
+#define IDD_OPTIONSPOPUP 137
#define IDI_URL 138
#define IDI_MCMENUOFF 144
#define IDI_MCMENU 145
@@ -232,6 +233,7 @@ #define IDC_MYNOTES 1033
#define IDC_TRAYONLYFORINACTIVE 1034
#define IDC_POPUPONLYFORINACTIVE 1035
+#define IDC_TIMEOUT 1036
#define IDC_URLS 1037
#define IDC_COLORTEXT 1038
#define IDC_REPLY 1039
@@ -591,9 +593,12 @@ #define IDC_LANGUAGES 1747
#define IDC_GENMENU_MODULE 1748
#define IDC_LOGROTATE 1749
+#define IDC_RADIO3 1750
#define IDC_RIGHTCLICK 1751
#define IDC_FILTER_SEARCH 1752
#define IDC_TREE 1753
+#define IDC_BKG 1754
+#define IDC_TEXT 1755
#define IDC_EFFECT_COLOUR_TEXT1 1853
#define IDC_EFFECT_COLOUR_SPIN1 1854
#define IDC_EXTRAORDER 1889
|