Skip to content

Commit

Permalink
Add status item to show when keyboard grouping is enabled.
Browse files Browse the repository at this point in the history
  • Loading branch information
tkatz77 committed Jul 11, 2019
1 parent e241b7e commit 85b2231
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/ConEmu/Options.cpp
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -816,6 +816,7 @@ void Settings::InitSettings()
isStatusColumnHidden[csi_ConEmuView] = true;
isStatusColumnHidden[csi_ServerHWND] = true;
isStatusColumnHidden[csi_Time] = true;
isStatusColumnHidden[csi_InputGrouping] = true;

isTabs = 1; nTabsLocation = 0; isTabIcons = true; isOneTabPerGroup = false;
bActivateSplitMouseOver = 1; // 1 - always, 2 - Regarding Windows settings (Active window tracking)
Expand Down
24 changes: 24 additions & 0 deletions src/ConEmu/Status.cpp
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,11 @@ static StatusColInfo gStatusCols[] =
L"System time",
L"System time"},

{ csi_InputGrouping,L"StatusBar.Hide.InputGrouping",
L"Input Grouping Status",
L"Input Grouping Status" },


{csi_SizeGrip, L"StatusBar.Hide.Resize",
L"Size grip",
L"Click and drag size grip to resize ConEmu window"},
Expand Down Expand Up @@ -449,6 +454,8 @@ void CStatus::PaintStatus(HDC hPaint, LPRECT prcStatus /*= NULL*/)
IsWindowChanged();
// Время, если показано
IsTimeChanged();
//
IsInputGroupingChanged();

if (!mh_MemDC || (nStatusWidth != mn_BmpSize.cx) || (nStatusHeight != mn_BmpSize.cy))
{
Expand Down Expand Up @@ -1138,6 +1145,9 @@ void CStatus::OnTimer()
if (!mb_DataChanged && IsTimeChanged())
mb_DataChanged = true; // Обновить время на статусе

if (!mb_DataChanged && IsInputGroupingChanged())
mb_DataChanged = true;

if (mb_DataChanged /*&& !mb_Invalidated*/)
UpdateStatusBar(true);
}
Expand Down Expand Up @@ -1923,6 +1933,20 @@ LPCWSTR CStatus::GetSettingName(CEStatusItems nID)
return m_Values[nID].sSettingName;
}

bool CStatus::IsInputGroupingChanged() {
if (mb_LastGrouped != mp_ConEmu->isInputGrouped()) {
mb_LastGrouped = mp_ConEmu->isInputGrouped();
if (mb_LastGrouped) {
swprintf_c(m_Values[csi_InputGrouping].sText, L"Grouping");
}
else {
swprintf_c(m_Values[csi_InputGrouping].sText, L"");
}
return true;
}
return false;
}

bool CStatus::IsTimeChanged()
{
if (gpSet->isStatusColumnHidden[csi_Time])
Expand Down
5 changes: 5 additions & 0 deletions src/ConEmu/Status.h
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ enum CEStatusItems

csi_Time,

csi_InputGrouping,

csi_SizeGrip,

//
Expand Down Expand Up @@ -201,6 +203,9 @@ class CStatus

bool isSettingsOpened(UINT nOpenPageID = 0);

bool mb_LastGrouped;
bool IsInputGroupingChanged();

public:
CStatus(CConEmuMain* _owner);
virtual ~CStatus();
Expand Down

0 comments on commit 85b2231

Please sign in to comment.