comparison mcabber/mcabber/screen.c @ 2343:762ee698c8cd

Hide the log window when log_win_height <= 0
author franky
date Tue, 28 May 2019 22:28:49 +0200
parents d7b52c883ca4
children 1579ed96d501
comparison
equal deleted inserted replaced
2342:d7b52c883ca4 2343:762ee698c8cd
1681 int chat_y_pos, chatstatus_y_pos, log_y_pos; 1681 int chat_y_pos, chatstatus_y_pos, log_y_pos;
1682 int roster_x_pos, chat_x_pos; 1682 int roster_x_pos, chat_x_pos;
1683 1683
1684 roster_no_leading_space = settings_opt_get_int("roster_no_leading_space"); 1684 roster_no_leading_space = settings_opt_get_int("roster_no_leading_space");
1685 1685
1686 Log_Win_Height = DEFAULT_LOG_WIN_HEIGHT; 1686 if (NULL == settings_opt_get("log_win_height"))
1687 requested_size = settings_opt_get_int("log_win_height"); 1687 requested_size = DEFAULT_LOG_WIN_HEIGHT;
1688 else
1689 requested_size = settings_opt_get_int("log_win_height");
1688 if (requested_size > 0) { 1690 if (requested_size > 0) {
1689 if (maxY > requested_size + 3) 1691 if (maxY > requested_size + 3)
1690 Log_Win_Height = requested_size; 1692 Log_Win_Height = requested_size;
1691 else 1693 else
1692 Log_Win_Height = ((maxY > 5) ? (maxY - 4) : 1); 1694 Log_Win_Height = ((maxY > 5) ? (maxY - 4) : 1);
1693 } else if (requested_size < 0) { 1695 } else if (requested_size <= 0) {
1694 Log_Win_Height = 1; 1696 Log_Win_Height = 0;
1695 } 1697 }
1696 1698
1697 if (maxY < Log_Win_Height+4) { 1699 if (maxY < Log_Win_Height+4) {
1698 if (maxY < 5) { 1700 if (maxY < 5) {
1699 Log_Win_Height = 1; 1701 Log_Win_Height = 1;
1836 replace_panel(chatPanel, chatWnd); 1838 replace_panel(chatPanel, chatWnd);
1837 replace_panel(logPanel, logWnd); 1839 replace_panel(logPanel, logWnd);
1838 replace_panel(chatstatusPanel, chatstatusWnd); 1840 replace_panel(chatstatusPanel, chatstatusWnd);
1839 replace_panel(mainstatusPanel, mainstatusWnd); 1841 replace_panel(mainstatusPanel, mainstatusWnd);
1840 replace_panel(inputPanel, inputWnd); 1842 replace_panel(inputPanel, inputWnd);
1843 }
1844
1845 if (0 == Log_Win_Height) {
1846 hide_panel(logPanel);
1847 } else {
1848 show_panel(logPanel);
1841 } 1849 }
1842 1850
1843 // We'll need to redraw the roster 1851 // We'll need to redraw the roster
1844 scr_update_roster(); 1852 scr_update_roster();
1845 return; 1853 return;